I want to use the colorTexture of the scene (not in the post-processing stage). I know that the depth map of the scene can be obtained through czm_globeDepthTexture. Then, is there a way to get the colorTexture of the scene ?
Whether it exists in a FrameBuffer, then use frameBuffer.getColorTexture to obtain it ?
I would like to follow up on this as I am also interested in getting some data directly from the frameBuffer. I have the following questions:
is czm_globeDepthTexture only available in prostProcessing stages? I use it successfully there but can not access it in a material fragment shader.
Instead, can I retrieve depthTexture from the framebuffer in a way similar to the one you described above?
Is there, anywhere in the “undocumented” API, a way to retrieve the colorTexture of the globe before anything else was drawn on top (models, billboards, etc.)
When using scene._view.pickDepths[0]._framebuffer._framebuffer from the default renderLoop, I get the previous frame depthBuffer when I actually want the current depthBuffer. (I tried to fetch it at preUpdate, postUpdate, preRender, etc. to the same result)
I pass the depthBuffer copied texture to a globeMaterial as a uniform but I noticed the delay between current fragment positions and the depthBuffer I copied.
Based on @Gabby_Getz previous comment, I looked into scene._defaultView.passState.frameBuffer but I believe it is already cleared (I read undefined) when accessing it from the renderloop.
Any pointer on how to best achieve this (getting current depthbuffer in globe material) ? Can this be achieve with what already exist or do I have to create my own drawCommand, etc.?