- Home /
How do I apply a darken shader to a GameObject (contains a few renderers)?
Hello gurus, I'm drafting up a classic mahjong game (my first Unity game!) with a different spin and am having troubles showing depth with a non-orthographic camera. One idea is to give tiles further back a "fog" effect, a shader that applies more semi-transparent black the further back you see.
I didn't choose an actual fog effect as I would like to eventually show other 3D objects behind the puzzle and make highlighted tiles shine greatly, even if in the back.
Here's where I'm at so far:
An orthographic view (not ideal for my use case as I'd love to make use of perspective in the scene (and I'm aching to try out VR features!):
A perspective view (depth much more troublesome, shadows a good start):
Do you have thoughts on the best way to proceed? I feel I'm making good progress on aesthetics so far, but still have some distance to go. Thanks in advance for helping me advance as I learn.
UPDATE: I may be able to alter the albedo of the materials with a lerp/color multiplier. Let's see...
Your answer
Follow this Question
Related Questions
Intersection Highlight Shader -1 Answers
Depth Mask Shader Not Working As Intended 2 Answers
Reading from Depth Texture in Unity 2021.1.7f1 0 Answers
Rendering Depth Texture 0 Answers
Unity 5 fragment shader that writes custom depth into the depth texture 1 Answer