Patrick, and others.
You got it right, this is what I mean and its not news but every day practice. When I choose to use 4-byte floats because
they are the right precision I do not want to end up with gabs because an implementor of WebGL decides to implement
only 8-byte floats. What the hardware vendor does in the GPU is a little less concern. But the layout of the data on the
CPU side is important.
I saw a lot of reactions to my mail. Are you all working at midnight? There are occasions when you like to use straight,
separate arrays for points, normals tangents, etc. And there are occasions where you like to use them grouped together
in a struct. You would like to pass these arrays of structs directly as input to a shader. Also you like to have a clean way to
specify this for the GPU.
So this is what I mean (in C syntax), nothing new (see the famous red book) or is this stuff old school and are there
In C you would tell the compiler to pack the structs without gabs and compute the stride to pass them to OpenGL. How
mesh.points[i] = point;
mesh.normals[i].x = x;
mesh.vertices[i].point = point;
mesh.vertices[i].normal.x = x;
Op 12 jan 2010, om 22:03 heeft Patrick Baggett het volgende geschreven:
I think what he's trying to say is that if you had 8-byte floats but your code assumed they were 4-byte floats, you'd end up with gaps in your data stream and wrong offset/stride calculations, none of which is news.
On Tue, Jan 12, 2010 at 2:02 PM, Kenneth Russell <email@example.com> wrote: