- Home /
Question by
Ending2019 · Aug 18, 2017 at 01:58 PM ·
shadertransparent shader
some problem with two-sided wireframe shader
Hi everyone! I have some problem with my two-side wireframe shader!!! And this is what I want:
But this shader is using cutout and i dont want to use it because of the "Jagged Edges" So i try to modify it to use depth test, and get this:
The backside of the mesh close to the camera, is been culling by the frontside which is behind the backside.
here is my shader:
SubShader
{
Tags { "RenderType"="Transparent" "Queue"="Transparent" }
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
Pass
{
Cull Front
LOD 200
CGPROGRAM
#pragma target 5.0
#pragma vertex vert
#pragma fragment frag
#pragma geometry geom
ENDCG
}
Pass
{
Cull Back
LOD 200
CGPROGRAM
#pragma target 5.0
#pragma vertex vert
#pragma fragment frag
#pragma geometry geom
ENDCG
}
}
Does anyone know how to fix this?? thanks~~~
Comment
Answer by Destolos · Aug 18, 2017 at 02:11 PM
Perhaps it is possible to solve the problem without an extra shader. https://docs.unity3d.com/ScriptReference/GL-wireframe.html could do it, but i didn't tested it.
Your answer
