Graphics The Last Boundary

Camera + specular-map lighting + more

I’ve spent the last couple days trying to work out view-space vs world-space and how to incorporate lights into my shaders. It’s been difficult. The concept of a View space vs World space and when to use which is not a simple one.

Anyway, I now have materials with specular maps and diffuse maps (and a fallback to color when diffuse isn’t provided). My shaders are all working correctly and producing the lighting effects. I’ve also added a arcball type of camera only because I needed to see the lighting move around in real time.

While I was at it I added some more spheres to my scene with the white one centered on the light position. This is all done via an Object class which takes a pointer to an existing Material and Mesh. The light + object is moveable with the keyboard and the camera is moveable with the mouse. A couple of keys will also trigger the camera target to be the other static planet.

Larger scene
Larger scene

It’s starting to look like space.

Leave a Reply

Your email address will not be published. Required fields are marked *