Vertex Textures

Hi,

I am using CG v1.41 and need to do a lot of texture fetches in the vertex shader, they are my bottleneck (;- :wink:

So, Id like to ask, if there is a possibility to somehow speed up the shader doing the texture reads?

Unfortunately, Im having not a lot of arithmetics, that I can put between. Im just doing a lookups, followed by if-statements, evaluating the read-results and doing something.

Thanks a lot!

first some simple texture lookup guidelines

  1. if you do not need any interpolation between the values you should set the filtering to GL_NEAREST and don’t use mipmaps if not needed.

2, if possible try to put as much data as possible on each texture, use all channels.

  1. can you definitly justify all texture lookups, can some of them be solved with some simple math, or can you bake two of them together beforehand.

And for vetex texture fetches you have to use GL_RGBA_FLOAT32_ATI with GL_NEAREST filtering.
anything else is going to be slow or not work.
There is also a limit on the number of textures vertex texture fetch can use, a GF6800 can use 4 (don’t know about the others though).