O'Reilly logo

Panda3D 1.6 Game Engine by Dave Mathews

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - adding a bloom filter

Let's go ahead and add a bloom filter to our game so we can see how to set these guys up. The bloom filter automatically integrates with glow maps, so it's easy to use it to make halos around glowing objects.

  1. Open a WorldClass_01.py.
  2. We need to import the filters before we can use them, so add this code to our import section at the top of the file:
    from direct.filter.CommonFilters import CommonFilters
    
  3. Now that we're importing CommonFilters, we need to create an instance of it. Add this code right before the render.setShaderAuto call. It doesn't really have to precede that call, but that's as good a place as any.
    self.filters = CommonFilters(base.win, base.cam)
    
  4. Next, we'll turn on the bloom filter and give it ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required