• Alexander Cooper's avatar
    Fix WebXR lighting estimation page · 024e2ad8
    Alexander Cooper authored
    There were currently two issues with the lighting estimation page: the
    ambient light was brighter than expected and the reflection map wasn't
    being rendered onto the sphere.
    
    The first issue was likely a result of the sphere's texture having 0
    "metalness" and thus being more "stone" like. This caused the light to
    get applied to a broader area, and thus made it seem more washed out. In
    addition, we now also set the intensity of the light probe to 1 each
    frame. While this likely doesn't impact the ambient light intensity, it
    is a better pattern having it mirror what happens with the directional
    light.
    
    The second was partially due to the metalness value (nothing reflects
    with a metalness of 0); however, the environment map wasn't actually
    getting set up in Three's renderer.
    
    There's also two additional issues that are fixed here. The first is
    that the reflectionchange event was incorrectly subscribed (both the
    name and to the wrong object). However, even with that fixed there is
    some form of known issue with the event, that means we instead need to
    rely on a simple interval timer.
    
    Finally, this change also ensures that the appropriate GL extensions are
    enabled for the two possible texture types that we support.
    
    Fixed: 1151501,1151491
    Change-Id: Id6ff4f5e4cc237a5e9c4a8aefb82a96827a48205
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2587554
    Auto-Submit: Alexander Cooper <alcooper@chromium.org>
    Commit-Queue: Brandon Jones <bajones@chromium.org>
    Reviewed-by: default avatarBrandon Jones <bajones@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#836349}
    024e2ad8
lighting-estimation.html 9.29 KB