Hello there,
I’m trying to use glow map with the bloom effect provided with Commonfilters. But, even if I have set the blend coeff to (0,0,0,1), the bloom effect stil take into account the vertex colors, and not the glow map.
Let see a simple example program:
import direct.directbase.DirectStart
from direct.filter.CommonFilters import CommonFilters
from pandac.PandaModules import *
import sys, dircache, os.path, imp, shutil
rootDir = os.path.abspath(os.path.dirname(sys.argv[0]))
loadPrcFile(os.path.join(rootDir, "config.prc"))
base.setBackgroundColor(0,0,0)
#setting up the bloom effect
filters = CommonFilters(base.win, base.cam)
filters.setBloom(blend=(0.0,0.0,0.0,1.0), mintrigger = 0.9, desat=-0.5, intensity=8.0, size="small")
#creating the card without glow map
cardMaker = CardMaker("cubemaker")
card = render.attachNewNode(cardMaker.generate())
card.setTexture(loader.loadTexture("/usr/share/panda3d/samples/Glow-Filter/models/tron-color.png"))
card.setDepthWrite(False)
card.setTransparency(True)
card.setPos(1,0,0)
#creating the card with glowmap
card2 = render.attachNewNode(cardMaker.generate())
card2.setTexture(loader.loadTexture("/usr/share/panda3d/samples/Glow-Filter/models/tron-color.png"))
card2.setDepthWrite(False)
card2.setTransparency(True)
card2.setPos(-1,0,0)
#adding the glow texture to card2
glowTexture = loader.loadTexture("/usr/share/panda3d/samples/Glow-Filter/models/tron-glow.png")
glowTexturetureStage = TextureStage('glow')
glowTexturetureStage.setMode(TextureStage.MGlow)
card2.setTexture(glowTexturetureStage, glowTexture)
base.cam.setPos(0.5,-5,0.5)
run()
This program use the textures from the Glow-Filter Sample.
If you test it, you’ll see that both cards have same bloom effect, but only the card on the left has a glow map.
It seems I’ve forgotten something, but I don’t know what. I’ve searched into the manual, forum and sample for a few days, but I didn’t find anything about this.
Does somebody has a hint about this?
Thanks,
Amarok