, , , , , , , , , , , , ,

There were three people in my house.

Monita was in the bathroom applying lipstick. Peters was in the kitchen burning toast. And Arkwood was in the lounge, lounging.

‘Get your dirty boots off my sofa,’ I screamed, kicking his hiking boots with my bare foot.

She appeared, with misplaced red lipstick. ‘No mirror deary, oh what a mess.’

I leapt to the Oculus Rift virtual reality headset, cranking up my C++ Microsoft Visual Studio application (with the Oculus SDK for Windows).

‘Put this on,’ I said proudly, ‘it has a mirror!’

I had coded some OpenGL environment mapping to reflect the mountains and lake of my skybox on the surface of some floating containers. Learn OpenGL article Cubemaps has all the detail.

Here’s a video of Monita exploring the reflections of the vast outdoors:

The fragment shader of each container works out the reflection of the viewing direction, and uses it to sample the skybox texture.

Monita said, ‘What use are these mirrors to me, honey? They help no with the makeup.’ She pouted.

I was about to point out that the lipstick on her face already looked like a line of mountains when Peters walked through with sooted toast, setting off the fire alarm. The piercing sound gave Arkwood the shock of his life, and he crashing into the glass coffee table, sending reflective shards everywhere. Which I trod on with my bare feet, as I rushed to help.

Peters chomped on a slice of toast and bellowed, ‘Keep the noise down!’ So I kicked him square in the testicles with my blooded foot.

But anyway, you probably just wanted to know about OpenGL environment mapping and reflection.