Cubemaps Breaking

Alright, I’ve been working with the shaders here for a month or so, and I’ve hit some kind of roadblock. I’ve got a shader based on the Toon Shader that lights a static environment. I’ve written a new version of it to use UV 2 for an alpha mask, but every time I try to play the game it breaks the cubemap. Any idea what’s going on here?

Shader "Toon/Path" {
	Properties {
		_Color ("Main Color", Color) = (.5,.5,.5,1)
		_MainTex ("Base (RGB)", 2D) = "white" {}
		_ToonShade ("ToonShader Cubemap(RGB)", CUBE) = "" { Texgen CubeNormal }
		_PathAlpha ("Path Alpha (A)", 2D) = "" {}
		_AlphaCutoff ("AlphaCutoff", Range (0.01, 1)) = 0.5
	}

	SubShader {
		//Tags { "RenderType"="Opaque" }
		ZWrite On
        Alphatest Greater [_AlphaCutoff]
        Cull Back
		Pass {
			Name "BASE"
			BindChannels {
				Bind "Vertex", vertex
				Bind "texcoord", texcoord0
				//Bind "texcoord", texcoord1
				Bind "texcoord1", texcoord2
			} 
			SetTexture [_MainTex] {
				constantColor [_Color]
				Combine texture * constant, texture
			} 
			SetTexture [_ToonShade] {
				combine texture * previous DOUBLE, previous
			}
			SetTexture [_PathAlpha] {
				Combine previous, texture
			} 
		}
	} 
	
	Fallback "VertexLit"
}

Still haven’t figured it out. Anyone have any ideas?

What’s the difference between the two images, other than a camera offset?

(Also, you don’t need the , texture and , previous if you’re not using the alpha channel from the first stage as a mask.)

Included two test cases. When Its working, it uses the cubemap to shade the surface. When its not, it appears to shade the whole thing by 1.0, hence making it flat all the way across curved surfaces.

That last screen shows how the surface appears unshaded across all angles. Is this possibly a problem with the shader trying to shader the back side of the object or something? So far, we’ve not seen this problem occur on anything else using our cubemaps. Perhaps its specific to the cubemap?

Finally figured it out. The bind channels were interfering with the texture coord cube map.

Completed Shader:

//Path Shader by Joe Bush @ Controlled Chaos Media
Shader "Toon/Path" {
	Properties {
		_Color ("Main Color", Color) = (.5,.5,.5,1)
		_MainTex ("Base (RGB)", 2D) = "white" {}
		_ToonShade ("ToonShader Cubemap(RGB)", CUBE) = "" { Texgen CubeNormal }
		_PathAlpha ("Path Alpha (A)", 2D) = "" {}
		_AlphaCutoff ("AlphaCutoff", Range (0.01, 1)) = 0.5
	}

	SubShader {
		Tags {"IgnoreProjector"="True"}
		ZWrite On
        Alphatest Greater [_AlphaCutoff]
        Cull Off
		Pass {
			Name "BASE"
			BindChannels {
				Bind "Vertex", vertex
				Bind "Normal", normal
				Bind "Color", color
				Bind "texcoord", texcoord0
				Bind "texcoord1", texcoord1
				Bind "texcoord", texcoord2
			} 
			SetTexture [_MainTex] {
				constantColor [_Color]
				Combine texture * constant
			}
			SetTexture [_PathAlpha] {
				Combine previous, texture
			}
			SetTexture [_ToonShade] {
				combine texture * previous DOUBLE, previous
			}

		}
	} 
	
	Fallback "Toon/Basic"
}