2009-01-18

GL_ARB_vertex_program II

I toyed with it a bit after rock banding it out with "Curetis Siva", the hottest new group to hit the pretend rock band scene.

More results:

This is 35 x Delgadosaurus's, which, he consists of 3700 verticies and 3800 polygons apiece.


Now, like the Asty demo, here's some frightening numbers:
129,500 fully deformed verticies ( 4 x weighted matrix deform + texture + lighting + cell shading) runs at 50 FPS, but only 13 IFPS. Note that the asty demo only had ~30000 verticies, so comparing the 17 / 13 ratio, you can see how linear the addition of verticies is to the GPU load.

Also, the collision in this one is taken out (VA/VBO's only) from this screenshot, yet the CPU load remained high, which is something to investigate. It must have to do with the bus transfer rates from system ram to GPU.

Point is, this kinda opens up the floor for high-poly models, which are nessecary for decent looking games (take a screenshot of Oblivion, it pushes at least 80,000 polygons per frame, all with multiple textures AND a fragment program)

But I care about animations more than textures, at least till I get my artists trained.

More technical notes:

since you have to break up verticies into groups for deformations, each vertex can only be deformed by a set maximum number of bones (4, in this case). You only have 28 bones to play with in the shader, however, if you want anything cool in your shader as well, you are knocked down to about 24 bones maximum. This might be a more useful practical limit anyhow. Storage cost is linear with each matrix used to deform, technically, there is no bone maximum limit, however, imposing one helps alignment constraints. In the ARB shaders, you can have a maximum of 128 instructions (excluding empty lines and comments), so your shaders have to be designed carefully. Only 96 local and 96 environment parameters are allowed in the shaders. Only 12 temporary values are allowed. A infinite number of ALIAS commands are allowed and they do not count against the instruction count (pretend they are #define statements). Loading shaders should be minimized. Switiching shaders should be minimized.

Things to determine:
Does using 4x matrix deform cost less than switching shaders?
Does updating params cost anything signifigant? (think per armature)
How viable is vertex keyframing? (per vertex, you have to load per keyframe switch per model)
How viable is Armature Relative Vertex Keyframes? (weight/offset positions)
Does the iPhone let me use n matricies? How slow is it's matrix palette?

Peace out till next time.

-Z

No comments: