How to enable transparency on "common filters" display regions

I’m working on a project in which I’d like to render characters over the UI elements for various reasons. To do this I’ve created a second camera and display region for them. This works fine, but it’s causing issues with Common Filters. I’d like to apply bloom to the top display region, but doing so obscures all other display regions. I’ve gathered that this is likely because the fullscreen quad that the filter manager uses isn’t transparent, I read another post of a similar problem which said that I may need to add transparency to the filters.finalQuad, but setting the transparency of the quad using the line below didn’t seem to help.


Am I doing this wrong? And is there any way to make common filters not obscure the lower display regions?

The display regions in render order are:

  • Main (effects on this layer work fine, but are optional anyway)
  • UI
  • Overlay (renders on top, I’d like to have bloom on this one)

I’m new here so I’m sorry if this post isn’t up to standards, or if I’m misunderstanding something.

First of all, welcome to the forum! I hope that you find your time here to be positive! :slight_smile:

This is somewhat of a guess, but does the quad actually have any non-opaque pixels? If all of the pixels are opaque, then it will remain opaque even with the transparency-mode set: that mode just causes (semi-)transparent pixels to be rendered as such if present.

To test this, you might try something like setting an alpha-scale on the quad. The result should be uniform transparency, but it should at least indicate whether the above is the issue.

It might be done something like this:


(This along with setting the transparency mode as you posted, of course!)

Using that, the quad still appears to remain completely opaque, still obscuring the screen.

Hmm… I don’t know then, I’m afraid! For now I’ll bow out in favour of another forum-member hopefully posting.

That’s okay, thank you for your help regardless! :gift_heart:
Hopefully somebody can help.

You forgot to set the buffer color.

buffer.clear_color = LColor(0, 0, 0, 0)

Interesting request.

Here is some example code:

from panda3d.core import *

from direct.showbase.ShowBase import ShowBase
from direct.filter.CommonFilters import CommonFilters

base = ShowBase()

# Load scene into main DR
env = loader.loadModel("environment")

# Create a second DR rendering the same scene
cam2 = base.makeCamera(, sort=10)

panda = loader.loadModel("panda")

# Panda should only show up to second camera

# Apply bloom to second camera
cf = CommonFilters(, cam2)
cf.manager.buffers[0].setClearColor((0, 0, 0, 0))

And the result:


Thank you serega-kkz for the solution, and rdb for helping put it into context! :gift_heart: