Given a an array of intrinsics like this
array<vec3, 200>
The default is to create a single Float32Array(4 * 200)
because creating 200 Float32Array views is not usually
what you want.
If you do want individual views then you'd call
setIntrinsicsToView(['vec3f']) and now you get
an array of 200 Float32Arrays.
Note: setIntrinsicsToView always sets ALL types. The list you
pass it is the types you want views created for, all other types
will be reset to do the default. In other words
Only vec2f will have views created. vec3f has been reset to the default by
the second call
You can pass in true as the 2nd parameter to make it set which types
to flatten and all others will be set to have views created. For example
to expand all types would be setIntrinsicsToView([], true). To expand
all except f32 would be setIntrinsicsToView(['f32'], true).
To reset all types to the default call it with no arguments
Set which intrinsic types to make views for.
Example:
Given a an array of intrinsics like this
array<vec3, 200>
The default is to create a single
Float32Array(4 * 200)
because creating 200Float32Array
views is not usually what you want.If you do want individual views then you'd call
setIntrinsicsToView(['vec3f'])
and now you get an array of 200Float32Array
s.Note:
setIntrinsicsToView
always sets ALL types. The list you pass it is the types you want views created for, all other types will be reset to do the default. In other wordsOnly
vec2f
will have views created.vec3f
has been reset to the default by the second callYou can pass in
true
as the 2nd parameter to make it set which types to flatten and all others will be set to have views created. For example to expand all types would besetIntrinsicsToView([], true)
. To expand all exceptf32
would besetIntrinsicsToView(['f32'], true)
.To reset all types to the default call it with no arguments