Jump to content

How are Squad generating their Normal Maps?


Recommended Posts

I've been at a dead end with normal maps for a long while now.

I've used several programs to generate them, but they all had the same problem:

From some angles, parts of the normal map that should go inward, pop outward.

It's most visible in this screenshot, towards the top half of the image.

u6CzLOw.jpg

This model here uses this one.

d7183ffefd.jpg

This lead me onto looking at Squad's normal maps, which seem to be totally grey-scale.

443a54972b.jpg

So I suppose my question is, how can I get this style of normal map, and prevent the dreaded "popping".

Thanks :)

Edited by Beale
Link to comment
Share on other sites

Most of Squad's normal maps look pretty colourless, but they're not total grayscale,though some seem to be just bumpmaps. It may be that they either drastically reduced a colourvalue to reduce an effect or/and they might have also baked some normalmaps in objectspace.

(obj. is good for more static objects, not recommended for eg. characters where tangent space nrm-maps are appropriate)

I'm not sure what they did and it might also be a unity/ksp issue because I encountered the problem in ksp too, but not in other programs.

I solved it by reducing the overall strength.

Link to comment
Share on other sites

they look that way because that's how Unity handles normal maps. don't worry about the gray look, it's still a normal map as far as Unity is concerned.

import your tangent space (blue looking) normal map into Unity, in the texture inspector panel set it to "Normal Map" and that's all you need to do. If it looks inverted Up/Down in game, open the original (in Unity assets or the original original), and invert the Green channel (95% of the time). If it looks inverted Left/Right in game, invert the Red channel. export the maps as normal and things should look right in game.

You do want to add "_NRM" to the end of your normal maps file name for correct handling by KSP and ATM if you have it installed.

if you care about the technicalities

Standard Tangent Space normal map records XYZ in RGB channels. Generally 255-R = +X; 255-G = +Y; 255-B = +Z. some programs inverts Y direction for whatever reason.

Unity uses a slightly different way of handling Normal maps since DTX compression doesn't treat standard tangent space maps well. X is recorded in R, and duplicated into G and B channels; Y is recorded in Alpha channel. the graphics engine combines the map's X (RGB) and Y(A) with the mesh's Normal vector to get the final look for each pixel.

Edited by nli2work
Link to comment
Share on other sites

Most of Squad's normal maps look pretty colourless, but they're not total grayscale,though some seem to be just bumpmaps. It may be that they either drastically reduced a colourvalue to reduce an effect or/and they might have also baked some normalmaps in objectspace.

(obj. is good for more static objects, not recommended for eg. characters where tangent space nrm-maps are appropriate)

I'm not sure what they did and it might also be a unity/ksp issue because I encountered the problem in ksp too, but not in other programs.

I solved it by reducing the overall strength.

they look that way because that's how Unity handles normal maps. don't worry about the gray look, it's still a normal map as far as Unity is concerned.

import your tangent space (blue looking) normal map into Unity, in the texture inspector panel set it to "Normal Map" and that's all you need to do. If it looks inverted Up/Down in game, open the original (in Unity assets or the original original), and invert the Green channel (95% of the time). If it looks inverted Left/Right in game, invert the Red channel. export the maps as normal and things should look right in game.

You do want to add "_NRM" to your normal maps file name for correct handling by KSP and ATM if you have it installed.

if you care about the technicalities

Standard Tangent Space normal map records XYZ in RGB channels. Generally 255-R = +X; 255-G = +Y; 255-B = +Z. some programs inverts Y direction for whatever reason.

Unity uses a slightly different way of handling Normal maps since DTX compression doesn't treat standard tangent space maps well. X is recorded in R, and duplicated into G and B channels; Y is recorded in Alpha channel. the graphics engine combines the map's X (RGB) and Y(A) with the mesh's Normal vector to get the final look for each pixel.

Thanks for the help guys :)

And thanks for the technical explanation of what's happening.

I've tried flipping the green and red channels, but sadly I get the same results.

8d7e5033d3.jpg

To clarify, I've tried every combination of flipped/unflipped R+G channels.

Though the general bump map goes from in/out when flipping the green channel, I still get the inverting when viewed from an angle.

See the part illuminated is sticking outwards.

But the parts on the side are going inwards.

I always have to flip the Y-axis when converting bump maps into normal maps with GIMP's NormalMap plug-in. I don't know whether that's the case for other tools.

I'm using a program called "ss bump map generator". Not sure if anyone else is using this.

I've had no luck trying to install the GIMP plugin.

Edited by Beale
Link to comment
Share on other sites

that looks correct, the round corner rectangle areas appear to be indented consistently

Its harder to see with a static image, but basically they all should be "out"dented.

When highlighted by specular light they appear correct, but when moving into shadow they fade from pointing outward to inward.

Its a real headscratcher...

Link to comment
Share on other sites

I made many of the original ones simply by making a heightmap and running it through the NVidia normal map photoshop plugin. I know the problem you're talking about though... I ran into it on the indents on the underside of the Poodle engine, and never figured out why it happened there.

Link to comment
Share on other sites

I made many of the original ones simply by making a heightmap and running it through the NVidia normal map photoshop plugin. I know the problem you're talking about though... I ran into it on the indents on the underside of the Poodle engine, and never figured out why it happened there.

Thanks for confirmation that I'm not alone in this issue ( from the guy that made the original maps no less! :) )

I can only guess it's a KSP issue as the normals don't seem to have these issues rendered in the Unity window.

Anyway it is getting late and I have work in the morning, so I'll have to put off any more playing around.

Thanks for the help guys! :)

Link to comment
Share on other sites

Its harder to see with a static image, but basically they all should be "out"dented.

When highlighted by specular light they appear correct, but when moving into shadow they fade from pointing outward to inward.

Its a real headscratcher...

interesting... can you send me the normal map when you get some time?

Link to comment
Share on other sites

interesting... can you send me the normal map when you get some time?

As promised:

The Normal Map.png

Z7TCGvk.png

And the height-map it was generated from.

RKZiaFz.png

Do you have any mirrored or backwards UVs on your model?

An inverted UV space will lead to an inverted tangent frame, which causes normals to be interpreted backwards by the shader.

A good idea, this. So I went and checked the UV layout, but sadly they're all separate and oriented correctly. :(

Link to comment
Share on other sites

I'm almost positive that mirroring or scaling a mesh to the negative has no impact on the way normal maps reflect light, as long as you make the mesh normals point outside of the mesh.

One other program you can try to convert from bump to normal is xNormal. Click Tools and the converter you want is Height map to Normal map, and see if "swizzeling" Y to negative has the desired effect.

Link to comment
Share on other sites

I think your maps are working correctly and the indent/outdent flip is just optical illusion.

compare these two maps; I only inverted the Green channel; all else are the same. lower right corner is green channel of the normal map; left two are screencaps from Unity viewport and VAB.

http://i.imgur.com/m7NfCiN.jpg

vs

http://i.imgur.com/0KSqEA8.jpg

Link to comment
Share on other sites

I think your maps are working correctly and the indent/outdent flip is just optical illusion.

compare these two maps; I only inverted the Green channel; all else are the same. lower right corner is green channel of the normal map; left two are screencaps from Unity viewport and VAB.

http://i.imgur.com/m7NfCiN.jpg

vs

http://i.imgur.com/0KSqEA8.jpg

I think you're right :blush:

If this is the case, which one is "correct"?

The second image, it looks like (to me) that the 2D normal map is sticking outwards, the first image, it looks indented.

Thanks for your help and hard work in this! :)

Link to comment
Share on other sites

As promised:

The Normal Map.png

Z7TCGvk.png

And the height-map it was generated from.

http://i.imgur.com/RKZiaFz.png

Hey, a bit late, but I think this normal map^ needs its Green channel inverted. Red is correct tho, so might be why you thought it looked OK from some angles and wrong from others.

You can check your normal maps by just looking at them with a simple thumb rule: Consider the red and green channels as 3D reliefs that are lit from a side - Red lit from the right - green lit from above. So for a rectangle that's supposed to be extruded outwards you'd expect its right edge beeing lit by the red channel and upper adge being lit from the green channel.

Other games or applications might treat normal maps differently and require inverted channels but i think this is the "normal" way

Link to comment
Share on other sites

You can check your normal maps by just looking at them with a simple thumb rule: Consider the red and green channels as 3D reliefs that are lit from a side - Red lit from the right - green lit from above. So for a rectangle that's supposed to be extruded outwards you'd expect its right edge beeing lit by the red channel and upper adge being lit from the green channel.

I think it has finally "clicked" in my brain.

Thanks for the great explanation :) .

Link to comment
Share on other sites

The recent Squad artwork catastrophe has inspired me to dust off my modeling skills from 7 years ago. I used 3ds Max then, but now I'm learning Blender. My first project is a Blue Origin BE-4 engine, and I'm learning how to bake normal maps. I'm hoping it's a practical approach.

Edited by GusTurbo
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...