Repository navigation
A mesh an edit wrote has no cutout map - #306
Merged
Merged
Conversation
wryyx
force-pushed
the
cutout-maps-edits
branch
from
December 2, 2026 16:27
87e6044 to
1d39a3e
Compare
A cutout's maps (renderer/src/cutout.rs) are made of its triangles' texture coordinates when the scene is prepared, and an instance an edit places takes those of the scene's instances of its mesh. It took them too when the edit had rewritten that mesh where it lies (a `dynamicGeometry` mesh, the same sections): an emitter's shadow rays then asked the map of the triangles the mesh had had. A card's texture coordinates mirrored at run time kept its old picture of light and shadow on the ground. The edit state keeps the meshes whose triangles an edit wrote (a new mesh, a freed one's slot, one rewritten where it lies), and an instance of one takes no map: its cutout is opaque to those rays, as a cutout whose material or texture was edited already is, until the scene is prepared again. To make the map again at the edit needs the texture's pixels and room in the maps' stream then: not done. `shadow/cutout-emitter-geometry-edit-live`: the card of `shadow/cutout-emitter-side` with its u mirrored after three frames. The point the old map lit, against a point a lamp under the card lights: 0.25 before (under both traversals), 0.003 now; with the alpha tested 0.085. Unit suite 297, render suite 277 (on main with meshy-dev#305). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
wryyx
force-pushed
the
cutout-maps-edits
branch
from
December 2, 2026 16:27
1d39a3e to
723f5d9
Compare
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.
A fault of #304, found the same day.
A cutout's maps are made of its triangles' texture coordinates when the scene is prepared, and an instance that an edit places takes those of the scene's instances of its mesh. It took them too when the edit had rewritten that mesh where it lies (a
dynamicGeometrymesh whose geometry changes with the same sections): an emitter's shadow rays then asked the map of the triangles the mesh had had. A card's texture coordinates mirrored at run time kept its old picture of light and shadow on the ground.The change
The edit state keeps the meshes whose triangles an edit wrote (a new mesh, a freed one's slot, one rewritten where it lies), and an instance of one takes no map. Its cutout is then opaque to an emitter's shadow rays, which is what #304 already does for a cutout whose material or texture was edited, until the scene is prepared again.
That is dark where the true picture is lit, not the wrong pattern. To make the map again at the edit needs the texture's pixels and room in the maps' stream at that time: not done here.
The test
shadow/cutout-emitter-geometry-edit-live: the card ofshadow/cutout-emitter-sidewith its u mirrored after three frames, in place. It reads the point the old map lit against a point that a lamp under the card lights.THREERT_APPROX=0), what a map made again would giveChecks
Unit suite 297 (on main with #305), render suite 277 (the cutout tests also under
THREERT_HWRT=0),npm run typecheck, the two wasm32 builds. Measured on an Apple M4.🤖 Generated with Claude Code