Question

In Stage3D / AGAL, is it possible to point for individual VertexBuffers to the same va0 in such a way so that:

  • Each VertexBuffer data can be independently changed (would assume this is great performance in some situations, yes?).

  • Each VertexBuffer focuses on one field of the va0 (first vertex-attribute register), so that vertexbuffer1 manipulates va0.x, vertexbuffer2 = va0.y, vertexbuffer3 = va0.z, and vertexbuffer4 = va0.w;

Since you can specify the 'offset' and the data format (ex: FLOAT_1, FLOAT_4) when assigning a VertexBuffer to the Context3D object, I would imagine this could be possible.

Maybe my setup is incorrect, but when I tried this I couldn't achieve it.

Does each VertexBuffer need to take up the entire 4 fields in each register? If so, I'm not sure I understand why the FLOAT_1 -to- FLOAT_3 values exists! :S

Thanks in advance!

Was it helpful?

Solution

When you assign vertex buffer, or constant, you allocate 128 bit (i.e. 4 x 32). And you will be bounded exactly to one attribute (va0, va1). So I think it's impossible to bound different buffers to single attribute. And if you put FLOAT_1, you will waste memory.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top