So I’m using this shader to display a mesh that just renders based on its vertex colors, with transparency:
Shader "Vertex color alpha" {
Category {
BindChannels {
Bind "Color", color
Bind "Vertex", vertex
}
SubShader {
Blend SrcAlpha OneMinusSrcAlpha
Pass {}
}
}
}
I don’t really understand shaders, but I managed to cook it up by looking at some vertex colored shaders people had written, and then adding some stuff.
Everything was working great, and stuff that was underneath the mesh (just stuff with colored material with a generic Diffuse) shader was rendering correctly. But now I’m starting to use Sprite Manager to render some of the stuff below the mesh, and it won’t render correctly anymore.
Basically anything that should be rendered with sprites by Sprite Manager doesn’t render at all, if it’s on the other side of this mesh. How can I change my mesh shader so that it still works the same way, but sprites on the other side will still render?
For reference, here’s the Sprite Cutout shader that Sprite Manager uses:
Shader "Sprite Cutout"
{
Properties
{
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
}
Category
{
SubShader
{
Pass
{
ColorMaterial AmbientAndDiffuse
Lighting Off
ZWrite On
Alphatest Greater .3
Cull Off
SeparateSpecular Off
//Blend SrcAlpha OneMinusSrcAlpha
SetTexture [_MainTex]
{
//constantColor [_Color]
Combine texture * primary, texture * primary
//Combine texture * constant DOUBLE, texture * constant
}
}
}
}
}
Any help would be greatly appreciated. Thanks!