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

Arkwood pursed his lips and said, ‘I just find it all so… unsavoury.’

What the hell! This coming from such a monstrous deviant, the like of which mankind has never before witnessed.

‘Raise the pinkie when drinking one’s tea. That’s all I ask.’

Posh he is not. Yet my chum is out to impress Lady Hawthorne, and gain access to her sizeable abode. He’s even taken to art films to culture his bones.

I cranked open my C++ Microsoft Visual Studio application, which makes use of the Oculus SDK for Windows and OpenGL to render a virtual abode of my own to the Oculus Rift virtual reality headset.

‘What about you ditch all those avant-garde flicks, and savour The Matrix. A classic. Put on the Rift and understand the virtual-ness of one’s existence.’

Just an ordinary set of rooms, with a bit of lighting as per my post OpenGL multiple lights.

A point light and a spotlight, that’s all. But what if we introduce an OpenGL emission map.

Arkwood’s jaw dropped. ‘Wow!’ he said, ‘I am here in The Matrix.’

Yep. Learn OpenGL provides the emission map exercise in its Lighting maps tutorial. It’s as if the walls, ceiling and floor themselves contain a light source.

If an emission texture is available to the fragment shader for the object we are rendering, we apply its value to the result of all our lighting calculations:

"if (uIsEmissionMap == true) {\n"
	"result += vec3(texture(material.emission, oTexCoord));\n"

Indeed, Alex Dee adds a comment to the tutorial with fragment shader code to fade in and out emission if such is your desire.

Arkwood plods on through the virtual rooms, and tries to make sense of some wooden containers on the floor with the spotlight upon his head.

Suddenly The Matrix explains all.

‘Ah, the numbers,’ he exclaimed, ‘Gottlob Frege was right!’

In a room with a point light he ponders.

But soon the answers are written on the walls.

Notice how the digits are burning through the wallpaper.

‘Don’t you see,’ I told my buddy, ‘Arithmetic has no place for the upper classes. Drop the Right Honourable Lady Hawthorne and join your brothers in the pub!’

Arkwood looked pained. ‘Alas, comrade, I can not. For I have a silver gown laced for the ball.’

Just then a carriage drew up and I knew I had lost him for good.