FilterManager: How to skip filter/avoid clearing?

Greetings.

I have an issue I am unable to find a solution for.

I use a FilterManager to run two shader passes.
I pass a floating point texture to the second pass.

After having run the first pass (and second pass) once,
I’d like to skip the first pass from now on, until I reactivate it again.

I use a bool uniform and “discard” when it’s False to skip calculation of the first shader,
but then the second shader receives an empty texture.

Obviously this is not what I want. :slight_smile:

“setClearActive” yielded no change.
I create my textures using base.win.makeTextureBuffer()

How can I solve the problem?

There are two ways to set a clear: on the window/buffer, and on the display region. Make sure it’s disabled for both.

Greetings again.

Sorry for the late reply, I didn’t get to try it earlier.

I’ve tried what you suggested.

panda3d.org/manual/index.ph … ay_Regions

I’ve had the above applied to both buffers and just now added a line to apply it to base.win as well.

No change.

After googling I found “clearDeleteFlag()” and applied it to the buffers … no change.

I’m not sure how to properly use GraphicsOutput or GraphicsWindow for this … sorry. :confused:

Is there any other way? I’d like to only render the first pass when needed, instead of every frame.
I thought using discard seemed straight forward, as it wouldn’t write to the texture.

Is there a better way?

If you wish to skip an intermediate step, you could just call setActive(False) on the buffer in question. That way, the buffer will stop rendering entirely. Is this what you’re after?

clearDeleteFlag does something completely unrelated; it is not what you are looking for.

This worked. Thanks! I was thinking into the completely wrong direction!

Uhm … why isn’t this easily controlled via the FilterManager?

It seems counterintuitive that I have to set a buffer in-/active, when I use the FilterManager to set up shader passes…