# FilterManager

from direct.filter.FilterManager import FilterManager

## Inheritance:

FilterManager: DirectObject
DirectObject:

## Methods of FilterManager:

__init__
cleanup
createBuffer
getClears
getScaledSize
isFullscreen
renderQuadInto
renderSceneInto
resizeBuffers
setClears
setStackedClears
windowEvent

## Methods of DirectObject:

__init__
_addTask
_clearTask
accept
acceptOnce
addTask
classTree
detectLeaks
doMethodLater
getAllAccepting
ignore
ignoreAll
isAccepting
isIgnoring
removeAllTasks
removeTask

__init__ def __init__(self, win, cam, forcex=0, forcey=0) The FilterManager constructor requires you to provide a window which is rendering a scene, and the camera which is used by that window to render the scene. These are henceforth called the 'original window' and the 'original camera.'

cleanup def cleanup(self) Restore everything to its original state, deleting any new buffers in the process.

createBuffer def createBuffer(self, name, xsize, ysize, texgroup, depthbits=1) Low-level buffer creation. Not intended for public use.

getClears def getClears(self, region) Undocumented function.

getScaledSize def getScaledSize(self, mul, div, align) Calculate the size of the desired window. Not public.

isFullscreen def isFullscreen(self) Undocumented function.

renderQuadInto def renderQuadInto(self, mul=1, div=1, align=1, depthtex=None, colortex=None, auxtex0=None, auxtex1=None) Creates an offscreen buffer for an intermediate computation. Installs a quad into the buffer. Returns the fullscreen quad. The size of the buffer is initially equal to the size of the main window. The parameters 'mul', 'div', and 'align' can be used to adjust that size.

renderSceneInto def renderSceneInto(self, depthtex=None, colortex=None, auxtex=None, auxbits=0, textures=None) Causes the scene to be rendered into the supplied textures instead of into the original window. Puts a fullscreen quad into the original window to show the render-to-texture results. Returns the quad. Normally, the caller would then apply a shader to the quad. To elaborate on how this all works: * An offscreen buffer is created. It is set up to mimic the original display region - it is the same size, uses the same clear colors, and contains a DisplayRegion that uses the original camera. * A fullscreen quad and an orthographic camera to render that quad are both created. The original camera is removed from the original window, and in its place, the orthographic quad-camera is installed. * The fullscreen quad is textured with the data from the offscreen buffer. A shader is applied that tints the results pink. * Automatic shader generation is enabled by default for the main camera. You can override this by setting shaders on individual nodes, or on the root of your scene graph, but if you do, your own shaders need to generate the outputs that the filter manager is expecting. * All clears are disabled on the original display region. If the display region fills the whole window, then clears are disabled on the original window as well. It is assumed that rendering the full-screen quad eliminates the need to do clears. Hence, the original window which used to contain the actual scene, now contains a pink-tinted quad with a texture of the scene. It is assumed that the user will replace the shader on the quad with a more interesting filter.

resizeBuffers def resizeBuffers(self, win) Resize all buffers to match the size of the window.

setClears def setClears(self, region, clears) Undocumented function.

setStackedClears def setStackedClears(self, region, clears0, clears1) Undocumented function.

windowEvent def windowEvent(self, win) When the window changes size, automatically resize all buffers

__init__ def __init__(self) Undocumented function.

_addTask def _addTask(self, task) Undocumented function.

_clearTask def _clearTask(self, task) Undocumented function.

accept def accept(self, event, method, extraArgs=[]) Undocumented function.

acceptOnce def acceptOnce(self, event, method, extraArgs=[]) Undocumented function.

addTask def addTask(self, *args, **kwargs) Undocumented function.

classTree def classTree(self) Undocumented function.

detectLeaks def detectLeaks(self) Undocumented function.

doMethodLater def doMethodLater(self, *args, **kwargs) Undocumented function.

getAllAccepting def getAllAccepting(self) Undocumented function.

ignore def ignore(self, event) Undocumented function.

ignoreAll def ignoreAll(self) Undocumented function.

isAccepting def isAccepting(self, event) Undocumented function.

isIgnoring def isIgnoring(self, event) Undocumented function.

removeAllTasks def removeAllTasks(self) Undocumented function.

removeTask def removeTask(self, taskOrName) Undocumented function.