A problem with example Planet shader from wiki.

Hey.

I have no experience in writing shaders. Last couple days I have been trying to comprehend basic knowledge from Unity reference and Nvidia resources. I’ve run couple of example shaders, played with them, changed some things. But i stumbled on a problem i can’t easy bypass, even looking for solution and I think it might be a bug because it behaves differently on other environments (I use unity 3.5.6 on mac. I also tried pc and unity 4.0)

Ok - cutting to the chase:

I took this shader: http://wiki.unity3d.com/index.php/Planet

Effect is neat, I was looking for it:

but problem begins when I put skybox behind.

Instead of this effect I wish to have:

which i captured with game stopped.

I have this:

What I found is this needs the ZWrite parameter to be Off - because it uses transparency.
So I did (in Pass block) but then this glow-effect draws behind the skybox and can’t be seen.

I’ve been trying to play with tags and params like “Queue” and Cull (in Pass and SubShader blocks) - but no luck also.

Thank you in advance if you decide to write me anything which can point me where to look for solution of this.
For a beginner in this field this is a wall I cannot easly jump over :frowning:

I see this is an old thread but zero replies so I’ll reply just in case you have this issue (and maybe it will help someone else in the process =).

The problem you are experiencing is probably with the render queue and maybe when you played around with the Queue tags in the SubShader block (before the Pass block) you missed a combination that worked?

This works for me and it does not destroy the skybox (important that the tags block is in SubShader and not in Pass):

	SubShader
    {  
		Tags {
            	"LightMode" = "Always"            	
	    		"Queue" = "Transparent"
        		"RenderType" = "Transparent"
		}
 		Pass {
            Name "AtmosphereBase"

            Cull Front
            Blend SrcAlpha One
 
             // The rest of the code...