Change opacity of toon-shaded model

Hello everyone,

I have a model with a standard toon-shader in my scene. When the camera gets close to that model, I want to fade it out smoothly by simply reducing its visibility as the camera gets closer.
I know that there are some shaders which support this by using the

this.renderer.material.color.a

value, but unfortunately, the toon shader doesn’t seem to care about that value at all. I have no experience in shader coding at all, so I’m looking for an other solution.

Does anyone have an idea how this could be done?

Thanks,

Alan

If the shader doesn’t support transparency, the only other alternatives are to use a different shader or tweak it yourself to support it.

This probably belongs in the shader section, but we could look at what you need to change in the shader to make it work, which of the four toon shaders are you using in your game? (Basic/BasicOutline/Lighted/LightedOutline)

Hi,

thank you for your kind offer. The shader I’m using is the standard “Toon/Basic Outline” shader which comes with unity, and the “toony lighting” cubemap applied to it along with an RGB texture.