- Home /
Question by
DmitryHalyak · Jul 12, 2018 at 06:33 PM ·
deferred rendering
Shader with 2 surface pass doesn`t work on deferred render
I have shader with 2 passes. Both passes surface shaders. Second pass have alpha:fade. All work fine on Forward render, but second pass doesn`t work on Deferred render.
Shader "HD/Terrain/Terrain 2 Pass"
{
Properties
{
...
}
SubShader
{
Tags{ "RenderType" = "Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Standard fullforwardshadows vertex:vert tessellate:tesselationDistance
#pragma target 4.0
#include "Tessellation.cginc"
...
ENDCG
Offset -10, -10
CGPROGRAM
// Physically based Standard lighting model, and enable shadows on all light types
#pragma surface surf Standard fullforwardshadows vertex:vert tessellate:tesselationDistance alpha:fade
#pragma target 4.0
#include "Tessellation.cginc"
...
ENDCG
}
}
shader.jpg
(459.3 kB)
Comment
Answer by DmitryHalyak · Jul 13, 2018 at 05:33 AM
Solved by removing alpha:fade from second pass and adding decal:blend
And render tags for second pass is: Tags { "RenderType" = "Opaque" "Queue" = "Geometry+1" "ForceNoShadowCasting" = "True" }
Your answer
Follow this Question
Related Questions
How to enable antialiasing for Texture2D 0 Answers
Deferred rendering not working 2 Answers
Unity 5.5 global/Player render path setting? 1 Answer