PDA

View Full Version : Setting 3 differents indices for VP



Coluna
12-25-2003, 12:57 PM
Hi all;
Im doing a terrain renering demo with morph (to avoid pops), in a VP,and im having some problems...but the worst is this:
The indexes for the original vertices are stored in one array, for example with values 0 1 2 3 4 ...
And to the vertices that are used to do the interpolation, in other 2 arrays, with for example 0 0 1 1 2 2, and 1 1 2 2 3 3..
(as u can see the values arent those...)
They are sent by the texcoord param, and interpolated in VP...but how can i set these 3 different indexes? with immediate mode its quite simple, but how about VBO with glDrawElements()?
PS.:sorry by my english...maybe u couldnt understand my problem...

jwatte
12-25-2003, 02:44 PM
You can't. There is only one index; it indexes all vertex attribute arrays.

You have to re-arrange the "target" arrays so that each "source" vertex has a "target" attribute that's correct for that source.

Coluna
12-25-2003, 06:16 PM
Thanx...i think its impossible to me to rearrange the auxiliary verts...it would be very cpu intensive, as it have to work with around 10k verts, so its 20k verts to use for interpolation...any idea of how to solve this?

jwatte
12-26-2003, 10:10 AM
If you can't re-arrange to get your morph targets in order with the vertices, then you can't do it in a vertex shader. You might as well do the morphing on the CPU at that point.

Btw: this is the reason they say that ROAM and friends are not hardware friendly.

Coluna
12-26-2003, 07:49 PM
ok...but now i change to immediate mode , and interpolation by vp...im thinking in rearrange the verts...is VBO with DYNAMIC_DRAW_ARB much faster than default vertex array?