I try to find a way to force DepthRenderer include information about meshes that are change inside vertex shader. Is it possible? And how I can implement if there are some ways?
In this playground I created a post process where I blend original scene render and depth texture. So what I want to acchieve is see sphere moving by Y in depth map. I understand that I can just move this sphere by Y without manipulations in material . But real-use situation is much complex
You don’t see the sphere in the depth texture because the node material is considered as transparent because you linked something to the alpha component of FragmentOutput. You can either set scene.enableDepthRenderer().forceDepthWriteTransparentMeshes = true or connect a Color3 to FragmentOutput.rgb to leave the alpha input unconnected:
However, the changes in the vertex shader of a node material is not supported by the depth renderer, so you won’t see the sphere move in the depth texture.
Good news is that once this PR is merged, it will be easy to make it work in a frame graph:
Frame graph is still a work in progress, so there’s no documentation yet and the API is tagged as “@experimental” at the time (meaning it can change at any time), but we plan to release a first version in 8.0.
Yes, you can use a frame graph as part of a normal scene rendering instead of being the main driving component (as in my first PG) and extract a texture from it: