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.
First of all, welcome to the forum! I hope that you find your time here to be positive!
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!)
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(base.win, sort=10)
panda = loader.loadModel("panda")
# Panda should only show up to second camera
# Apply bloom to second camera
cf = CommonFilters(base.win, cam2)
cf.manager.buffers.setClearColor((0, 0, 0, 0))