Normal Normal Service is Resumed

This week, I distracted myself from NPC’s (again) by looking at the planned procedural shaders. Initially it was to be a short distraction – as a short mental ‘vacation’ as it were. The metal shader is just an ongoing experiment to see what I can achieve – but then I discovered that what I thought was ‘good enough’ normal mapping in the uber-shader (the one currently used for all the models in Dom), was actually totally screwed and not working at all as expected.

So, I launched into a crusade to fix up the uber-shader, which has been a long time coming. It was cobbled together many moons ago, and left ‘as is’ because it worked, with a view to rework it much later. That turned out to be a bit sooner!

I found some test normal maps on ‘tweb, more importantly ones with the original geometry that created them. That’s vital – as it can be hard to determine if the normal map is outfacing, or inward (raised, or embossed). My normal mapping code was inverted, and also lit from the wrong direction!

I tracked this down to badly calculated vertex tangents in the model parser in the end, but uber-shader has benefited greatly from the rewrite – and I could then plug the same code into the metal-shader and the result was pretty impressive.

What does all this jibber-jabber mean? Observe…

(4K) Fixed normal mapping at work!

(4K) Fixed normal mapping at work!

Now the pockmarks from micro-meteorite strikes, and the panelwork is a little clearer than it was previously. Granted – as they aren’t moving it’s a little hard to see any difference without zooming in. Enjoy the first 4K screenie 🙂 (But don’t forget this texturing etc. is still draft and not final!)

1 - The Cube - No Detail

2 - The Cube - Gaining Detail

3 - The Cube - Evident Detail

4 - The Cube - Close Up Detail

The idea behind the procedural metal-shader (which is badly named!) is to provide increasing detail as you get closer to a surface – way beyond what the texture map can provide. All it does is perturb the light bouncing off the surface, so it simulates the reflectivity of say brushed aluminium.

However, on my Mac Air running Windows 10 with Intel HD5000 graphics with a driver that barely works that Intel say is not their responsibility (bitter, yes!) it’s struggling to render a simple cube full screen! So I need to do some thinking, as it’s not just the crap Intel driver to blame here, the shader itself is pretty intense!

The long term goal is to combine this with Physically Based Rendering (PBR) – which is what is making the sketchfab rendering of the Imperial Naval Destroyers look so darned good!

So, having proven this idea works in principal – the next step is to integrate it with the uber-shader, and see what the outcome is like.

Anyway – achievement accomplished! And back to NPC’s…


  • Facebook
  • Twitter
  • Myspace
  • Google Buzz
  • Reddit
  • Stumnleupon
  • Delicious
  • Digg
  • Technorati
Author: Mak View all posts by

Comments are closed.

Subscribe to The Dominium Observer Newsletter!