- Home /
How to make Transparent/VertexLit shader work fine
I wanna make my character transparent according user control. so I changed the character shader to Transparent/VertexLit shader. I can set the material's a color to achieve transparency. But when I changed to use Transparent/VertexLit instead of Self-Illumin/VertexLit shader. the character was rendered quite abnormal.
the hair seems intersecting with the head.I read the unity script reference. It said it was a sorting problem. But It didn't tell me how to fix this problem.
so anyone knows about this? :) thanks
Answer by AtomicHippo · Nov 14, 2011 at 09:18 PM
Have you tried this shader from unity wiki? http://www.unifycommunity.com/wiki/index.php?title=AlphaVertexLitZ
It should remove the multiply effect from facing polygons overlapping in screen space, which sounds the problem you're describing.
Hi, AtomicHippo. Thanks very much . your answer works on my problem!
Answer by m4a44 · May 27, 2013 at 08:14 PM
There is also this (a modification to the above):
Shader "Transparent/VertexLit with Z" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_SpecColor ("Spec Color", Color) = (1,1,1,0)
_Emission ("Emissive Color", Color) = (0,0,0,0)
_Shininess ("Shininess", Range (0.1, 1)) = 0.7
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
}
SubShader {
Tags {"RenderType"="Transparent" "Queue"="Transparent"}
// Render into depth buffer only
Pass {
ColorMask 0
}
// Render normally
Pass {
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
ColorMask RGB
Material {
Diffuse [_Color]
Ambient [_Color]
Shininess [_Shininess]
Specular [_SpecColor]
Emission [_Emission]
}
Lighting On
SetTexture [_MainTex] {
Combine texture * primary DOUBLE, texture * primary
}
}
}
}
Answer by gap · Nov 24, 2011 at 02:02 PM
Can this shader works with iOS device because still it is not showing the transparency ..
Your answer
Follow this Question
Related Questions
Transparent Objects within Transparent Objects 1 Answer
Transparent Shader Render Order Issue 0 Answers
Can i force a renderer with standard shader material to crossfade? 0 Answers
Transparent w/ Full Shadowcasting in Unity 5 1 Answer
Shader making mesh dissappear or greyed out after Unity Update 0 Answers