[BUG] Object fader changes opaque material colours when not set to auto

DankP3

Active member
1. Character controller variant (Ultimate Character Controller, First Person Controller, etc).
UCC 2.1.9

2. Unity version (include which SRP, beta Unity versions aren't supported)
2018.4.11f1 standard shaders

3. Bug description

Observed:
When Object fader "Auto Set Mode" is false it should only affect shaders that have transparency (presumably transparent, fade and cutout)?
However, object fader still effects colour changes on opaque objects.

Expected:
Expect Object fader to not change at all, other props

4. Steps to reproduce
Add an opaque shader object into path of camera and set a colour in the object fader script.

In the below example, there is a faded wall (fade is black with full transparency) in front of the vault area, but the vault has an opaque shader, however still changes colour as seen in the inspector.


5. The full error message (if any)
N/A
 
Are you sharing the same material between the vault object and the wall? I just tried to reproduce this by changing the TopDownCeiling material in the demo scene to Opaque and then moving the character through the hallway on the roof which uses that material. When I did this the ceiling stayed opaque. Any chance you can repro it within the demo scene?
 
No, the material was not shared, it was just a standard transparent shader, black colour no textures on the wall. The fader colour was set to black with full transparency. I will test in the demo scene.
 
@Justin

this is in the demo scene. The two planes have box colliders and the green one has an opaque shader and the black one has a fade shader (the materials for these two are distinct and not used elsewhere). I have relocated a vault nothing else is changed. After starting the game i have manually put on the pseudo 3d ViewType (just to stop the camera collision repositioning around obstacles). No errors, only the incorrect ViewType warning. Note how the green opaque shader changes to the black fade colour and back again. there is also something odd going on with the reappearance in that they seem to fade back in to white and then snap to their colour rather than transition to their colour.


This is my fader fader.PNG
 
Thanks for the steps. This can be fixed by changing line 426 of ObjectFader to:

Code:
canFade = materials[k].HasProperty(m_ColorID) && materials[k].renderQueue >= (int)UnityEngine.Rendering.RenderQueue.Transparent;
 
Top