Repository navigation
Even out Studio and share lighting - #881
Merged
Merged
Conversation
The canvas key sat on +Y in a Z-up scene, with no environment for metals to reflect, so aluminium went black-and-white and dark plastics fell under luma 20. AgX at exposure 1, an overhead hemisphere plus a close key and fill, and a room environment rotated onto +Z keep light faces shaded. Anisotropy is applied only when a map is present, because these meshes have no tangents. Signed-off-by: Cursor Agent <[email protected]> Co-authored-by: Andrii Shylenko <[email protected]>
Shard 4 failed on usecase-spur-gear-pair's mechanism gate. That check runs evaluate_script and does not load the viewer. Signed-off-by: Cursor Agent <[email protected]> Co-authored-by: Andrii Shylenko <[email protected]>
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.
Why
Production share paints (develop after #872) are still the pre-AgX rig. The AgX / dim-light / room-environment change in a272125 was reverted inside #872 and left on
feat/viewer-lighting-agx. What app.kernelcad.com actually ships, confirmed inassets/index-BP6uzJra.js:NeutralToneMapping, exposure 1[10, 20, 10], fill 0.3 at[-5, -10, -5]RoomEnvironmenton the Studio canvasThe scene is Z-up, so that key is a side light (its largest component is +Y). Metalness-1 faces have nothing to reflect, so they go black except for a white specular spike. Dark dielectrics fall under luma 20. Brushed aluminium (
anisotropy: 0.8on the published T-slot) has no vertex tangents, and that degenerate frame paints whole faces black and white.The demo player keeps its own Neutral rig at exposure 1 and room intensity 0.3. This PR does not touch it.
New numbers
0xf7f8fa, ground0xd2d6db, intensity 1.45, from[0, 0, 1][10, 20, 10]@ 0.7[10, -8, 22]@ 0.34[-5, -10, -5]@ 0.3[-12, 10, 16]@ 0.26Hemisphere intensity is above 1 because three.js divides indirect light by π; the two directionals are the form. Both are overhead (+Z is the largest component) and within 1.3× of each other, so the side turned away from the key stays a shade.
AgX stays. Neutral plus the old hot key is what clipped light faces. ACES is the tone map that crushes saturated CAD hues; it was not brought back.
White-clip check
Headless Chromium (SwiftShader), the same three.js lights, AgX, and RoomEnvironment as the viewer, on the published CDN meshes. Model pixels are everything that is not the
#202126stage. Blown = luma > 245, dark = luma < 20.T-slot
OGm0lP_Bv1 (aluminium-brushed, metalness 1, anisotropy 0.8):4DOF arm
DNSlHVFOv1 (mostly#243140dielectric, roughness 0.55):Ortho face centers on finish swatches under the shipped rig (aluminium, brushed, stainless, nylon, delrin, white
#f4f4f4, ABS, servo blue): no face mean above 235, blown fraction 0. White#f4f4f4reads 184–216. PinningenvMapat intensity 0.62 and the same rotation matchesscene.environmentexactly.OGm0lP_B — T-slot frame corner
Before (production rig):
OGm0lP_B T-slot before, production rig
After (shipped rig):
OGm0lP_B T-slot after, shipped rig
DNSlHVFO — 4DOF arm
Before (production rig):
DNSlHVFO 4DOF arm before, production rig
After (shipped rig):
DNSlHVFO 4DOF arm after, shipped rig
These are the stored meshes rendered with the viewer’s light constants, not a screenshot of the Studio chrome. The disconnected arm geometry is unchanged.
Tests
Viewer.test.tsxlocks AgX and exposure 1viewerLighting.test.tslocks the intensities, the overhead key, and the key/fill ratioroomEnvironment.test.tslocks per-scene IBL, intensity 0.62, and the +Z rotation, including that one canvas cannot receive another’s texturebuildShapeMaterial.test.tslocks anisotropy 0 without a map, and keeps 0.8 when a map is setDo not merge until the share-page look is approved.
To show artifacts inline, enable in settings.