I’m using a bloom filter to create a nice halo around objects which have glow maps. This effect worked perfectly when I was doing render.setShaderAuto() but I had to change that when I implemented a cube map for my sky dome. I have all the objects with glow maps parented, ultimately, to one node that is a child of render and I am calling setShaderAuto() on that node.
When I made this change, the bloomFilter stopped using the glow maps to determine what gets a halo and what doesn’t. Now anything that’s bright does, and the things with glow maps hardly get any halo at all.
I have the blend setting for my bloomFilter at (0,0,0,1) as the manual instructs, but I’m definately not getting the result I should. What should I do?
I mean setTextureOffset() etc. I’m using 1.6.2. The only thing I’ve found to reduce the bloom filter altering the sky sphere (which has setShaderOff() called on it) is to lower it’s alpha with TransparencyAttrib.MAlpha.
About using another display region…
Something like a skydome is always rendered behind everything else, so
from direct.directbase.DirectStart import *
from pandac.PandaModules import *
from direct.actor.Actor import Actor
from direct.filter.CommonFilters import CommonFilters
base.cam.setPos(0, -30, 5)
# a model in the default display region
panda = Actor('panda.egg', {'walk' : 'panda-walk.egg'})
panda.loop('walk')
panda.reparentTo(render)
# create 2nd display region
dr2 = base.win.makeDisplayRegion(0, 1, 0, 1)
dr2.setSort(-1) # ordering of display regions
# You will also need to clear the depth or Z buffer.
# This buffer is used to determine which objects are in front of other objects,
# and if you fail to clear it, some objects may not draw. -Manual
base.win.setClearDepthActive(True)
base.win.setClearDepth(1.0)
# 2nd camera for 2nd display region
render2 = NodePath('render2')
cam2 = render2.attachNewNode(Camera('cam2'))
dr2.setCamera(cam2)
# 2nd camera inherits base.camera transforms
def cameraTask(task):
cam2.setPos(base.camera.getPos())
cam2.setHpr(base.camera.getHpr())
return task.cont
taskMgr.add(cameraTask, 'cameraTask')
# 2nd model for 2nd display region
env = loader.loadModel('environment.egg')
env.reparentTo(render2)
env.setScale(0.4)
env.setPos(0,0,-0.2)
# a filter on 2nd display region only
filters = CommonFilters(base.win, cam2)
filters.setBloom(mintrigger = 0.1, intensity = 3.0, size = 'Large')
# Can't apply filters on default display region...
# filters2 = CommonFilters(base.win, base.cam)
# filters2.setBloom(mintrigger = 0.1, intensity = 3.0, size = 'Large')
run()