Skip to content

Allow customizing CompactSubGeometry. - #66

Draft
player-03 wants to merge 21 commits into
openfl:masterfrom
player-03:VertexDefinition
Draft

player-03 wants to merge 21 commits into
openfl:masterfrom
player-03:VertexDefinition

Conversation

@player-03

@player-03 player-03 commented Jul 20, 2025

Copy link
Copy Markdown
Collaborator

Most users likely don't need "secondary UVs", for instance, and could save memory by omitting them. Others might want to add a custom 4-length attribute.

Sample usage:

final vertexDefinition:VertexDefinition = new VertexDefinition([
	new AttributeDefinition("position", 3),
	new AttributeDefinition("UV", 2)
]);
final geometry:CompactSubGeometry = new CompactSubGeometry(vertexDefinition);

//Add geometry containing positions and UVs...

view.scene.addChild(new Mesh(geometry));

This sub-geometry allocates only 5 floats per vertex, instead of 13, massively reducing buffer size.

…es `CompactSubGeometry` includes.

Most users likely don't need "secondary UVs", for instance, and could save memory by omitting them. Others might want to add a custom 4-length attribute.
@player-03

Copy link
Copy Markdown
Collaborator Author

Oh, and I wrote this for Haxe 4.3+, so that's another reason it's still a draft.

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.

1 participant