Repository navigation
3.1.1: metals under flat ambient, visionOS PBR maps, occlusion UV set, mirrored nodes - #449
Merged
Merged
Conversation
…n on a second UV set
…module, MetalKit and Accelerate, bundled models
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
The rendering gaps left after 3.1.0's glTF work, found by checking DamagedHelmet texture by texture against three.js and a 8,464-model corpus against the spec.
Shaders
pbr_const_amb, Metalvro_pbr_shade): without an environment map the flat ambient term ignored metalness, so metals lit like matte paint. It is now scaled by1 - metalness, as three.js and Filament do. With it, DamagedHelmet's metallic-roughness map changes 27% of its pixels in three.js and now visibly in Viro too (it was 7%).normalTexture.scaleandocclusionTexture.strengthreach the shaders (material_normal_scale,material_ao_strength); both default to 1, so nothing changes for materials that do not set them.VROGeometrySourceSemantic::Texcoord1, a geometry modifier that passes it to the fragment stage, and an AO modifier that samples it. All 16 guaranteed GL attribute slots were taken; it binds at 6, the EdgeCrease slot no shader reads (VRX subdivision data only).visionOS (Metal)
pbr_lighting_fragment_maps: base color, normal, metallic-roughness, occlusion and emissive maps, with the glTF factors and the emissive map's own transform. The Metal PBR path read the base color only, so DamagedHelmet drew as a white silhouette.VROMaterialSubstrateMetal::getIndexedTextures, past the shadow and IBL textures at 4-7; absent maps get the blank texture and are skipped bypbr_mapsbits. Occlusion on a second UV set is left out here.Loader
TEXCOORD_nloads that set as Texcoord1 (VROMaterialVisual::setTexcoordSet).visionOS test app
ios/ViroKitVisionOSTestbuilds again: the generator compiles viro's shared-space sources, a stubViroReactmodule map stands in for the pod's module, MetalKit and Accelerate are linked, and the GLBs are bundled. The window is smaller so it does not hide the scene. Pairs with a viro change that adds DamagedHelmet to the bridge's test scene.Notes
lightingEnvironmentlooks darker than in 3.1.0; that is glTF's and three.js's result. In the release notes.CHANGELOG.mdgains v3.1.1 (undated until release);RELEASE_NOTES.mdis now 3.1.1's.Testing
TEXCOORD_1and for a mirrored node (both now match the reference), and 13 showcase/Khronos models 3.1.0 vs 3.1.1: 10 identical, the 3 with metal parts darker as intended.