View Full Version : GLSL vertex program texture access
12-15-2004, 04:31 AM
I've been trying to get texture access from the vertex shader working at home lately, but I'm just not having any decent performance. I have a 6800GT and the newest drivers, which I thought supported this, but the moment I try to access my texture within the VS the performance goes down to a frame every few seconds. I've tried it out in ShaderDesigner and it also runs sluggishly, however the nvidia simple vertex texture demo runs fine. I've tried texture sizes from 512x512 to 32x32, various formats, and nothing works. Anyone have any pointers/tips?
12-15-2004, 08:57 AM
Which texture format are you using for the vertex texture? Only the single component (GL_LUMINANCE_FLOAT32_ATI) and four component (GL_RGBA_FLOAT32_ATI) floating point texture formats are hardware acclerated in GeForce 6 GPUs.
Try running this demo:
and compare the performance of it with your program.
12-15-2004, 04:41 PM
Thanks. I had another look at that example, but it wasn't working as fast as it should. However, I noticed that in my glCopyTexImage2D call (on init, creating these textures) I was using GL_RGBA. Switching that to GL_RGBA_FLOAT32_ATI fixed the problem.
12-15-2004, 10:12 PM
Only the single component (GL_LUMINANCE_FLOAT32_ATI) and four component (GL_RGBA_FLOAT32_ATI) floating point texture formats are hardware acclerated in GeForce 6 GPUs.Really? Is there a document that lists which formats do and do not work as vertex textures in NV40 hardware?
12-16-2004, 12:00 AM
12-17-2004, 05:29 AM
Is there some doc describing the various combinations of settings that result in good performance? I found that when I used GL_RGBA textures, the vertex texture access would be horribly slow, but fragment access was fine. When I switched to the FLOAT32 options, vertex texture access was fine but fragment access was slow - but that was only when I had my MIN and MAG filters set to LINEAR. Setting to NEAREST and doing my own filtering in the fragment shader was the fastest way to get at the data overall...
12-17-2004, 08:20 AM
The NVIDIA GPU Programming Guide (http://developer.nvidia.com/object/gpu_programming_guide.html) contains that information.
In your case, for vertex textures we only hardware accelerate 1 or 4 component fp32 textures with NO filtering (set to GL_NEAREST). In the fragment shader we don't hardware accelerate filtering for fp32 textures, just fp16 textures.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.