TexGen or VertexProgram?

Which is typically faster using texgen or a vertex program. Specifically for the texture generation required for shadow buffers. The reason I am wondering is that in D3D there seems to be no texgen and only vertex shaders. While in openGL you have the option. Thanks.

The short answer: You really don’t know without trying both and measuring the performance. There isn’t a hard and fast rule, and the results may be different depending on which card you use.

With that in mind though, TexGen is certainly an easier solution. Plus, it’'ll work on every card out there, whereas with vertex programs you’re limited to ATI / NVIDIA, and you’ll have to write a different program for each. So I’d say go with TexGen unless there’s a really good reason not to. But that’s just my opinion, and I’m sure others will disagree…

A minor digresion.
Was cdoign with use od d3d8 a long time ago ( in a diffren galaxie - when was using win32 … now linux - it doesn’t have anything like texgen…but texgen works like if you were specyfing the texture matrix.
So you can do that in d3d8 without sue of vertex shaders as they are called in d3d…you have to setup the texture matrix instead.

But nevertheless…OGL rocks and ogl 2.0 will kick butt even more

True, but there is one major advantage of using texgen over using the texture matrix. For using just the texture matrix you still need to supply the vertex coords (even though they are the same as the vertex position values). For texgen, the base texture coords are taken from the vertex coords automatically. This means when you supply a vertex, it takes less bytes and thus has a better chance of fitting in a cache line.

[This message has been edited by LordKronos (edited 06-06-2002).]