Hi guys,
I want to try out some post-processing with the FilterManager, but I keep getting a “global name FilterManager is not defined”. But I can’t find what I’m supposed to import on the site anywhere. I’m using the code from the manual (and version 1.5.0):
oh, and another thing while I’m at it: what’s a good way to store the last five or so framebuffers? (I’m going to try and implement motion blur).
[/code]
Well, as is usually the case, I fixed problem 1 moments after posting the message . I still have a problem that the scene is now rendered into a small part of the window, but I assume this is the texture padding (what’s the best way to tackle this?).
My attempt at rendering the depth buffer to screen, but I still get the color buffer instead. What am I doing wrong? (post.sha is just a passthrough filter that uses texunit0)
Yep, the problem is the texture padding. So the window is probably 800x600, and the texture it’s rendering into is probably 1024x1024. The lower-left 800x600 corner of the texture is the only part that’s being used.
So let’s say you create a full-screen quad, and then apply this texture to it using:
quad.setShaderInput(“mytex”, mytex)
The shader now needs to use the right texture coordinates when accessing the texture. Panda3D provides a shader input called texpad_mytex. This is the texture coordinate of the middle of the active region. To get the texture coordinate of the upper-right corner of the active region, you need (texpad_mytex*2). So this formula gives you exactly what you need:
After some fiddling that worked out real nice, thanks Josh
Rendering the depth buffer is working out well now, but rendering normals to the aux buffer is still a bit strange: If I give the character a shader I see the shaded model instead of normals when visualizing the normal buffer (even though the environment is shown in normal values). If I give it a transparancy attribute it doesn’t show up at all. I’m using the models from the ralph example. And I’ve set the aux to normals with