Page MenuHome

Bug in glossy shaders with the new reflection fix to Bump and Normal Map nodes
Open, Confirmed, MediumPublic

Description

System Information
WIN8 - Geforce 980ti - (but the bug happens also on CPU)

Description
The new reflection-fix (https://developer.blender.org/rBd6e769d32e7939e3bbd1986cdc4abd2b13135eab) introduces wrong shading in some cases (attached file)

How to reproduce
Just open the file attached and render, or preview in 3d viewport.
With pre-fix versions this doesn't happen, but of course we had black spots where the shader is self reflecting.

this is old 2.79a:

and this is the latest build with the fix:

Details

Type
Bug

Event Timeline

Lsscpp (lsscpp) renamed this task from Bug in glossy shaders with the new to Bug in glossy shaders with the new reflection fix to Bump and Normal Map nodes.

After further investigation, an information that might be useful to devs: set any bump/normal map node to zero strenght and you'll get the plain artefact, a black circle at grazing angle. Something that reminds me of wrong fresnel behaviour.

Brecht Van Lommel (brecht) triaged this task as Confirmed, Medium priority.Jul 31 2018, 5:32 PM

The problem here is that the correction code tries to get a reflection ray that is at least ~3° above the true geometry. However, we can get the case that the reflection will be below that even if the bumpmapped normal is exactly identical to the geometric normal by simply looking at the surface at a shallow angle.

As far as I can see, this problem can be solved by also letting cos_theta of the reflection go below 0.9*cos_theta of the reflection on the true geometry.

However, this still needs some testing, there still are random black pixels and there also is T56209, so my suggestion would be to add an option for the normal fix for now and consider removing it once all issues are fixed.

..., so my suggestion would be to add an option for the normal fix for now and consider removing it once all issues are fixed.

I still think it should be optional even if even if all the issues are fixed. You can make it default to be on, but I hope I can still have option to turn it off.
Normal map node sometimes not only used directly to end result visual, but it can also helpful for computation on tangent space. I personally do these kind of things often.

I'd rather not add options to the nodes. Ideally this fix could also work for smooth normals in general, and then it would more sense to apply it to normals going into BSDF rather than in the bump and normal map nodes. Maybe there can be a per-material option, but even then I would really like to see if it's really impossible to make this work better.

Yusuf Umar (ucupumar) added a comment.EditedAug 7 2018, 3:39 PM

I'd rather not add options to the nodes. Ideally this fix could also work for smooth normals in general, and then it would more sense to apply it to normals going into BSDF rather than in the bump and normal map nodes. Maybe there can be a per-material option, but even then I would really like to see if it's really impossible to make this work better.

Is there any reason to prevent it to be optional? I currently worked on an addon which need accurate normal calculation to works. Even if you somehow make it close to perfect, I don't think it will produce accurate normal. I hope you reconsider this.

@Brecht Van Lommel (brecht) I'm sorry, I think I misunderstood your comment. You're right, if reflection fix only applied to BSDF nodes, it will only affect the very end of material pipeline, so I think it will be okay if there's no option.