Jump to content

Bug with bump + reflection when roughness param used


Vousk-prod.
 Share

Recommended Posts

Hi everyone,

 

With DK we spotted a bug in the standardMaterial when materials are using combination of bump / reflexion / roughness.

 

If a reflexionTexture (CubeTexture) is used, the roughness param is perfect to blur it.

When a reflexionTexture and a bumpTexture are used together, everything is ok.

But when we activate roughness on that combinaison of reflexion and bump - bang - awful artifacts appears.

 

You can see that in this playground :

http://www.babylonjs-playground.com/#1MYQJJ#71

(comment / uncomment lines 43, 44)

 

It's a bit tricky to debug because the shaders calculations seem correct. Could other eyes dive into it and help us spot the culprit function ?

 

 

Link to comment
Share on other sites

The more I observe this, the more I think it looks like the bump texture become too much sensitive to image compression artifacts when roughness is activated, making the speculars produced by reflexion covered with "too high value" spots.

 

The bump texture used here is a png but if we check it deeply enough in photoshop, we can see a (very very) little bit of compression artifacts, and those area can correspond to the ugly dots in the PG.

Link to comment
Share on other sites

 create bump with normal map but not like your pic

 

you can make from here and dont change any thing

 http://cpetry.github.io/NormalMap-Online/

 

http://185.88.152.218/pub/preview#23

 

 vec3 newNrm  = vec3(normalize(normal-(normalize(  nrmTextureColor  )*2.0-1.)*-0.5));

 

it work fine

 

only reflect :  http://185.88.152.218/pub/preview#10209

Link to comment
Share on other sites

 create bump with normal map but not like your pic

 

you can make from here and dont change any thing

 http://cpetry.github.io/NormalMap-Online/

 

Thanks for the help but my pic is already a "real" normal map.

In the bump slot of the first cube only - on the left -, the second cube uses a classical black and white pic as bump data, that was on purpose, to check if the bug is or not related to actual normal map information (but it seems not).

 

I already know the online tool you mentionned, usually I use SSBumpGenerator (or sometimes the good old fellow CrazyBump) to generate my normal maps but this one is nice also (just a little lack of params to my taste).

However, to check you proposal, I've switched my normal map in the PG with the default normal map created with this online tool.

And the result is exactly the same :

http://www.babylonjs-playground.com/#1MYQJJ#73

 

Here we can check the pic exported by the online tool and see that it has some noise in it (no problem, that's often required, many material simulations need some noise in the bump). We can then clearly see that this noise acts logically when no roughness, and acts strangely when roughness activated.

 

To do more checks, I exported an other normal map with this tool, from a very clean starting pic and adjusting the blur/sharp param to avoid unwanted additional noise :

http://www.babylonjs-playground.com/#1MYQJJ#74

Same problem (in fact, we can even better see it, just go near the different sides of the cube and look at a sharp angle).

 

The artifacts are not due to my previous normal pic used, it is related to the way the calculations are done when roughness is activated.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...