Non BC5 Normal Map has orientation issue.

Hi there ,
Apparently normal map NOT compressed with BC5 seems to have some world orientation issue ( not sure what’s the correct term for it ) .

Right now my intention is to pack an alpha map into normal map to use as heightmap. For this I am using BC7.

Based on this answer , it seems to state that BC7 is a wise choice for normal map with alpha.

However, when using BC7 , the material editor now refuses to use it as Normal sampler type and forced it to be Linear Color. This could potentially be the root problem,but I’m not sure.

However, right now when using BC7 Linear Color sampler as normal map , it works normally until you rotate objects.
This is seriously bad because the object’s lighting randomly go wonky at certain rotation.

92116-rotate.gif

Hey Frozen, after the normal map texture, you might want to try a " Normalize" or " SafeNormalize" node.

That said, adding an alpha channel to a texture doubles the filesize, so it might be wiser to put three mask/height/grayscale textures in a seperate texture and only use the needed channel.

Hi Frozenfire,

BC7 is not intended for support for Normal Map compression. BC5 is meant to be used for Normal maps because it’s intended for compression of two-channel floating point data. BC7, on the other hand, is used for compression of 3 or 4 channel data which doesn’t fit well with Normal maps.

This page should be able to help you understand some of the processes behind BCn compression methods: Understanding BCn Texture Compression Formats – Nathan Reed’s coding blog

I hope this helps.

Tim

thanks for the very useful read. though i don’t understand 100% of it , I learned a lot.

so is it safe to say :

  1. non BC5 cannot be used for normal map at all? regardless of what is said in that link that is given?
  2. is there then any method to store heightmap in normal map that doesn’t flip my normals when rotated?

Best to use separate textures for your for your mask than to try and store in a normal map.

The Texture Compression Settings list in parenthesis the support formats. Using the page I linked above should be enough to start learning what each BCn format uses. If you’re unsure Google is a good source of informational resources. :slight_smile:

Your texture isn’t being sampled correctly. The “Normal” sampler type outputs values from the texture in a -1…1 range, whereas the Color types output them in a 0…1 range. If you simply take the output of your Linear Color-sampled normal map texture and multiply it with 2, then subtract 1, you should get the correct values to use!

1 Like

On further testing , I now think the compression is not relevant to the issue. At least it should not.

The texture is outputting the channels correctly, all 4 of them. The quality isn’t an issue here.
The individual channels are tested ( I did by plugging them to emissive ) , and they indeed are correct when viewed.

Still does not explain why the engine treats the output differently.
However , I will put this issue to rest until I have further information.

this seems to be correct. many thanks

It’s possible to store normal map just like you want but then you are giving up a lot. Also If you want to use height map for POM then it always should be stored on separate texture to minimize memory bandwith. Height map is sampled multiple times and only that channel is used. So other channels would just waste precious bandwith.