🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Normal Mapping

Published November 09, 2016
Advertisement

Just a quick one to show that I am working hard on a big update to 3D Paint. Although for myself I only currently needed diffuse painting and rendering, it become clear to me it would be more useful for others if I could integrate some multi-channel painting. So since the last release I have switched to a later OpenGL and reworked the main viewport to use shaders. I was very pleased to find I could still use the old school OpenGL code alongside (I'm sure they will phase this out, but for now it is more convenient). :D

Being a maths retard it took me a while to fix the bugs in my shaders and work out my tangents from my bi-tangents, but touch wood it now seems to be mostly working and looks alright to my eye. :blink: At the moment I have a simple blinn-phong shader, and you can move around the light and change the diffuse / specular contributions.

My first thoughts were to bandit the alpha mask for each layer and at present you can use this to affect a bump/displacement map which is converted to a normal map for rendering. The normal map is 16 bit to help prevent banding, I may convert the alpha masks to 16 bit also. You can also of course use the procedural masking effects to affect the normal map. This is all far quicker than building high poly geometry in a modeller for a lot of normal mapping effects, which is good because I am lazy.

Of course I recognise that the process for most people will be to build a high poly model for normal mapping, then bake this to the low poly model in something like xnormal. I support this by allowing you to load an external normal map, which then can be combined as desired with the normal map created by 3D paint. :lol:

normalshark_zpsyt0ngxox.jpg

In this example you can see a simple procedural layer combining with a pre-baked normal map.

Next I will be adding support for the specular (gloss) map, and perhaps a roughness map and another channel such as mirroring.

Update
Being a nOOb to PBR etc I'm now facing the issue that there is no standardized shader model in games / vfx. :blink: Unreal seems to have a metallic channel, other systems may use other channels in their shaders with a different workflow.

Not sure on the best solution for this, ultimately I might have to have the shader model selectable, and this changes the channels that are available. But to start with I might just go for something similar-ish to unreal. But have no idea whether my shader will output anything resembling what you would see in unreal .. might have to do some research, see whether there are any standard shaders I can use for a WYSIWYG appearance.

5 likes 2 comments

Comments

lawnjelly

Specular map working. :)

glossmap2_zpszp3oup0m.jpg

November 10, 2016 11:39 AM
Choo Wagga Choo Choo
This looks like a really cool project. Thumbs up.
November 11, 2016 09:10 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement