Skip to content

Conversation

@mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Jan 29, 2026

Summary

  • Adds new GsplatMesh script (scripts/esm/gsplat/gsplat-mesh.mjs) that converts mesh geometry into gaussian splats
  • Adds new example procedural-mesh.example.mjs demonstrating terrain and animated cloud conversion to splats

Details

GsplatMesh Script

A new script that extracts triangles from render components and generates uniformly distributed splats across mesh surfaces using scanline rasterization.

API:

const gsplatMesh = entity.script.create(GsplatMesh);
gsplatMesh.buildFromEntity(sourceEntity, {
    splatSize: 0.01,    // Size of each splat (default: 0.01)
    recursive: true,    // Search children for render components (default: true)
    margin: 0.65        // Edge margin relative to splatSize (default: 0.65)
});

Features:

  • Extracts color from StandardMaterial (emissive if non-black, else diffuse)
  • Supports transparent materials (uses material.transparent to detect)
  • Splats are generated in local space relative to the source entity root
  • Configurable margin to avoid overlap artifacts at shared triangle edges

Procedural Mesh Example

Demonstrates converting the terrain.glb scene to gaussian splats:

  • Converts static terrain geometry to splats
  • Converts cloud meshes to separate splat entities with transparency
  • Clones and animates cloud splats in circular paths (matching shadow-cascades example)
  • Includes reveal shader effect
Screenshot 2026-01-29 at 13 27 27

@mvaligursky mvaligursky self-assigned this Jan 29, 2026
@mvaligursky mvaligursky added enhancement Request for a new feature area: graphics Graphics related issue area: examples labels Jan 29, 2026
@mvaligursky mvaligursky requested a review from a team January 29, 2026 13:29
@mvaligursky mvaligursky merged commit 3dfea37 into main Jan 29, 2026
7 checks passed
@mvaligursky mvaligursky deleted the mv-gsplat-mesh branch January 29, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: examples area: graphics Graphics related issue enhancement Request for a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants