Jump to content

PBR and Bumpmaps


Rodrix3
 Share

Recommended Posts

Hey there lovely community!

I am such in love with this Babylon library and the entire community. 
I am so glad we made a switch to Babylon!

My question is about PBR and normal maps (called bump maps on code).
I am using a normal map (RGB blue map) in conjunction with PBR.

The result I am getting is horrible.

image.png.c38fc3f34e2c0b4facaefb9afaeeb107.png
The gloss/roughness effect is completely broken with very black shadows and the result looks very fake.
That is supposed to be a concrete floor (and it looks like an ocean with hard shadows)

Is there any setting that I am missing in order to make bump maps work nicely with PBR?

Some additional questions:

- How can I control bump  intensity? I am now modifying the bumpTexture.level, but most likely that's not the right way.

- How can I change the bump scale? I am now modifying the bumpTexture.uScale and  bumpTexture.vScale. Is that correct?

- Should the source image be inverted in any way and any setting should be enabled? I am using just the typical normal map you get from any library. 
Maybe Babylon uses a different covention from the typical?

- Should I set useParallax = true?

- Should I set useParallaxOcclusion = true?   (I tried both settings and I am still not getting nice results).

- Should I set forceIrradianceInFragment = true? (I just found about this one and not sure about )

- Is there anything I am missing?

Thanks!

P.S: I am loading the material from a gtlf file. The gltf file was created on 3ds Studio Max.
No matter how much I modify the intensity on 3ds Max it comes out similar, so I want to modify the intensity via code but not sure how.

Surely I am missing something about this whole thing, or maybe bump mapping is not fully supported on PBR?

Thanks again!

P.S.S: I don't care about performance. I want the best results possible (target machine GTX 1080...)

Link to comment
Share on other sites

About the intensity, it's indeed the level you have to tweak, same for uScale & vScale: https://www.babylonjs-playground.com/#K4S3GU#11 (l.26 for scale, l.33 for level).

Depending about your normal map (created for directX or OpenGL for example), you may have to invert Y or X in your material.

About parallax I can't say, I don't use it on BJS for now.

Link to comment
Share on other sites

Let me try to answer inline but a PG would really help in this case ?

The gloss/roughness effect is completely broken with very black shadows and the result looks very fake. That is supposed to be a concrete floor (and it looks like an ocean with hard shadows)

Hard shadows might be the result of horizon or ambient occlusion tricks we are using in the prb. They are usually fine for small variations but might be too strong with big normal changes. You can try setting: useHorizonOcclusion or useRadianceOcclusion to false.

Is there any setting that I am missing in order to make bump maps work nicely with PBR?

Some additional questions:

- How can I control bump  intensity? I am now modifying the bumpTexture.level, but most likely that's not the right way.

The level of the texture is the right way.

- How can I change the bump scale? I am now modifying the bumpTexture.uScale and  bumpTexture.vScale. Is that correct?

This changes like any texture in Babylon how tiling will be done with the texture assuming your texture is not in clamp mode.

- Should the source image be inverted in any way and any setting should be enabled? I am using just the typical normal map you get from any library. 
Maybe Babylon uses a different covention from the typical?

There is no typical convention, just differnent ones ? As you rely on GLTF, your image should follow the GLTF convention well detailed in the spec. In BABYLON by default the convention is not the same. You can play with invertNormalMapX and invertNormalMapY to inverse some of the axis in order to match with your expected conventions.

- Should I set useParallax = true?

This is only to enable parallax, and I do not think it is usefull in your case (ground concrete).

- Should I set useParallaxOcclusion = true?   (I tried both settings and I am still not getting nice results).

Same here.

- Should I set forceIrradianceInFragment = true? (I just found about this one and not sure about )

This would help getting more dynamicity from the environment irradiance at a bit of a perf cost. The irradiance will be computed per fragment instead of vertex so it will be more accurate at the expense of replacing the interpolation by a full compute of the irradiance per pixels.

- Is there anything I am missing?

I thin we covered it all but a playground would be nice here ? 

Link to comment
Share on other sites

20 hours ago, Sebavan said:

Let me try to answer inline but a PG would really help in this case ?

The gloss/roughness effect is completely broken with very black shadows and the result looks very fake. That is supposed to be a concrete floor (and it looks like an ocean with hard shadows)

Hard shadows might be the result of horizon or ambient occlusion tricks we are using in the prb. They are usually fine for small variations but might be too strong with big normal changes. You can try setting: useHorizonOcclusion or useRadianceOcclusion to false.

Is there any setting that I am missing in order to make bump maps work nicely with PBR?

Some additional questions:

- How can I control bump  intensity? I am now modifying the bumpTexture.level, but most likely that's not the right way.

The level of the texture is the right way.

- How can I change the bump scale? I am now modifying the bumpTexture.uScale and  bumpTexture.vScale. Is that correct?

This changes like any texture in Babylon how tiling will be done with the texture assuming your texture is not in clamp mode.

- Should the source image be inverted in any way and any setting should be enabled? I am using just the typical normal map you get from any library. 
Maybe Babylon uses a different covention from the typical?

There is no typical convention, just differnent ones ? As you rely on GLTF, your image should follow the GLTF convention well detailed in the spec. In BABYLON by default the convention is not the same. You can play with invertNormalMapX and invertNormalMapY to inverse some of the axis in order to match with your expected conventions.

- Should I set useParallax = true?

This is only to enable parallax, and I do not think it is usefull in your case (ground concrete).

- Should I set useParallaxOcclusion = true?   (I tried both settings and I am still not getting nice results).

Same here.

- Should I set forceIrradianceInFragment = true? (I just found about this one and not sure about )

This would help getting more dynamicity from the environment irradiance at a bit of a perf cost. The irradiance will be computed per fragment instead of vertex so it will be more accurate at the expense of replacing the interpolation by a full compute of the irradiance per pixels.

- Is there anything I am missing?

I thin we covered it all but a playground would be nice here ? 

Amazing! Thanks so much for answering all my questions :)

It seems I am getting the right results by lowering the intensity to 0.01. So the effect is much more subtle. I will continue testing and keep you posted.

 

Thanks again :)

 

 

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...