Repository navigation
fix(web,xr): populate PrimitiveGpu PBR defaults and alphaBlend on dynamic meshes - #107
Merged
Merged
Conversation
…amic meshes - Populate complete `PrimitiveGpu` PBR defaults (`emissiveFactor: [0, 0, 0]`, `emissiveTexture: null`, `clearcoat: 0`, `clearcoatRoughness: 0.04`, `doubleSided: true`, and `alphaMode: 'BLEND'` when `alphaBlend` is set) across `createDynamicMesh` (`xr-live/src/plugins/common.ts`), `XRSpatialSlotManager` (`xr-live/src/xr-spatial-slot.ts`), and `createARReticleGpu` (`three-live/src/three-xr.ts`), preventing `TypeError: Failed to execute 'uniform3fv' on 'WebGL2RenderingContext'` when rendering `<xr-live>` dynamic overlays (`grab` handles, `section-plane` gizmos, `explode` leaders, spatial DOM slots, and `<three-live ar>` reticles) and routing translucent gizmos through the two-pass `alphaMode: 'BLEND'` draw pass. - Harden `ThreeView.render()` (`three-live/src/three-view.ts`) with fallback `emissiveFactor`, `baseColor`, `metallic`, `roughness`, `normalScale`, and `occlusionStrength` defaults so partial plugin primitives cannot trigger WebIDL sequence `TypeError`s. - Update `XRSpatialLocomotionController.syncVisuals` (`xr-live/src/plugins/spatial-locomotion.ts`) to mutate `primitives[0].baseColor` when switching between valid and invalid teleport arcs. - Add WebIDL-strict WebGL2 `uniform*fv` / `uniformMatrix*fv` and two-pass `alphaMode: 'BLEND'` regression tests in `three_view_test.ts` and `xr_plugins_test.ts`.
This was referenced Nov 18, 2026
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.
Summary
PrimitiveGpuPBR defaults &alphaBlendpass routing across synthetic meshesxr-live/src/plugins/common.ts(createDynamicMesh),xr-live/src/xr-spatial-slot.ts(XRSpatialSlotManager), andthree-live/src/three-xr.ts(createARReticleGpu): populatesemissiveFactor: [0, 0, 0],emissiveTexture: null,clearcoat: 0,clearcoatRoughness: 0.04,doubleSided: true, andalphaMode: 'BLEND'(whenalphaBlend: trueor translucent overlay quads/reticles are constructed). FixesTypeError: Failed to execute 'uniform3fv' on 'WebGL2RenderingContext'when rendering<xr-live>dynamic overlays (grabhandles,section-planegizmos,explodeleaders, spatial DOM slots, and<three-live ar>reticles) and ensures translucent gizmos render in the two-passalphaMode: 'BLEND'draw pass instead of writing opaque depth.ThreeView.render()(three-live/src/three-view.ts) & fix teleport arc color updates (xr-live/src/plugins/spatial-locomotion.ts)uEmissiveFactor,uBaseColor,uMetallic,uRoughness,uNormalScale, anduOcclusionStrengthinThreeView.render()against partial plugin-injected primitives.XRSpatialLocomotionController.syncVisualsto writeprimitives[0].baseColorwhen transitioning between valid and invalid teleport arcs.CHANGELOG.mduniform*fv/uniformMatrix*fvand two-passalphaMode: 'BLEND'render tests inthree-live/tests/three_view_test.tsandxr-live/tests/xr_plugins_test.ts.