Jump to content

About Camera's LayerMask


BlackMojito
 Share

Recommended Posts

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

 

Link to comment
Share on other sites

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 ? :P ) ,
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.

Link to comment
Share on other sites

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 ? :P ) ,
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?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...