Hi guys
I am currently studying an MA in Games Art and am looking to recreate t
his room from Ex Machina in a mobile games project. The view point will be from the protagonists point of view looking at Ava. My tutor is concerned that the quality of the end result will be lowered because glass in Unity on mobile doesnt produce reflections and takes a lot of power. Could anyone provide me some good examples of glass reflections in a working mobile game?
My other option is taking on a very graphics intensive detailed scene that I am worried may be a bit messy.
Replies
The glass reflection is usually done by rendering the scene a 2nd time, storing that in a new texture, and mapping it in screen space back onto the glass. The extra rendering slows things down, and the new texture hogs memory.
You can optimize the 2nd rendering by hiding things unseen by the glass, simplifying the shaders of reflected things, removing small things from being rendered, only updating the 2nd render every few frames, reducing the 2nd render resolution, etc. But it's still a big hog.
A lot of mobile games use the old-school technique of flipping the entire scene and putting it behind the glass, then rendering it with a bit of transparency. The first Duke Nukem famously did this.
https://www.quora.com/Why-do-so-many-video-games-have-an-aversion-to-using-working-mirrors-in-their-environments
That way the whole scene is rendered in one go. But this wouldn't work in your case since the part behind the glass isn't covered on the sides.
I would just use a baked reflection probe, and not render the character in the reflection. This is a mobile game after all.
https://docs.unity3d.com/Manual/ReflectionProbes.html
Realtime means it re-renders dynamically, which would likely cause a significant performance drop. Cube is 6 renders.