mr_pinc Posted October 2, 2017 Share Posted October 2, 2017 I'm trying to add a reflection probe for a few select meshes in a scene I exported with PBRs from 3Ds Max. I've greated a simple sphere that is also reflecting the selected pieces. The sphere works fine and is using a PBR material. The problem is that the imported meshes don't seem to be showing the reflections even though I've assigned the reflection probe's cubeTexture to the 'reflectionTexture' property of the PBRs I've loaded. Is there something else I'm missing? Is there additional values that could determine why I am not seeing the reflection in the loaded meshes? Quote Link to comment Share on other sites More sharing options...
Sebavan Posted October 2, 2017 Share Posted October 2, 2017 @mr_pinc Hello, Could you try to reproduce your issue in the playground ? The knot is a mesh using PBRMaterial and Probes here: https://www.babylonjs-playground.com/#28G6UT#59 Quote Link to comment Share on other sites More sharing options...
mr_pinc Posted October 3, 2017 Author Share Posted October 3, 2017 I believe it is because the materials are coming in as PBRMetallicRoughnessMaterial from max- I've changed only 1 line in the example - the knot's material is now of that type and no reflections. https://www.babylonjs-playground.com/#28G6UT#60 Quote Link to comment Share on other sites More sharing options...
Sebavan Posted October 3, 2017 Share Posted October 3, 2017 The naming is different in metallic roughness to fit with the GlTF convention: https://www.babylonjs-playground.com/#28G6UT#61 The conversion is documented here http://doc.babylonjs.com/overviews/physically_based_rendering_master#from-metallicroughness-to-pbrmaterial It is not reflectionTexture but environmentTexture in the simpler materials, sorry for the confusion. Quote Link to comment Share on other sites More sharing options...
mr_pinc Posted October 3, 2017 Author Share Posted October 3, 2017 I'm already using an environmental texture on the material, is there a way to composite the reflection capture and the environmental texture? Quote Link to comment Share on other sites More sharing options...
Sebavan Posted October 3, 2017 Share Posted October 3, 2017 No, they should be the same, as your probe will capture objects created using the same environment texture used elsewhere in the scene so the scene should fit together. Quote Link to comment Share on other sites More sharing options...
mr_pinc Posted October 3, 2017 Author Share Posted October 3, 2017 I don't quite understand. I have a scene with 10 meshes and all 10 have the same environment texture, a DDS that is effectively a skybox (the actual skybox is not visible). I want 3 of those 10 meshes to also reflect each other along with that original environment map. How do I combine the two? Quote Link to comment Share on other sites More sharing options...
Sebavan Posted October 3, 2017 Share Posted October 3, 2017 Hello, The 3 meshes relying on the probe will get the environment impact from the reflected objects. Let me try to draw it in paint: As you can see, the triangle ends up being like it would have been using the environment + reflection as the reflection already contains the environment information, One issue could happen if your probe can see the clear color of the scene meaning the probe would not look like the environment where nothing is rendered. For this you could add a skybox in your probe relying on the DDS file. Hope that helps. Quote Link to comment Share on other sites More sharing options...
mr_pinc Posted October 3, 2017 Author Share Posted October 3, 2017 Yes that was a great explanation thank you. The thing is though I am only using the environment texture of a skybox, I'm not actually rendering a skybox. SoI don't really understand how the reflection capture - could see it. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted October 3, 2017 Share Posted October 3, 2017 It can not but you can add one skybox only in your probe mesh list which would lead to the desired effect. Compositing would lead to incorrect result as it would be impossible to know how to blend, also it would be a perf sink as it would require another map + sampler + mix. We could try on a playground if you want. Quote Link to comment Share on other sites More sharing options...
mr_pinc Posted October 4, 2017 Author Share Posted October 4, 2017 I understand now, thank you. I set up a playground doing what you describe. Only thing is I don't know how to omit the skybox from main camera while keeping it in the reflection capture. https://www.babylonjs-playground.com/#28G6UT#66 Quote Link to comment Share on other sites More sharing options...
Sebavan Posted October 4, 2017 Share Posted October 4, 2017 https://www.babylonjs-playground.com/#28G6UT#67 scene.removeMesh(skybox) will be your friend Quote Link to comment Share on other sites More sharing options...
mr_pinc Posted October 4, 2017 Author Share Posted October 4, 2017 Perfect. Thank you for the awesome help. 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.