Parallax/Normalmap heightmap-bug?!
by Duion · in Artist Corner · 10/03/2013 (11:21 am) · 15 replies
I just noticed that there may be a bug in the heighteffect of parallax/normal mapping.
I have a texture where I have a heightmap in the normal for parallax, so higher parts become elevatedm, but the problem is now, elevated parts become darker the higher they are, leaving ugly artifacts. This is either a bug or some settings are wrong, because I believe if something should become darker it should be the lower areas, since less light reaches there.
Here is an image so you can see:

Any ideas what this is?
I have a texture where I have a heightmap in the normal for parallax, so higher parts become elevatedm, but the problem is now, elevated parts become darker the higher they are, leaving ugly artifacts. This is either a bug or some settings are wrong, because I believe if something should become darker it should be the lower areas, since less light reaches there.
Here is an image so you can see:

Any ideas what this is?
About the author
http://www.duion.com - Human Paradigm Specialist
#2
But this seems to be the reason, png works fine, I think I have to use dxt5nm instead.
10/03/2013 (1:16 pm)
dds dxt5But this seems to be the reason, png works fine, I think I have to use dxt5nm instead.
#3
If you feed a dds to a normal entry, it swizzles it automatically (ie: DXT5nm format). Can't really say that's the wrong approach (mostly because I'm still trying to decipher the compression interface enough to possibly add 3Dc).
10/03/2013 (1:28 pm)
Yep. Just this issue came up earlier this week with one of our own artists.If you feed a dds to a normal entry, it swizzles it automatically (ie: DXT5nm format). Can't really say that's the wrong approach (mostly because I'm still trying to decipher the compression interface enough to possibly add 3Dc).
#4
10/03/2013 (1:39 pm)
OK, now I remember why I did not use dxt5nm, it destroys the alphachannel, somehow, so heightinformation works not properly for parallax.
#5
Here is a comparison between dxt5 and dxt3 same settings:

You can build the heightmaps in a way so the problem is not visible much in dxt5.
Now it depends more on taste if you want to use dxt5 or dxt3.
10/03/2013 (1:55 pm)
Only solution left is dxt3.Here is a comparison between dxt5 and dxt3 same settings:

You can build the heightmaps in a way so the problem is not visible much in dxt5.
Now it depends more on taste if you want to use dxt5 or dxt3.
#6
DXT3 has a different alpha (explicit) then DXT5 (interpolated). Perhaps your tool doesn't write it in the proper format; Just a guess!
10/03/2013 (10:27 pm)
You're using gimp right? Did you try to use another tool for writing the DDS files; Photoshop + NVDIA DDS Format plugin for example?DXT3 has a different alpha (explicit) then DXT5 (interpolated). Perhaps your tool doesn't write it in the proper format; Just a guess!
#7
I know the difference between the formats and both save properly, as you can see from the alpha channel. DXT3 has a little interpolated alpha channel, only DXT1 has a very explicit alpha just on/off, DXT3 has some gradients, but not much, DXT5 instead has a full gradient of alpha.
DXT5nm instead destroys the alpha channel again.
10/04/2013 (1:12 am)
The gimp dds plugin has the same features I think.I know the difference between the formats and both save properly, as you can see from the alpha channel. DXT3 has a little interpolated alpha channel, only DXT1 has a very explicit alpha just on/off, DXT3 has some gradients, but not much, DXT5 instead has a full gradient of alpha.
DXT5nm instead destroys the alpha channel again.
#9
10/04/2013 (2:02 am)
Best solution I found so far is to cut off the places where the artifacts occur manually through range manipulation, means in this case eliminate all big very bright white spots in the heightmap.
#10
Not exactly, they both use the same amount of bits for the alpha channel, but use different techniques. DXT5 can look a bit smoother because of the interpolation.
The Gimp plugin does not have all the same features as NVIDIA's. What I meant was under the hood; how the gimp plugin writes the DDS file. So I only suggested you could try another method to check if the tool is issue here.
10/04/2013 (3:02 am)
Quote:DXT3 has some gradients, but not much, DXT5 instead has a full gradient of alpha
Not exactly, they both use the same amount of bits for the alpha channel, but use different techniques. DXT5 can look a bit smoother because of the interpolation.
The Gimp plugin does not have all the same features as NVIDIA's. What I meant was under the hood; how the gimp plugin writes the DDS file. So I only suggested you could try another method to check if the tool is issue here.
#11
But you can try a few exports yourself to see what happens.
10/04/2013 (3:30 am)
I tried another tool, with S3 and nVidia tool, no change. I could not test the specific photoshop plugin, because I have no photoshop, but I don't think this will make a difference, since I tested 3 variants of tools.But you can try a few exports yourself to see what happens.
#12
The part:
"The Green and Alpha channels are used because in the DXT format they are compressed using somewhat higher bit depths than the Red and Blue channels. Red and Blue have to be filled with the same solid color because most DXT compressors use an algorithm that compares differences between the three color channels. If you try to store some kind of texture in Red and/or Blue (specular power, height map, etc.) then the compressor will create more compression artifacts because it has to compare all three channels."
in the article was helpful, so what I experienced are compression artifacts because I stored additional information in the alpha channel, so the algorithm had to compare between all channels to build the final image and because there were strong white places in the heightmap, that interfered somehow with the rest it created these artifacts.
I just lowered the intensity of the heightmap a lot, so there is not that much difference anymore and it creates almost no visible artifacts.
10/07/2013 (10:31 am)
@AzaezelThe part:
"The Green and Alpha channels are used because in the DXT format they are compressed using somewhat higher bit depths than the Red and Blue channels. Red and Blue have to be filled with the same solid color because most DXT compressors use an algorithm that compares differences between the three color channels. If you try to store some kind of texture in Red and/or Blue (specular power, height map, etc.) then the compressor will create more compression artifacts because it has to compare all three channels."
in the article was helpful, so what I experienced are compression artifacts because I stored additional information in the alpha channel, so the algorithm had to compare between all channels to build the final image and because there were strong white places in the heightmap, that interfered somehow with the rest it created these artifacts.
I just lowered the intensity of the heightmap a lot, so there is not that much difference anymore and it creates almost no visible artifacts.
#13
So maybe there is something wrong in the engine, so that the areas that should be lighted, get darkened. As you can see in the first picture, the areas that are elevated become darker, so maybe it should be the other way around.
11/01/2013 (10:17 am)
This problem cannot be resolved completely, since it just depends on the angle the light hits the surface, if the angle is steep enough the artifacts will be back.So maybe there is something wrong in the engine, so that the areas that should be lighted, get darkened. As you can see in the first picture, the areas that are elevated become darker, so maybe it should be the other way around.
#14
Suggestion, in the parallax map. Don't make ANY area 100% transparent. I have noticed this 'bug' as well, especially in my cave stuff and some new projects I am working on. By experimenting with various settings I have found that 100% trans (within my texture tool, AKA GIMP 2.8) on parallax ends up with 'black spots' and this issue you are seeing (or at least VERY similar). If you keep your transparent areas at no more than 80% transparent, you can avoid the issue. In the end though, its all about 'experimentation', since each map will likely have a different percentage of transparency.
Ron
11/01/2013 (7:25 pm)
Duion, Suggestion, in the parallax map. Don't make ANY area 100% transparent. I have noticed this 'bug' as well, especially in my cave stuff and some new projects I am working on. By experimenting with various settings I have found that 100% trans (within my texture tool, AKA GIMP 2.8) on parallax ends up with 'black spots' and this issue you are seeing (or at least VERY similar). If you keep your transparent areas at no more than 80% transparent, you can avoid the issue. In the end though, its all about 'experimentation', since each map will likely have a different percentage of transparency.
Ron
#15
Your theory is also wrong, because the black spots appear where the heightmap is white, this means the least transparent part in the texture.
It is the other way around, the more transparent, the better, anything that is visible afterwards, will cause issues, when I make them so much transparent, that you almost cannot see the texture anymore, it is best.
11/01/2013 (7:34 pm)
I thought so, too, I corrected all and the issue was gone, but then with a very steep angle of light, they were back in.Your theory is also wrong, because the black spots appear where the heightmap is white, this means the least transparent part in the texture.
It is the other way around, the more transparent, the better, anything that is visible afterwards, will cause issues, when I make them so much transparent, that you almost cannot see the texture anymore, it is best.
Azaezel