bsp
Very Active Member
- Joined
- Dec 2, 2006
- Messages
- 314
@cloudef: First of all: I have not benchmarked the vertex shader performance of the SGX533 but I would assume that the vertex processor is not highly parallel and processing is rather sequential. There is not any dedicated VRAM to hold vertex buffers so constantly updating the vertices via CPU or DSP should not have a big performance impact (unless the PVR does some costly datatype conversions..?).
Therefore, I could very will imagine that this indeed would be a good application for the DSP.
I have not used matrix palettes in OGLES but -correct me if I'm wrong- what basically needs to be done is to transform each vertex (and normal) by one or more matrices (bones), then add up the resulting vertices using per-bone/per-vertex weights, i.e. something along the lines of:
outVtx = mat[0]*vtx*weight[0] + mat[1]*vtx*weight[1] .. + mat[n]*vtx*weight[n]
outNorm = mat[0]*norm*weight[0] + mat[1]*norm*weight[1] .. + mat[n]*norm*weight[n]
(with mat[] being a uniform and vtx / norm / weight[] being per-vertex attributes)
..right?
Needless to say: For good performance, you will have to use fixed point math (e.g. TI iqmath lib).
Why don't you just give it a try (and report your findings) ?
For further optimizations it probably makes sense to copy the matrices to L1SRAM.
@Steven Craft: "The per vertex part is presumably going to be fastest via a shader" -> this is definitely true for today's hardware..but with the SGX533 I have my doubts. Using the shaders only for lighting (or what else needs to be done) could be beneficial. Maybe it even makes sense to do the lighting part on the DSP as well ?!
Therefore, I could very will imagine that this indeed would be a good application for the DSP.
I have not used matrix palettes in OGLES but -correct me if I'm wrong- what basically needs to be done is to transform each vertex (and normal) by one or more matrices (bones), then add up the resulting vertices using per-bone/per-vertex weights, i.e. something along the lines of:
outVtx = mat[0]*vtx*weight[0] + mat[1]*vtx*weight[1] .. + mat[n]*vtx*weight[n]
outNorm = mat[0]*norm*weight[0] + mat[1]*norm*weight[1] .. + mat[n]*norm*weight[n]
(with mat[] being a uniform and vtx / norm / weight[] being per-vertex attributes)
..right?
Needless to say: For good performance, you will have to use fixed point math (e.g. TI iqmath lib).
Why don't you just give it a try (and report your findings) ?
For further optimizations it probably makes sense to copy the matrices to L1SRAM.
@Steven Craft: "The per vertex part is presumably going to be fastest via a shader" -> this is definitely true for today's hardware..but with the SGX533 I have my doubts. Using the shaders only for lighting (or what else needs to be done) could be beneficial. Maybe it even makes sense to do the lighting part on the DSP as well ?!