Accidental discovery... for semi-transparent geometry

Started by
2 comments, last by Tom Sloper 1 year, 2 months ago

Ok… been testing my game engine and this week decided to go for deferred fog.

All works fine.. except for… transparent geometry. Quite a few topics on this but basically because it doesn't write to the z-buffer fog ends up wrong for it.

Also… how to treat shadows. At the moment if transparent I just don't even worry about shadows.

Also… opaque stuff rendered front to back… and our transparent “friends” back to front.

Transparent adds at least 1 extra batch call and usually blend mode needs changing.

Been thinking about getting rid of semi-transparent geometry in my game.

OMG moment….

I stuffed up rendering of a test scene and my 20 by 20 array of geometry had some shapes only being drawn every second frame.

Thing is… these looked perfectly fine but 50% transparent, fog looked perfect… AND it cast 50% softer shadows where overlaps were also perfect. Bonus bit is all my transparent geometry has alpha at 50% and is only use for force fields, electric visors etc.

My game runs at 60 fps so… the 50% on/off for some geometry seems fine by me.

Posted a screen shot for reference… but as the effect is only when running… bit hard to see how nice it is.

Bit of a hack but it's simple and works. Hope this helps someone else.

Advertisement

I can see this kind of duty cycle being useful in combination with temporal antialiasing. Without TAA I would guess you see flickering artifacts.

AFAIK fog is done as a post process using depth buffer, after deferred shading.

This is not a Game Design question, so this is moved to a more appropriate forum. What is game design?

-- Tom Sloper -- sloperama.com

This topic is closed to new replies.

Advertisement