Having trouble darkening the background of a scene

Hi there,

I have this section in my game where the player is choosing items and I wanted to keep the scene in the background but darken it off to draw focus to the items in the foreground.
So I just put a half transparent black mesh in-between. Which worked okay until I tested it on a retina device where it runs like a dog. I know it was a bad idea to do it that way but I can’t think of another way to do it. I originally tried to modify the colors of the scene elements and tint them but it became a bit of a nightmare to make sure they returned to their original tints.

Does anyone know a better way?

Thanks
Pete

I’m not sure of your game setup, but could it be possible to darken the ambient light of your scene, and then Shader Swap the Object on display to have a custom emissive light?

Another option would be to use a special shader for all objects with an extra Colour mulitplier regularly set to white. So the colour output is AllOtherEffects * Texture Colour * Vertex Colour * CustomColour. Then just use that CustomColour and slide it down on all objects except the selected.

I don’t have any lighting in the scene but i think your second idea would work. Only thing is, I’m not very good with shaders and I am trying to keep them as lean as possible. So I might just leave the background for the moment.

Thanks for the help though!

The ambient light is NOT a light per se but gives the scene visibility and tint. An example that changes the color to red.

RenderSettings.ambientLight = Color.red;

Just find the Vector3 of your current settings and multiply by .75 or subtract whatever. Then reverse the math or reset your values when your scene comes back to focus.

HTH
BTH

Thanks, I had no idea that even existed.
It doesn’t have any effect on my scene though as all of my shaders are “full bright” and the textures have the lighting built in.

Then loop through the shaders with a for each and set the color vector to multiply by .75. Then multiply back by 1.33 (I think??)

HTH
BTH