Summary:
RTMCopyRam:
Opengl seems to be working fine with both offscreen and parasite buffers. ~transfer rate 500MB/s
Dx9 only works with parasite buffers and is 1/3-1/2 speed of opengl.
Latest build doesn’t change anything
Using: base.graphicsEngine.extractTextureData
Opengl is about 1/2-1/3 speed of RTMCopyRam
Dx9 ~same speed as Opengl
Latest build is a bit slower all around and opengl DOESN"T function when ‘threading-model Cull/Draw’ is enabled.
But Dx9 offscreen buffers are now working properly with ‘threading-model Cull/Draw’
Measurements of the time it takes to transfer a 512x512 texture using RTMCopyRam from the GPU to the system RAM (using a GTX260, Winxp 32bit):
->with an old non-threading (~1.7.8?)build that I have
**Off-screen buffer
opengl: 2.1ms
dx9: <!!non-functional>
**Parasite buffer
opengl: 3.3ms
dx9: 5.8ms
->with the latest buildbot 10/30 build
**Off-screen buffer
opengl (without threading-model cull/draw): 2.3ms
opengl (w/ threading-model cull/draw): 2.0ms
dx9 (without threading-model cull/draw): <!!non-functional>
dx9 (threading-model cull/draw): <!!non-functional>
**Parasite buffer:
opengl (without threading-model cull/draw): 4.0ms
opengl (w/ threading-model cull/draw): 3.0ms
dx9 (without threading-model cull/draw)6.1ms:
dx9 (threading-model cull/draw): 6 ms
from pandac.PandaModules import *
from pandac.PandaModules import loadPrcFileData
#loadPrcFileData('', 'threading-model Cull/Draw')
loadPrcFileData('', 'load-display pandadx9')
import __Header
import direct.directbase.DirectStart
base.cam.node().setActive(0)
base.cam.setPos(0, -10, 0 )
npModel = loader.loadModel('smiley')
npModel.reparentTo( render )
winprops = WindowProperties()
winprops.setSize( 512, 512 )
fbprops = FrameBufferProperties()
fbprops.setColorBits(1)
fbprops.setAlphaBits(1)
#buffer1 = base.graphicsEngine.makeOutput(base.pipe, '1033', -2, fbprops, winprops, GraphicsPipe.BFRefuseWindow, base.win.getGsg(), base.win)
buffer1 = base.graphicsEngine.makeParasite( base.win, '1033', -2, 512, 512 )
tex = Texture()
buffer1.addRenderTexture( tex, GraphicsOutput.RTMCopyRam, GraphicsOutput.RTPColor )
#buffer1.addRenderTexture( tex, GraphicsOutput.RTMBindOrCopy, GraphicsOutput.RTPColor )
#buffer1.addRenderTexture( tex, GraphicsOutput.RTMCopyTexture, GraphicsOutput.RTPColor )
buffer1.setClearColorActive( True )
buffer1.setClearDepthActive( True )
buffer1.setClearStencilActive( True )
cam = base.makeCamera( buffer1, sort = -10, scene = render )
cam.setPos( 0, -50, 0 )
cam.reparentTo( base.cam )
# card = CardMaker('testname')
# card.setFrame(0, 1, 0, 1)
# card.setHasUvs( True )
# npCard = NodePath(card.generate())
# npCard.setTexture(tex)
# npCard.reparentTo( render2d )
run()