Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Pastebin needs better syntax highlighting. This is a .shader file if that isn't obvious.
- // This shader is basically a placeholder that just holds properties mentioned in the other scripts.
- // Also I have made this shader SRP batcher compatible.
- Shader "Hidden/Harryh___h/Outline_Post_Process"
- {
- Properties
- {
- _HHO_OuterThreshold ("Outer Threshold", float) = 0.0
- _HHO_InnerThreshold ("Inner Threshold", float) = 0.0
- _HHO_OutlineSizeX ("Outline Size X", float) = 1.0
- _HHO_OutlineSizeY ("Outline Size Y", float) = 1.0
- _HHO_Rotations ("Rotations", int) = 6
- _HHO_DepthPush ("Depth Push", float) = 0.0
- _HHO_OuterLUT ("Outer LUT", 2D) = "white" {}
- _HHO_InnerLUT ("Inner Lut", 2D) = "white" {}
- }
- SubShader
- {
- Tags
- {
- "LightMode" = "Outline"
- }
- Pass
- {
- Name "Outline"
- HLSLPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- #pragma target 5.0
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
- #include "OutlineShared.hlsl"
- CBUFFER_START(UnityPerMaterial)
- TEXTURE2D(_HHO_OutlineOpaqueTexture);
- SAMPLER(sampler_HHO_OutlineOpaqueTexture);
- CBUFFER_END
- Varyings vert(Attributes IN)
- {
- Varyings OUT;
- OUT.positionHCS = TransformObjectToHClip(IN.positionOS.xyz);
- OUT.uv = IN.uv;
- return OUT;
- }
- float4 frag(Varyings input) : SV_Target
- {
- float4 col = SAMPLE_TEXTURE2D(_HHO_OutlineOpaqueTexture, sampler_HHO_OutlineOpaqueTexture, input.uv);
- return col;
- }
- ENDHLSL
- }
- Tags
- {
- "LightMode" = "OutlineDepth"
- }
- Pass
- {
- Name "OutlineDepth"
- HLSLPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- #pragma target 5.0
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
- #include "OutlineShared.hlsl"
- CBUFFER_START(UnityPerMaterial)
- TEXTURE2D(_HHO_OutlineDepthTexture);
- SAMPLER(sampler_HHO_OutlineDepthTexture);
- CBUFFER_END
- Varyings vert(Attributes IN)
- {
- Varyings OUT;
- OUT.positionHCS = TransformObjectToHClip(IN.positionOS.xyz);
- OUT.uv = IN.uv;
- return OUT;
- }
- float4 frag(Varyings input) : SV_Target
- {
- float4 col = SAMPLE_DEPTH_TEXTURE(_HHO_OutlineDepthTexture, sampler_HHO_OutlineDepthTexture, input.uv);
- return col;
- }
- ENDHLSL
- }
- Tags
- {
- "LightMode" = "OutlineDirect"
- }
- Pass
- {
- Name "OutlineDirect"
- HLSLPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- #pragma target 5.0
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
- #include "OutlineShared.hlsl"
- CBUFFER_START(UnityPerMaterial)
- TEXTURE2D(_HHO_Pass);
- SAMPLER(sampler_HHO_Pass);
- CBUFFER_END
- Varyings vert(Attributes IN)
- {
- Varyings OUT;
- OUT.positionHCS = TransformObjectToHClip(IN.positionOS.xyz);
- OUT.uv = IN.uv;
- return OUT;
- }
- float4 frag(Varyings input) : SV_Target
- {
- float4 col = SAMPLE_TEXTURE2D(_HHO_Pass, sampler_HHO_Pass, input.uv);
- return col;
- }
- ENDHLSL
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement