🎉 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 map flickering

Started by
6 comments, last by Thaumaturge 2 years, 1 month ago

I'm having major temporal stability issues (Moiré patterns and flickering) with my normal mapping. Technical details:

Normal map is generated from cotangent frame (peturbed normals), and then stored in RGB16F format. The video shows the difference of rendering the scene with peturbed normals and interpolated normals.

Has anyone experienced this issue before / can guess to why it is happening? (It's making me go crazy :P )

Thanks!

Advertisement

Could it be that your normal-maps lack mip-map levels? (Or some equivalent, if mip-maps are not applicable to the specific technique in question; I'm not familiar with it.) That's my first thought on seeing the artefacts in question.

MWAHAHAHAHAHAHA!!!

My Twitter Account: @EbornIan

@Thaumaturge Sadly, they do. But I did also discover the same issue when normal mapping is disabled, so it's probably something in the albedo buffer. But the issue is much more apparent when normal mapping is on.

Everything is mipmapped, I use bi-linear filtering, and also linear filtering between two nearest mipmaps (`GL_LINEAR_MIPMAP_LINEAR)`. Albedo buffer uses float16 (have tried with float32 and unsigned byte). Same issue with lighting and tonemapping disabled. Then I disabled double-sided rendering (cull backfaces) - helped slightly, but issue is still very prevalent. Added FXAA for fun, no difference though.

Mipmapping was also my first thought - perhaps the textures simply have too high resolution, but the mipmapping and filtering should solve this issue.

But thank you for the suggestion! Any other good ideas?

Ah, fair enough!

Hmm… My next thought, then, is that, noting that it seems to happen at various distances, perhaps your normal-maps are too detailed. That, essentially, you're running into the same problem as when eschewing mip-mapping by virtue of having normal maps so large that they always have significant detail at a sub-pixel scale.

So: What happens if you reduce the scale of your normal-maps?

MWAHAHAHAHAHAHA!!!

My Twitter Account: @EbornIan

I also first thought about missing mip maps.

Maybe something stupid goes on, like gpu dirver set up to render at 4K and then down scaling badly. Does not really make sense, but maybe there are some driver settings one could mess up.

After that i would play with texture lod to use lower mips than the default.

@Thaumaturge You were absolutely right about the mipmap sizes! I could see your just as helpful comments here:

https://www.gamedev.net/forums/topic/711994-flickering-when-moving-the-camera/

And Travis for his Kohi game engine series on youtube:

https://www.youtube.com/watch?v=Uk2p3vKBMXE&list=PLv8Ddw9K0JPg1BEO-RS-0MYs423cvLVtj&index=61

So apparently, I'm not the only one experiencing problems with this particular model. I tried for fun to add Bloom using non-thresholded downsampling with Karis average [Jimenez 2014], and you can see in this video that I'm suffering immensely from fireflies:

Then, thanks to your help, I was able to google the right stuff:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 1);

This completely solved the fireflies problem, and almost removed the Moiré artifacts from the albedo buffer. So all along it was due to bright subpixels. I'm new at this and just learned about HDR last month, so this was stressing me out a lot!

I'm importing the model with a scale of 0.025f, so I'm thinking even setting the mip base level to 2.

Hopefully this will help other people as well. Thank you again for your inputs! Greatly appreciated ?

Ah, I'm glad that you made such progress! And I'm glad to have been of help. ^_^

MWAHAHAHAHAHAHA!!!

My Twitter Account: @EbornIan

This topic is closed to new replies.

Advertisement