remove junky UncoloredSpaceTriangle union, hide vertex generation from generic triangle implementation

This commit is contained in:
veclavtalica
2024-11-03 23:08:53 +03:00
parent 26c75ffd7c
commit d794ca862f
3 changed files with 48 additions and 62 deletions

View File

@ -83,32 +83,19 @@ typedef struct Primitive2D {
} Primitive2D;
/* union for in-place recalculation of texture coordinates */
union UncoloredSpaceTriangle {
/* pending for sending, uvs are not final as texture atlases could update */
struct UncoloredSpaceTrianglePrimitive {
Vec3 v0;
Vec2 uv0; /* in pixels */
Vec3 v1;
Vec2 uv1; /* in pixels */
Vec3 v2;
Vec2 uv2; /* in pixels */
} primitive;
/* TODO: have it packed? */
/* structure that is passed in opengl vertex array */
struct UncoloredSpaceTrianglePayload {
Vec3 v0;
Vec2 uv0;
Vec3 v1;
Vec2 uv1;
Vec3 v2;
Vec2 uv2;
} payload;
};
/* needs to be later resolved in texture atlas */
typedef struct UncoloredSpaceTriangle {
Vec3 v0;
Vec2 uv0; /* in pixels */
Vec3 v1;
Vec2 uv1; /* in pixels */
Vec3 v2;
Vec2 uv2; /* in pixels */
} UncoloredSpaceTriangle;
/* batch of primitives with overlapping properties */
typedef struct MeshBatch {
uint8_t *primitives;
uint8_t *primitives; /* note: interpretation of it is arbitrary */
} MeshBatch;
/* TODO: use atlas id instead */