Hello Everyone,
So basically I am trying to generate depth map of high quality.
And I am using the RTTs …createDepthStencilTexture()
Requirement
Using internal texture is kind of a compulsion for me.
And I don’t want to use BABYLON’s depthRenderer …
as there are some restrictions on depthRenderer I don’t want to face
- No Custom width, height of the depth map
- No Custom near, far for multiple DepthMaps
(as I might need multiple depth maps with different near, far)
The basic workflow goes like this…
- rendering the relevant meshes of the scene on a RTT
- Taking the internal depth texture (red channel) from the scene
- Creating a Grey Depth RTT using the internal depth texture
The Problem…
- Everything works fine…
- The only problem is it is inconsistent in generating depthMap
- Sometimes It generates correct depth Map…Sometimes a blank one…
PG
- Though I am performing this task in a large code base…
- But I am also able to reproduce this issue on the BABYLON’s PG as well
- Here is the PG: https://playground.babylonjs.com/#CLEFRK#5
- Try to Hit the Play button multiple times, and you can see the inconsistency
It would be great if you guys can help me with this…
- maybe the issue is with RTT generation…
- maybe the issue is with Internal texture
- maybe the issue is with promises, await, async
- maybe the issue is with download/read/base64 related APIs
- And you can suggest any other reliable method which can give same result
- The output should ideally be a base64 string of depthMap
- Downloading depthMap .png is for debugging
Thanks