- Home /
Question by
ungalyant2 · Mar 29, 2012 at 08:16 PM ·
shaderoutlinetoonztest
Ztest shader issues
Hi guys, I'm currently using a Ztest toon shader written by someone else to allow for my characters to be seen when behind walls, however there is currently an issue with it, in that the shader is actually causing geometry on the character to draw in the colour through parts of the geometry blocking it, is there any way to have the shader not apply the rendering prioritisation to parts of the model's own geometry?
Here is the shader, again, this isn't mine.
Shader "Custom/ToonZtest" {
Properties
{
_Color ("Main Color", Color) = (0.5,0.5,0.5,1)
_Color2 ("Obscuring Color", Color) = (0.5,0.5,0.5,1)
_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_Outline ("Outline width", Range (.002, 0.03)) = .005
_MainTex ("Base (RGB)", 2D) = "white" {}
_Ramp ("Toon Ramp (RGB)", 2D) = "gray" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
UsePass "Toon/Lighted/FORWARD"
UsePass "Toon/Basic Outline/OUTLINE"
Pass
{
Tags {"Queue" = "Geometry+1"}
ZTest Greater
Cull Back
Color [_Color2]
}
}
Fallback "Toon/Lighted"
}
Comment
Your answer
Follow this Question
Related Questions
Display complex object when it is behind the wall 5 Answers
Better Outlines 0 Answers
Interior Outlines? 0 Answers
Silhouette Toon Shader 0 Answers
Display object with subobjects when it's behind the wall 0 Answers