feat: add Mesh Particle Renderer (RendererType.MESH) - #30
Merged
Conversation
Add a new renderer type that renders each particle as a 3D mesh using GPU instancing (InstancedBufferGeometry). Unlike billboard renderers, mesh particles support real 3D geometry with quaternion-based rotation, preserved normals, and simple directional lighting. Key changes: - New RendererType.MESH enum value - MeshConfig type with geometry: THREE.BufferGeometry - Custom vertex/fragment shaders for mesh particles - Quaternion attributes (instanceQuatX/Y/Z/W) for 3D rotation - All existing modifiers work (size, color, opacity, rotation, noise, force fields, sub-emitters) - 6 new examples: rock debris, floating gems, geometric storm, coin shower, abstract cubes, magic runes - 21 new tests (634 total, all passing) - Updated docs: CLAUDE.md, README.md, ROADMAP.md, llms.txt, llms-full.txt Co-Authored-By: Claude <noreply@anthropic.com> https://claude.ai/code/session_01S13HKQjgAsejupXL9KG2sD
Contributor
Bundle Size Report
✅ Bundle size is within the 150 KB limit. |
…default texture - Pack 4 separate quaternion float attributes (quatX/Y/Z/W) into a single vec4 instanceQuat attribute, reducing total vertex attributes from 18 to 15 (WebGL limit is 16) — fixes "Too many attributes" shader error - Sub-emitters no longer inherit RendererType.MESH or RendererType.TRAIL from parent, since mesh geometry and trail config cannot be passed through - MESH renderer uses solid white 1×1 default texture instead of circle texture, so 3D mesh shapes are visible instead of appearing as circles - Update magic runes example sub-emitter to use trail renderer for sparkle effect - Update docs: llms.txt, llms-full.txt, architecture.md, CLAUDE.md Co-Authored-By: Claude <noreply@anthropic.com>
…etry - Only generate previews for examples that don't have one yet (HEAD check) - Add MESH_GEOMETRIES map so mesh renderer examples can generate previews - Shows count of missing previews before starting Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
The point force field test was intermittently failing on CI because the simulation time was too short for particles to move noticeably. Increase the second step delta and lower the movement threshold. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a new renderer type that renders each particle as a 3D mesh using
GPU instancing (InstancedBufferGeometry). Unlike billboard renderers,
mesh particles support real 3D geometry with quaternion-based rotation,
preserved normals, and simple directional lighting.
Key changes:
force fields, sub-emitters)
coin shower, abstract cubes, magic runes
Co-Authored-By: Claude noreply@anthropic.com
https://claude.ai/code/session_01S13HKQjgAsejupXL9KG2sD