Skip to content

Conversation

@trungtle
Copy link
Contributor

Not sure how useful this sample looks for the purpose of demonstrating new vertex format, but this is one listed in our roadmap. I'm passing different vertex formats for the cube geometry when setting up vertex array.

@pjcozzi
Copy link
Contributor

pjcozzi commented Feb 16, 2016

Can we do one with half floats, which will be widely used for normals and texture coordinates? Not sure if/how these are supported by typed arrays.

@kenrussell
Copy link
Member

It would be good to test handling of half-floats. These aren't handled directly by typed arrays (there's no Float16Array) but you can manually construct the bit patterns resulting from converting numbers to 16-bit floats. See sdk/tests/deqp/framework/common/tcuFloat.js in the WebGL workspace for some (complex, but complete) code. There is a conversion table somewhere which is less code, but I can't find it at the moment. Once the data is uploaded into a buffer, you can reference it as half-floats.

@pjcozzi
Copy link
Contributor

pjcozzi commented Feb 17, 2016

Thanks @kenrussell.

@trungtle / @shrekshao if we had enough time it would be nice to make a WebGL 2 utility library for things like this...could be a project for other students for another semester.

@trungtle
Copy link
Contributor Author

@kenrussell I took a look at the implementation in tcuFloat, thanks for pointing out. @pjcozzi I will try to get the half float conversion done and update this pull request.

@pjcozzi
Copy link
Contributor

pjcozzi commented Feb 29, 2016

Should we close this as duplicate with #96?

@pjcozzi pjcozzi merged commit e68396e into master Mar 15, 2016
@pjcozzi pjcozzi deleted the tle/vertex_format branch March 15, 2016 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants