def makeFBO(self, name): # This routine creates an offscreen buffer. All the complicated # parameters are basically demanding capabilities from the offscreen # buffer - we demand that it be able to render to texture on every # bitplane, that it can support aux bitplanes, that it track # the size of the host window, that it can render to texture # cumulatively, and so forth. winprops = WindowProperties() props = FrameBufferProperties() props.setRgbColor(1) return base.graphicsEngine.makeOutput( base.pipe, "model buffer", -2, props, winprops, GraphicsPipe.BFSizeTrackHost | GraphicsPipe.BFRefuseWindow, base.win.getGsg(), base.win)
def createBuffer(self, name, xsize, ysize, texgroup, depthbits=1): """ Low-level buffer creation. Not intended for public use. """ winprops = WindowProperties() winprops.setSize(xsize, ysize) props = FrameBufferProperties() props.setRgbColor(1) props.setDepthBits(depthbits) depthtex, colortex, auxtex0, auxtex1 = texgroup if auxtex0 != None: props.setAuxRgba(1) if auxtex1 != None: props.setAuxRgba(2) buffer = base.graphicsEngine.makeOutput( self.win.getPipe(), name, -1, props, winprops, GraphicsPipe.BFRefuseWindow | GraphicsPipe.BFResizeable, self.win.getGsg(), self.win, ) if buffer == None: return buffer if depthtex: buffer.addRenderTexture(depthtex, GraphicsOutput.RTMBindOrCopy, GraphicsOutput.RTPDepthStencil) if colortex: buffer.addRenderTexture(colortex, GraphicsOutput.RTMBindOrCopy, GraphicsOutput.RTPColor) if auxtex0: buffer.addRenderTexture(auxtex0, GraphicsOutput.RTMBindOrCopy, GraphicsOutput.RTPAuxRgba0) if auxtex1: buffer.addRenderTexture(auxtex1, GraphicsOutput.RTMBindOrCopy, GraphicsOutput.RTPAuxRgba1) buffer.setSort(self.nextsort) buffer.disableClears() buffer.getDisplayRegion(0).disableClears() self.nextsort += 1 return buffer
def createBuffer(self, name, xsize, ysize, texgroup, depthbits=1): """ Low-level buffer creation. Not intended for public use. """ winprops = WindowProperties() winprops.setSize(xsize, ysize) props = FrameBufferProperties() props.setRgbColor(1) props.setDepthBits(depthbits) depthtex, colortex, auxtex0, auxtex1 = texgroup if (auxtex0 != None): props.setAuxRgba(1) if (auxtex1 != None): props.setAuxRgba(2) buffer = base.graphicsEngine.makeOutput( self.win.getPipe(), name, -1, props, winprops, GraphicsPipe.BFRefuseWindow | GraphicsPipe.BFResizeable, self.win.getGsg(), self.win) if (buffer == None): return buffer if (depthtex): buffer.addRenderTexture(depthtex, GraphicsOutput.RTMBindOrCopy, GraphicsOutput.RTPDepthStencil) if (colortex): buffer.addRenderTexture(colortex, GraphicsOutput.RTMBindOrCopy, GraphicsOutput.RTPColor) if (auxtex0): buffer.addRenderTexture(auxtex0, GraphicsOutput.RTMBindOrCopy, GraphicsOutput.RTPAuxRgba0) if (auxtex1): buffer.addRenderTexture(auxtex1, GraphicsOutput.RTMBindOrCopy, GraphicsOutput.RTPAuxRgba1) buffer.setSort(self.nextsort) buffer.disableClears() buffer.getDisplayRegion(0).disableClears() self.nextsort += 1 return buffer