Normal Map shading problems

Hm, interesting!
It looks more accurate! Hm. Still we have this problems, but overall shading more precise than before

Chromemat test:
Old normalmaps

Your method of generation:

I guess I need to try different baking softwares to see if theygive some different (accurate) results

3 Likes

Ho cool the reflection looks a lot better…

As far as i can tell there are no errors for me in my normal maps (with mikk tangent space).
Blender bakes correct by default.
For xNormal you have to activate “compute binormals in pixel shader”:

click the Tangent basis calculators tab,
then “select Mikk - TSpace”
click “Configure”

With this checkbox checked normal maps became even worse:

Standart generation with MIKKTSPACE tangent generator works as subtance without “compute space per fragment”

correct curved skydome in the planet of Saraksh from the “Prisoners of power”

:grin:

Not sure what the last image is supposed to be…

So… reflection
Here is the old way (classic tangent generator + classic normal map baked by substance painter)

The new way (mikktspace + compute tangent space per fragment in substance painter)

A lot better!!!

But the reference hurts…a lot.

Here we see the limit of the technique (pre baked env maps for performance) The maps are 128x128 in their higher resolution so of course, on plain mirrored surfaces it’s pixelated compared to sampling the env map directly in the shader.
Tbh I don’t know why we still have TBN inconsistencies… IDK what I can do more… If you guys have an idea… I’d like to hear it.

2 Likes

I also noticed problems with ibl.
I did look into it and if i comment out line 206 in the PBRLighting.frag it looks correct:

//prallax fix for spherical bounds.
rv = g_LightProbeData.w * (wPosition - g_LightProbeData.xyz) +rv;

But i don’t know what the purpose of that line is really, except that it is modifying the reflection vector somehow.

Also I’m 99% sure the irradiance should be sampled with the world normal and not the reflection vector. (The diffuse term is generally view independent)

2 Likes

This code allows to offset the parallax when you are neer the edge of the lightProbe area of effect.
Taken from this article Image-based Lighting approaches and parallax-corrected cubemap | Sébastien Lagarde

Maybe I should disable it if the radius is 0…to allow infinite lightProbe.

That’s a fairly good rate, I’ll try this :wink:

1 Like

Ok i use the normal now.
Here is the scene with a complete dielectric material with roughness 0.4:
This is using the world normal:

this is using the reflection vector

I’m not sure which one is correct tbh…
I’ll compare with substance painter…

1 Like

ok definitely normal seems a good choice for irradiance

Thanks again @Perjin, your help is invaluable on all these lighting stuff :wink:

3 Likes

Ah ok i understand the parallax correction part now, i think the problem is that this value has to be set correctly.
with a bounding sphere fitted to this test scene it looks like this:

with a really big bounding sphere it looks like no parallax (as expected).

Anyway i’ll try to implement the OBB Volume parallax correction, with those two it should be possible to cover many use cases.

3 Likes

Yep that’s the intended result.
But yeah for this kind of scene OBB would be a better fit, we wouldn’t have those reflection misalignments in the corners.
Bounding sphere was pretty easy, OBB is more difficult. Also we don’t have it as a bounding volume in the engine, so the first step might be to add it.

1 Like

I did some work on finite environment mapping http://www.youtube.com/watch?v=3v4WUyr6G3Q a while back, useful for indoor maps or ones with close grounds, would it be of any use to this stuff ?

4 Likes

Definitely :smiley:

1 Like

Ok the sample presented in Image-based Lighting approaches and parallax-corrected cubemap | Sébastien Lagarde is working fine, now i need to make it useable. (The values are currently hardcoded into the shader.)
http://i.imgur.com/XgAsuiR.jpg

5 Likes

This is A.W.E.S.O.M.E

2 Likes

NEEEAT! Sooo cool!

3 Likes

Normals works fine, but we have one problem if you scale model :frowning:
scale 1,1,1
Imgur
scale 10,10,10
Imgur

This thread is great, even if the math stuff only comes as static noise to me, seeing how each iteration the reflection on that gun improved was really nice.

The probe radius again, maybe?
I have to make something to support infinite radius. Makes sense in a space game.