N.E.C.
N.E.C.

Reputation: 115

How do I make an object visible in a render target, but not in the main scene in BabylonJS?

I've been experimenting with BabylonJS, and I want to make a visual effect that requires rendering parts of the scene in an external render target texture, but not in the main scene itself. Basically, I want to make the object invisible in the main scene, but visible in the render target.

See the Playground link here: https://playground.babylonjs.com/#PL5WU0

Currently, the sphere is drawn above the textured ground plane. How do I change it so the sphere is invisible, and can only be seen in the RT texture?

Upvotes: 1

Views: 1463

Answers (1)

David Catuhe
David Catuhe

Reputation: 1767

you can play with the layerMasks to hide the mesh from the main camera: https://playground.babylonjs.com/#PL5WU0#1

Upvotes: 3

Related Questions