PDA

View Full Version : Would this be a good recommendation to ARB?



Mars_999
01-15-2006, 09:17 PM
I am trying to calculate my tangent vectors, and so far unsuccessful, but seems to me it would easy to implement into the VS a function that takes the gl_Normal, gl_MultiTexCoord, and gl_Vertex as parameters and return the tangent vector


vec3 tangentVector = tangent(gl_Vertex, gl_Normal, gl_MultiTexCoord0.xy);I know it would be slower but for dynamic meshes ect... I see a use for it, and with VS usually sitting around due to FS are burdened more so than the VS...

Corrail
01-16-2006, 05:52 AM
This won't work unless you have all Vertex and Texture Coordinate information of all surrounding vertices.

Maybe with some sort of DirectX geometry shader (or whatever it is called) this will be possible.

amendol
01-16-2006, 08:48 AM
Originally posted by Corrail:
This won't work unless you have all Vertex and Texture Coordinate information of all surrounding vertices.

Maybe with some sort of DirectX geometry shader (or whatever it is called) this will be possible.I'm not sure of what the directX geometry shaders are. I do see the usefullness in having some control over which verticies are sent to the vertex shaders. If you store your mesh as a big grid, and had a "primitive assembly" shader you could render the mesh as a series of strips, without interacting with user space.

ie.

verticies stored as:

00-01-02-03-04-05-06-07
|/ |/ |/ |/ |/ |/ |/ |
08-09-10-11-12-13-14-15
|/ |/ |/ |/ |/ |/ |/ |
16-17-18-19-20-21-22-23

if there were a programable "primitive assembly" shader then a simple program would be able to autogenerate triangle strips for this without the need to include an index array -- a great savings in memory.