- Home /
Composite screen shader with transparency?
Hi everyone,
I am building a shader based off the the funky glow shader in the Shader Replacements asset sample. Everything is working really well except one part. Rendering the separately labelled render types with transparency. I have a sphere which is being rendered under the rendertype of metaball, and I added a quad with a custom unlit shader that renders a radial radient (white to transparent):
The combination script (reminiscent of RenderFunkyThinks.shader) looks like this:
Shader "Hidden/RenderBulletShader" {
// draw out items in plain color (untinted) that are
// rendered with metaball tag.
SubShader {
Tags { "RenderType"="Metaball" }
Pass {
FOG { Mode Off }
Color (1,1,1,1)
}
}
// render out all other pixels as empty nothingness
SubShader {
Tags { "RenderType"="Opaque" }
Pass {
FOG { Mode Off }
Color (0,0,0,0)
}
}
}
I thought that the Color(1,1,1,1) was just a tinting function, but it turns out that it will turn all pixels rendered to that render type white. is there a way to retain the color/transparency?
Btw, running it now it looks like this (Not what I want):
Your answer
Follow this Question
Related Questions
Decal Alpha Blend 0 Answers
Add Color Property to Unlit Alpha? 1 Answer
Wrong weighted order transparencry 0 Answers
Transparency and texture atlases, shader calls affecting performance? 2 Answers
Shader based camera compositing. 2 Answers