mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
FilterManager: allow specifying custom fbprops in renderSceneInto
Fixes #599
This commit is contained in:
parent
b08e38cf3d
commit
ea0210640c
@ -124,7 +124,7 @@ class FilterManager(DirectObject):
|
|||||||
|
|
||||||
return winx,winy
|
return winx,winy
|
||||||
|
|
||||||
def renderSceneInto(self, depthtex=None, colortex=None, auxtex=None, auxbits=0, textures=None):
|
def renderSceneInto(self, depthtex=None, colortex=None, auxtex=None, auxbits=0, textures=None, fbprops=None):
|
||||||
|
|
||||||
""" Causes the scene to be rendered into the supplied textures
|
""" Causes the scene to be rendered into the supplied textures
|
||||||
instead of into the original window. Puts a fullscreen quad
|
instead of into the original window. Puts a fullscreen quad
|
||||||
@ -185,7 +185,10 @@ class FilterManager(DirectObject):
|
|||||||
# Choose the size of the offscreen buffer.
|
# Choose the size of the offscreen buffer.
|
||||||
|
|
||||||
(winx, winy) = self.getScaledSize(1,1,1)
|
(winx, winy) = self.getScaledSize(1,1,1)
|
||||||
buffer = self.createBuffer("filter-base", winx, winy, texgroup)
|
if fbprops is not None:
|
||||||
|
buffer = self.createBuffer("filter-base", winx, winy, texgroup, fbprops=fbprops)
|
||||||
|
else:
|
||||||
|
buffer = self.createBuffer("filter-base", winx, winy, texgroup)
|
||||||
|
|
||||||
if (buffer == None):
|
if (buffer == None):
|
||||||
return None
|
return None
|
||||||
@ -287,7 +290,7 @@ class FilterManager(DirectObject):
|
|||||||
|
|
||||||
return quad
|
return quad
|
||||||
|
|
||||||
def createBuffer(self, name, xsize, ysize, texgroup, depthbits=1):
|
def createBuffer(self, name, xsize, ysize, texgroup, depthbits=1, fbprops=None):
|
||||||
""" Low-level buffer creation. Not intended for public use. """
|
""" Low-level buffer creation. Not intended for public use. """
|
||||||
|
|
||||||
winprops = WindowProperties()
|
winprops = WindowProperties()
|
||||||
@ -297,6 +300,9 @@ class FilterManager(DirectObject):
|
|||||||
props.setRgbColor(1)
|
props.setRgbColor(1)
|
||||||
props.setDepthBits(depthbits)
|
props.setDepthBits(depthbits)
|
||||||
props.setStereo(self.win.isStereo())
|
props.setStereo(self.win.isStereo())
|
||||||
|
if fbprops is not None:
|
||||||
|
props.addProperties(fbprops)
|
||||||
|
|
||||||
depthtex, colortex, auxtex0, auxtex1 = texgroup
|
depthtex, colortex, auxtex0, auxtex1 = texgroup
|
||||||
if (auxtex0 != None):
|
if (auxtex0 != None):
|
||||||
props.setAuxRgba(1)
|
props.setAuxRgba(1)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user