Page 1 of 1

How to clear Zbuffer without using legacy nodes or layers?

Posted: 06 Apr 2018, 16:12
by gaz99
Hi,

I'm wondering if there is a way in Ventuz 5 to clear the Z buffer in the same layer without using the legacy view-port node. I have attached an example where I want to animate objects over the top of other objects without them clipping into each other. When the view-port is enabled with the clear z option the behavior is how I want it.

The only other way to do this would be to use a separate layer.
I am trying to avoid this way if possible because although my example is simple,
in my real project the object containers have links to other containers/scripts/animations (both inputs and outputs).
This would mean I would have to expose a lot of things up to layer level on both layers so they could interact with each other just to get the same behaviour.

Was there any progress with the requests to bring the node back? (http://forum.ventuz.com/viewtopic.php?f ... port#p9986)

Cheers,
Gaz

Re: How to clear Zbuffer without using legacy nodes or layer

Posted: 06 Apr 2018, 16:51
by lerou
there is no clear z, so you got several choices:

1. use ref layer filter

use a reference layer. Use filter to draw only the overlaying objects in the other layer. This will implicitely use a rendertarget, so it increases the GPU load. See Example_with_ref_layer.vzs.

2. use fx node

put an fx node in front of your overlaying objects. Don't add effects. This will implicitely use a rendertarget, so it increases the GPU load. A bit drity. See Example_with_fx.vzs.

3. Manually override z

Draw a rectangle very far in the back. Set z-test to always and disable rendering RGBA. This will overwrite the z. Dirty but works in this case. Gets tricky when you're moving the camera though. Should be a bit cheaper then a rendertarget.

1. is the cleanest approach, although those filters do get confusing. Also if you need many ref layers you get a performance impact due to the rendertargets. Same goes for 2. So maybe you can go with 3.

Re: How to clear Zbuffer without using legacy nodes or layer

Posted: 06 Apr 2018, 17:05
by gaz99
Hi Lerou,

That's perfect, thank you for this, really useful.

Cheers,

Gaz