Open dawsonc623 opened 7 years ago
While wrapping may be done per attribute, the actual typed array configured is probably more tied to the GLSL type (and thus AttributeType
) than the specific attribute. To balance between this, the best course of action is likely along the lines of adding a component that pulls the necessary type information (mostly the type of typed array to use) from the AttributeType
and use information stored on the attribute (i.e. normalization, string, and offset) to populate the array.
Given the amount of things Gill handles (including the mapping between an expressive interface for handling vertices and the flat and mechanical storing requirements of WebGL), all of this extra configurability may be completely unnecessary. However, given that the mapping itself can be controlled by the user of Gill, it stands to reason the components that handle telling WebGL how to read the mapped data be configurable to reflect said control.
Currently, the wrapping of raw data to typed arrays is specified per attribute type. However, since wrapping the data also determines the layout of the data (normalization, stride, and offset), it seems as though setting that all per type is not the greatest. Instead, these should be specified per attribute.
This relates to #4, as the customization of these attributes needs to be defined, yet. Currently, the attributes are detected automatically in order to simplify development. It may be worth adding a way to define custom configuration on attributes when the program is created. It is hard to say at this time what that might look like.