MainFrame Devlog

Runtime Reflections

I didn't work on the game much this week. I did however work out some runtime reflection logic.

I created a second camera that is my runtime reflection camera. It renders to a texture that I can use in my shaders. The uv's for the texture are the screenspace uv's. The I wrote a C# script that sets the orientation of the reflection cam to be the reflected forward direction of the main cam. The X and Z position are that of the main camera and the Y position is the inverse of the main camera's Y position with respect to the ground plane. I also had to invert the V coord of the render texture in my shader.

This worked out quickly and it felt good to get something done that I wasn't sure I could do myself. I also removed bullets from the runtime reflection camera because it looked like more bullets coming at the player than there actually were.