jhadenfeldt Posted October 31, 2018 Share Posted October 31, 2018 I am having a hard time getting a depth map to work within my project. I understand that the depth map should be a grey scale image with the elements closer to the camera being colored darker. In my project though, I only get a 1 bit image (the plane on the left has the depthMap as a diffuseTexture). I tried my depth map code on the playground and I get the desired outcome, but I can't port my whole project to the playground. Does anyone know what could cause this issue? Quote Link to comment Share on other sites More sharing options...
JohnK Posted October 31, 2018 Share Posted October 31, 2018 Hi @jhadenfeldt and welcome to the forum. Publishing the PG that you have that works with a description of how its use differs in your project would be helpful. GameMonetize, bghgary and jhadenfeldt 3 Quote Link to comment Share on other sites More sharing options...
jhadenfeldt Posted November 1, 2018 Author Share Posted November 1, 2018 (edited) So I was able to reproduce the case in the playground: https://playground.babylonjs.com/#NH8QH5 Why does the depth map not look like in this example? https://www.babylonjs-playground.com/#T5YWJQ#4 Edited November 1, 2018 by jhadenfeldt added missing link Quote Link to comment Share on other sites More sharing options...
Guest Posted November 2, 2018 Share Posted November 2, 2018 This is because of the scale of your depth: https://playground.babylonjs.com/#NH8QH5#1 (check line 8 and 9) jhadenfeldt 1 Quote Link to comment Share on other sites More sharing options...
jhadenfeldt Posted November 2, 2018 Author Share Posted November 2, 2018 Ooh, that makes sense! Thank you! I feel like that could be added to the documentation here: https://doc.babylonjs.com/how_to/how_to_use_depthrenderer_to_get_depth_values Would you accept a PR if I extend the documentation? Quote Link to comment Share on other sites More sharing options...
JohnK Posted November 2, 2018 Share Posted November 2, 2018 We always welcome added explanations to the documentation including any example playgrounds that help clarify the issue. All documentation PRs are reviewed and help and advice given, if needed, to produce a successful submission. If you have not done so have a read through this post One missing point - after Quote To get all the tools used by the site, just execute the following command line: "npm install" (just do it once) You need to do npm install -g grunt-cli Any problems let us know. jhadenfeldt 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.