I have a game where there a multiple floor levels between the player switches. The floor is not present everywhere, so you can look through it. When 'working' (playing, building stuff, etc.) on a specific floor I want to add a transparency value to everything that is NOT on the current floor. Ho can I accomplish that, and what is the best/most efficient way to do that?
Order of rendering is important.
You need to draw the objects in order, draw objects far away first. Using alpha values ofc, for an example alpha = 0.5.
Think this is called back to fron rendering.
So if you stand at X, floor is |, object are 1,2,4...
X | 1 2 3 4
Then you render 4, 3, 2, 1 and finally the floor |.