Tags

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

Reading a paperback by candlelight might sound romantic. Alas, it is a fucking pain.

‘I can’t read the unmasking,’ I told Arkwood, ‘cos a wax dripping has sealed the last few pages.’

Arkwood twisted the hem of his nightgown and frowned. ‘Perhaps I will fetch a pail of water from the well and boil us some hot potatoes on the grate.’

I was angry. ‘Or perhaps just phone an electrician and get us back into the 21st century!’

The stupid intoxicated fool had returned from the pub last night and pissed all over the fuse box, mistaking the cupboard for the toilet. Monita hit him over the head with a frying pan, mistaking him for a burglar. I stitched and bandaged his bloody skull, mistaking my emotions for sympathy. Now the house has no electricity.

Look what no light can do.

Here’s a water bottle in Blender – the 3D creation suite – with lighting providing wonderful shading and detail.

But once rendered onto my Oculus Rift virtual reality headset – using OpenGL graphics library and the Oculus SDK for Windows in a C++ Microsoft Visual Studio application – the bottle looks flat and lifeless.

Some basic lighting in OpenGL may help. I have already put together the ambient, diffuse and specular components of a Phong lighting model in my post, Phong lighting model and 3D audio.

So let’s start with the ambient component:

Add the diffuse component:

And top off with the specular component:

Wow! All the crevices and bulges of the water bottle are exposed, with the surfaces facing the light source being illuminated.

Ambient provides some colour to the bottle. Diffuse uses the light direction and Normal to brighten up the surfaces facing the light source. Specular uses the light direction, Normal and eye direction to provide the bright spots. It looks a million dollars of mineral water.

I struck a match. I lit the candle. And I went through to the kitchen to find the frying pan. I wanted to finish off what Monita had started.

Ciao!

Advertisements