Video card question
by Duncan Gray · in Torque Game Engine · 01/04/2006 (7:06 pm) · 31 replies
I'm working on adding better shadow features to the engine and one of the new methods I implemented requires the video card to have AUX buffers.
I checked nvidia's website but they don't seem to give that level of detail. Here is a simple test you can do. Add the following code to a busy section of the engine as a test: i.e. Put it in shapeBase::renderObject then put a breakpoint on the bold code and check what the value of numBuffers is
Remove the code when done. A value of numBuffers>0 means it will work on your graphic card.
Could you then please post your:
(1) Platform: Windows, Mac, Linux
(2) graphic card make: - Nvidia, ATI etc
(3) model: - e.g. Geforce 2 MX
(4) result - numBuffers = .....
I'm also researching pBuffers as a solution.
I checked nvidia's website but they don't seem to give that level of detail. Here is a simple test you can do. Add the following code to a busy section of the engine as a test: i.e. Put it in shapeBase::renderObject then put a breakpoint on the bold code and check what the value of numBuffers is
S32 numBuffers; glGetIntegerv(GL_AUX_BUFFERS, &numBuffers); [b]numBuffers = numBuffers[/b] // breakpoint here
Remove the code when done. A value of numBuffers>0 means it will work on your graphic card.
Could you then please post your:
(1) Platform: Windows, Mac, Linux
(2) graphic card make: - Nvidia, ATI etc
(3) model: - e.g. Geforce 2 MX
(4) result - numBuffers = .....
I'm also researching pBuffers as a solution.
About the author
#2
(2) graphic card make: - ATI Radeon
(3) model: - 9600 (256MB/128bit)
(4) result - numBuffers = 0 (zero, don't have any)
01/04/2006 (8:34 pm)
1) Platform: Windows XP Pro SP2(2) graphic card make: - ATI Radeon
(3) model: - 9600 (256MB/128bit)
(4) result - numBuffers = 0 (zero, don't have any)
#3
2. ATI
3. Xpress 200
4. 0, zero, none
I'm upgrading to a 6800 GT tomorrow, so I'll have more info then.
Also, I didn't have a chance to recompile on my Mac, but according to the OpenGL Driver Monitor, "Max Aux Buffers" = 2 and "Max Sample Buffers" = 1. Stencil buffer mode is 8 bits. That a Mac PowerBook, OS X Tiger, with the ATI 9600 chipset.
I just noticed that Apple ships it with a shader compiler. That's cool. Need to play with that some.
01/05/2006 (7:13 pm)
1. Win XP2. ATI
3. Xpress 200
4. 0, zero, none
I'm upgrading to a 6800 GT tomorrow, so I'll have more info then.
Also, I didn't have a chance to recompile on my Mac, but according to the OpenGL Driver Monitor, "Max Aux Buffers" = 2 and "Max Sample Buffers" = 1. Stencil buffer mode is 8 bits. That a Mac PowerBook, OS X Tiger, with the ATI 9600 chipset.
I just noticed that Apple ships it with a shader compiler. That's cool. Need to play with that some.
#4
2. ATI
3. Xpress 200
4. 0, zero, none
I'm upgrading to a 6800 GT tomorrow, so I'll have more info then.
Also, I didn't have a chance to recompile on my Mac, but according to the OpenGL Driver Monitor, "Max Aux Buffers" = 2 and "Max Sample Buffers" = 1. Stencil buffer mode is 8 bits. That a Mac PowerBook, OS X Tiger, with the ATI 9600 chipset.
I just noticed that Apple ships it with a shader compiler. That's cool. Need to play with that some.
01/05/2006 (8:09 pm)
1. Win XP2. ATI
3. Xpress 200
4. 0, zero, none
I'm upgrading to a 6800 GT tomorrow, so I'll have more info then.
Also, I didn't have a chance to recompile on my Mac, but according to the OpenGL Driver Monitor, "Max Aux Buffers" = 2 and "Max Sample Buffers" = 1. Stencil buffer mode is 8 bits. That a Mac PowerBook, OS X Tiger, with the ATI 9600 chipset.
I just noticed that Apple ships it with a shader compiler. That's cool. Need to play with that some.
#5
I'm in the process of adding pBuffer support to TGE and it seems it should work on Mac and Linux as well, but I'm just doing Windows for now. I don't have a Mac and my linux box is broken.
@Rob, from the data you gave it looks like the new Mac should be ok with AUX buffers.
pBuffers should let the new shadows work on older cards like RIVA TNT, Geforce 2 etc
01/05/2006 (8:38 pm)
It might be a bit early to say, but it looks like its only the more recent graphic cards or drivers which have the AUX color buffer support.I'm in the process of adding pBuffer support to TGE and it seems it should work on Mac and Linux as well, but I'm just doing Windows for now. I don't have a Mac and my linux box is broken.
@Rob, from the data you gave it looks like the new Mac should be ok with AUX buffers.
pBuffers should let the new shadows work on older cards like RIVA TNT, Geforce 2 etc
#6
I know you are disappointed in the community but I'm weak in math and 3d coding
so - sorry I couldn't help you.
(1) Platform: Linux
(2) graphic card make: - Nvidia
(3) model: - Geforce 4 Ti 4600
(4) result - numBuffers = 4
nvidia driver 1.0 7667
01/06/2006 (7:58 am)
Thanks Duncan,I know you are disappointed in the community but I'm weak in math and 3d coding
so - sorry I couldn't help you.
(1) Platform: Linux
(2) graphic card make: - Nvidia
(3) model: - Geforce 4 Ti 4600
(4) result - numBuffers = 4
nvidia driver 1.0 7667
#7
01/06/2006 (8:17 am)
@Duncan, I do most of my coding on my Mac. I'm in the process of moving everything over to 1.4 right now. Let me know if you want me to try new code on the Mac for you. Better shadows is something I really really want, and the existing stencil shadow resources don't work on Macs, and TSE for Macs seems a ways off.
#8
(1) Platform: Linux
(2) graphic card make: - Nvidia
(3) model: - Geforce 3 ti 200
(4) result - numBuffers = 4
01/06/2006 (8:18 am)
System 2 -(1) Platform: Linux
(2) graphic card make: - Nvidia
(3) model: - Geforce 3 ti 200
(4) result - numBuffers = 4
#10
on this system had to use old 1.0-6629 driver ( 11-5-2004 )
since the formally known as "unified" driver has now dropped support for geforce2
(1) Platform: Linux
(2) graphic card make: - Nvidia
(3) model: - Geforce 2 ti
(4) result - numBuffers = 4
01/06/2006 (10:32 am)
System 3 -on this system had to use old 1.0-6629 driver ( 11-5-2004 )
since the formally known as "unified" driver has now dropped support for geforce2
(1) Platform: Linux
(2) graphic card make: - Nvidia
(3) model: - Geforce 2 ti
(4) result - numBuffers = 4
#11
@Rob, The shadow code currently exists in my game modifed code, so I'll be moving the new shadow code to the vanilla (unmodified) version of TGE 1.4 very soon, just as soon as I add the shadow init calls to fxShapeReplicator, Item etc. Currently ShabeBase, TSStatic and Wheeledvehicle(plus the derivitives) all work nicely with the new shadow code.
Once I've ported it to standard TGE1.4, I can release those files and do a write up as the basis of an early resource and you can add it to Mac
Rob, perhaps you can look into adding the pbuffer extensions to Mac mean while? I read on the internet that they exist natively in Mac under the AGL extension library.
@Charles, pBuffer extensions for Linux use the GLX library if you are able to help
Here is a how to add extentions to TGE from Pat Wilson
01/06/2006 (12:54 pm)
Nice feedback so far guys. The trend seems to be that GeForce2 onwards supports AUX buffers and ATI does not. Which means we need to add pBuffers support for ATI, what a headache.@Rob, The shadow code currently exists in my game modifed code, so I'll be moving the new shadow code to the vanilla (unmodified) version of TGE 1.4 very soon, just as soon as I add the shadow init calls to fxShapeReplicator, Item etc. Currently ShabeBase, TSStatic and Wheeledvehicle(plus the derivitives) all work nicely with the new shadow code.
Once I've ported it to standard TGE1.4, I can release those files and do a write up as the basis of an early resource and you can add it to Mac
Rob, perhaps you can look into adding the pbuffer extensions to Mac mean while? I read on the internet that they exist natively in Mac under the AGL extension library.
@Charles, pBuffer extensions for Linux use the GLX library if you are able to help
Here is a how to add extentions to TGE from Pat Wilson
#12
pBuffers are a method of setting up off-screen buffers using video memory or perhaps system memory, depending on the platform and driver. pBuffers can be faster than AUX buffers because pBuffers can be used as the texture directly without having to read from the buffer to a bitmap to a texture etc.
01/06/2006 (1:22 pm)
To clarify, for those who don't know. Normaly, when you draw on the video frame buffer, it is visible on screen. Sometimes you want to draw things off-screen for later on-screen use, like with shadows or other special effects. The AUX buffer is an offscreen drawing buffer for this purpose.pBuffers are a method of setting up off-screen buffers using video memory or perhaps system memory, depending on the platform and driver. pBuffers can be faster than AUX buffers because pBuffers can be used as the texture directly without having to read from the buffer to a bitmap to a texture etc.
#13
GLX_SGIX_pbuffer or GL_EXT_pixel_buffer_object?
also,
(I don't know about the current ati driver - i don't have any ati cards )
but what I dug up so far - ati says it doesn't support pbuffers for radeons...
Firegl yes,
No pbuffer support for ATI Radeon and other boards.
http://www2.ati.com/drivers/linux/readme0370.txt
##################################################################################################
this site also talks about pbuffer-like stuff:
Unfortunately, hardware/driver support for (accelerated) offscreen rendering currently seems to be very patchy, with at least four different methods available:
2. SGIX : Use the SGIX pbuffer extension (which was designed specifically for this purpose).
* Pros: hardware accelerated
* Cons: only available on some chipsets (works on NVidia; not sure about ATI).
3. GLX : Use the GLX pixmap extension (write to offscreen pixmap).
* Pros: standard API.
* Cons: no hardware acceleration.
4. GLXP : Use the GLX pbuffer API in GLX 1.3.
* Pros: standard API
* Cons: not supported on some drivers?
from http://playerstage.sourceforge.net/doc/Gazebo-manual-0.5-html/gazebo_opengl.html
maybe useful:
http://www.cesplanet.com/software/glaf/whatis.html
01/06/2006 (3:24 pm)
What extension is the pbuffer extension?GLX_SGIX_pbuffer or GL_EXT_pixel_buffer_object?
also,
(I don't know about the current ati driver - i don't have any ati cards )
but what I dug up so far - ati says it doesn't support pbuffers for radeons...
Firegl yes,
No pbuffer support for ATI Radeon and other boards.
http://www2.ati.com/drivers/linux/readme0370.txt
##################################################################################################
this site also talks about pbuffer-like stuff:
Unfortunately, hardware/driver support for (accelerated) offscreen rendering currently seems to be very patchy, with at least four different methods available:
2. SGIX : Use the SGIX pbuffer extension (which was designed specifically for this purpose).
* Pros: hardware accelerated
* Cons: only available on some chipsets (works on NVidia; not sure about ATI).
3. GLX : Use the GLX pixmap extension (write to offscreen pixmap).
* Pros: standard API.
* Cons: no hardware acceleration.
4. GLXP : Use the GLX pbuffer API in GLX 1.3.
* Pros: standard API
* Cons: not supported on some drivers?
from http://playerstage.sourceforge.net/doc/Gazebo-manual-0.5-html/gazebo_opengl.html
maybe useful:
http://www.cesplanet.com/software/glaf/whatis.html
#14
WGL_ARB_pbuffer
WGL_ARB_PIXEL_FORMAT
WGL_ARB_RENDER_TEXTURE
GL_NV_FLOAT_BUFFER
WGL_ARB_MULTISAMPLE
WGL_NV_RENDER_DEPTH_TEXTURE
WGL_NV_RENDER_TEXTURE_RECTANGLE
That same support code, in the Unix section, uses the following calls
glXChooseFBConfigSGIX
glXCreateContextWithConfigSGIX
glXCreateGLXPbufferSGIX
glXChooseFBConfigSGIX
Which looks like its using a combination of GLX and SGIX. I have not looked up the specific extentions which support the above calls. Perhaps they exist natively as part of X? which means you dont need to do anything.
I'll email you the support code.
01/06/2006 (4:18 pm)
@Charles, at this stage I have only looked at the Windows WGL support for pBuffers and I had to add the following extentions to work with the pBuffer supporting code I got from the OpenGl website.WGL_ARB_pbuffer
WGL_ARB_PIXEL_FORMAT
WGL_ARB_RENDER_TEXTURE
GL_NV_FLOAT_BUFFER
WGL_ARB_MULTISAMPLE
WGL_NV_RENDER_DEPTH_TEXTURE
WGL_NV_RENDER_TEXTURE_RECTANGLE
That same support code, in the Unix section, uses the following calls
glXChooseFBConfigSGIX
glXCreateContextWithConfigSGIX
glXCreateGLXPbufferSGIX
glXChooseFBConfigSGIX
Which looks like its using a combination of GLX and SGIX. I have not looked up the specific extentions which support the above calls. Perhaps they exist natively as part of X? which means you dont need to do anything.
I'll email you the support code.
#15
01/07/2006 (9:42 am)
@Duncan: As far as I know pBuffers are only supported on Windows. (I might be wrong though, but I'm sure I read that somewhere a while back)
#16
01/07/2006 (11:46 am)
Nope, just google for it and you will see.
#17
@duncan - you can email me at silvertiger742@yahoo.com
01/08/2006 (12:19 am)
@Xavier - I got the glx docs and it seems like we have pbuffer on linux.@duncan - you can email me at silvertiger742@yahoo.com
#18
The only API with a really reliable render to texture is DX9, and then only on DX9 compliant cards. :)
Trust me - we've done a lot of research on this. Any solution is going to be complex and painful with lots of workarounds.
You're better off just putting in a software rasterizer... which is what we did. ;)
Maybe have it take alpha into account when rendering?
01/08/2006 (1:14 am)
Pbuffers don't work reliably, neither do aux buffers, neither do other things.The only API with a really reliable render to texture is DX9, and then only on DX9 compliant cards. :)
Trust me - we've done a lot of research on this. Any solution is going to be complex and painful with lots of workarounds.
You're better off just putting in a software rasterizer... which is what we did. ;)
Maybe have it take alpha into account when rendering?
#19
It was quite simple to install, once I figured out what it was all about.
Basically, I check what the hardware can do, then select the best render method to fit the hardware and if the hardware is really pathetic, it defaults to the original shadow method. Somehow, you will get the best shadow your hardware can handle.
Perhaps, its possible to add alpha to the software rasterizer, I have not looked into it, mostly because the existing software rasterizer is still very fussy about rendering transparent objects, sometimes it renders them as opaque, other times... nothing. But thats the supporting code, not the rasterizer's fault.
@Charles, I'll send it to you tomorrow, it's late in my time zone.
01/08/2006 (3:35 am)
@Ben, I got pBuffers working fine on Windows but its not as fast as AUX due to the context switching. I'm also using the stencil buffer, as a buffer, not a stencil, for those cards which don't support AUX or pBuffer.It was quite simple to install, once I figured out what it was all about.
Basically, I check what the hardware can do, then select the best render method to fit the hardware and if the hardware is really pathetic, it defaults to the original shadow method. Somehow, you will get the best shadow your hardware can handle.
Perhaps, its possible to add alpha to the software rasterizer, I have not looked into it, mostly because the existing software rasterizer is still very fussy about rendering transparent objects, sometimes it renders them as opaque, other times... nothing. But thats the supporting code, not the rasterizer's fault.
@Charles, I'll send it to you tomorrow, it's late in my time zone.
#20
I'd be interested in a drop, too, if you can spare the time. ;)
01/08/2006 (3:42 am)
Actually, it's entirely the rasterizer's fault, it doesn't take texture alpha into account.I'd be interested in a drop, too, if you can spare the time. ;)
Torque Owner Duncan Gray
(2) graphic card make: - GeForce
(3) model: - 6800
(4) result - numBuffers = 4