PDA

View Full Version : direct access to vram



KC1
08-12-2003, 12:28 AM
hello http://www.opengl.org/discussion_boards/ubb/smile.gif

i want to combine typical opengl (triangles) with my voxel-engine. at the moment i render the voxels as a bitmap and bind it to a texture and draw it as a quader to the background.
is there a faster way in opengl? can i get the adress of the backscreenbuffer, so i can directly draw to it.

greetings,
KC1

[This message has been edited by KC1 (edited 08-12-2003).]

KC1
08-12-2003, 01:34 AM
i thing i found something: glCopyPixels()

http://www.opengl.org/discussion_boards/ubb/biggrin.gif
KC1

yaro_dup1
08-12-2003, 01:42 AM
Texture is already stored in VRAM so to speed this up can use texture compression. You can directly get into VRAM if you want to store e.g. some vertex data. There is a function from nVidia which allocates memory similar to malloc (with three more parameters) called wglAllocateMemoryNV. I don't know ATI function like that but, you should check search their website if you want.

[This message has been edited by glYaro (edited 08-12-2003).]

jide
08-12-2003, 02:52 AM
You're not advise to use vram directly (that's why only Nvidia does so).

Textures are normally stored in vram, but to ensure that (at least to tell Opengl you want to do so), use textures priorities.

rtargosz
08-12-2003, 04:59 AM
OpenGL doesn't provide any mechanism for direct frame buffer access like DirectX does with surfaces. I run into this a lot porting DirectX games to MacOS.

Your best bet is probably to render directly to the texture after it is bound. See this example on NeHe: http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=29

KC1
08-12-2003, 08:34 PM
thanks to all for answers http://www.opengl.org/discussion_boards/ubb/biggrin.gif

@rtargosz
yes, you are right, yesterday i found an example looking like this from nehe and it works good