RhodoniteTS icon indicating copy to clipboard operation
RhodoniteTS copied to clipboard

feat: Custom Vertex Attributes

Open emadurandal opened this issue 3 years ago • 0 comments

This feature is ...

  • Implement the System for Custom Vertex Attribute Layout like:
    • VertexAttributeSlot 0: "Position.X, Position.Y, Position.Z, Texcoord.X"
    • VertexAttributeSlot 1: "Normal.X, Normal.Y, Normal.Z, Texcoord.Y"
  • Add the shader system which converts their custom layout vertex attributes to each standard vertex attribute (Position, Normal, Texcoord, etc...)
  • Add the "CustomVertexAttribute" class, which has functionalities of view / copy to a target vertex attributes layout from an original vertex attributes layout.

The shader system converts this:

attribute vec4 a_customAttribute0;
attribute vec4 a_customAttribute1;

to

vec3 v_position = a_customAttribute0.xyz;
vec3 v_normal = a_customAttribute1.xyz;
vec2 v_texcoord = vec2(a_customAttribute0.w, a_customAttribute1.w);

emadurandal avatar Jan 26 '22 06:01 emadurandal