Rodrix3 Posted July 20, 2018 Share Posted July 20, 2018 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. 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...) Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted July 20, 2018 Share Posted July 20, 2018 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. Nabroski and Rodrix3 1 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted July 20, 2018 Share Posted July 20, 2018 Pinging @Sebavan Rodrix3 1 Quote Link to comment Share on other sites More sharing options...
Sebavan Posted July 20, 2018 Share Posted July 20, 2018 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 ? Rodrix3 1 Quote Link to comment Share on other sites More sharing options...
Rodrix3 Posted July 21, 2018 Author Share Posted July 21, 2018 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 Sebavan 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.