BlackMojito Posted December 5, 2017 Share Posted December 5, 2017 Hi Folks, Just a question about the LayerMask: is there any way to keep the depth stencil buffers between the layers? I would like to apply different post processing pipelines to different layers so that I cannot use RenderGroup for this. http://playground.babylonjs.com/#QGW698#1, in the playground we can see that the ground is always in front of the sphere because its layer is bigger than the one of the sphere. Is there a way to not clear the depth buffer? Many thanks Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted December 5, 2017 Share Posted December 5, 2017 Hi @BlackMojito i don't believe it's so much to do with the layerMask (i could be wrong) but more to do with the fact that each camera is a render "layer" itself. // camera_A is rendered first, camera_B is rendered second, e.g. on top of camera_A's render. scene.activeCameras.push(camera_A, camera_B); Think of each camera like a transparent piece of plastic you draw something on, first you draw something on the first piece, then the second piece is put on-top of the first and then you draw something else on that. i mentioned it only shortly in my response to your "old" topic, as it didn't seem too relevant as the target for the first camera was a skybox, which i assume, will always be rendered in the background Pinging @Deltakosh for comfirmation (maybe even a solution ? ) , the above information is merely an assumption based on how the PG acts when different values are swapped around, i haven't checked the code which handles it. Quote Link to comment Share on other sites More sharing options...
BlackMojito Posted December 5, 2017 Author Share Posted December 5, 2017 1 hour ago, aWeirdo said: Hi @BlackMojito i don't believe it's so much to do with the layerMask (i could be wrong) but more to do with the fact that each camera is a render "layer" itself. // camera_A is rendered first, camera_B is rendered second, e.g. on top of camera_A's render. scene.activeCameras.push(camera_A, camera_B); Think of each camera like a transparent piece of plastic you draw something on, first you draw something on the first piece, then the second piece is put on-top of the first and then you draw something else on that. i mentioned it only shortly in my response to your "old" topic, as it didn't seem too relevant as the target for the first camera was a skybox, which i assume, will always be rendered in the background Pinging @Deltakosh for comfirmation (maybe even a solution ? ) , the above information is merely an assumption based on how the PG acts when different values are swapped around, i haven't checked the code which handles it. Hum...but if I would like to take into account the depth buffer rendered by the first camera, how can I do it though? Quote Link to comment Share on other sites More sharing options...
BlackMojito Posted December 5, 2017 Author Share Posted December 5, 2017 Hum...or...is there any way that we can achieve what as the screenshot below? In the PP pipeline, there are some algorithms which composite the two buffers. 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.