Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Incorrect use of uv1, missing KHR_materials_volume #21

Closed
echadwick-artist opened this issue Mar 28, 2022 · 4 comments
Closed

Incorrect use of uv1, missing KHR_materials_volume #21

echadwick-artist opened this issue Mar 28, 2022 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@echadwick-artist
Copy link

Describe the bug
Some models seem to render with incorrect materials. Perhaps the renderer is applying uv1 incorrectly (uv1 is on the model but unused)? Also perhaps KHR_materials_volume is not supported?

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://gltf.report/
  2. Drag-and-drop the attached model.
  3. Notice the glossy blocky patches on the sides of the glass. The whole glass should appear shiny, rather than in blocks. Perhaps the textures are using uv1 instead of uv0? This model has an unused uv1.
  4. Also notice the green attenuationColor is not appearing on the model. Perhaps KHR_materials_volume is not supported?

Expected behavior
The model should look similar to how it renders in the glTF Sample Viewer. https://github.khronos.org/glTF-Sample-Viewer-Release/

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10 Enterprise
  • Browser: Chrome
  • Version: 99.0.4844.84 (Official Build) (64-bit)

Additional context
Example model: bzv4229_lod3.zip

Thanks Don!

@echadwick-artist echadwick-artist added the bug Something isn't working label Mar 28, 2022
@donmccurdy
Copy link
Owner

Thanks @echadwick-wayfair! Two issues happening here —

  1. three.js always uses UV2 for AO. It detects when UV2 is missing and copies UV1, but isn't doing that here because it would be overwriting the existing (unused) UV2. So the AO is rendered with the wrong UVs causing the black splotches.
  2. This viewer currently does not set a clear color (or other background) in the WebGL context, so you see the transparent HTML/CSS page behind the model. Since that CSS is outside the WebGL scope it doesn't get the expected attenuation.
    • Resolution: I believe this can be fixed with changes to this viewer

@donmccurdy
Copy link
Owner

donmccurdy commented Apr 1, 2022

I pushed a fix for (2) and you should see attenuation now:

Screen Shot 2022-04-01 at 10 48 35 AM

This does identify a remaining issue – this viewer scales the content to a unit cube to fit the camera/viewport framing, which then affects the attenuation (darker, above) because the scale has changed. I think I'll need to fix the content staging for that.

@donmccurdy donmccurdy added this to the v2 milestone Apr 25, 2022
@donmccurdy
Copy link
Owner

This does identify a remaining issue – this viewer scales the content to a unit cube to fit the camera/viewport framing, which then affects the attenuation (darker, above) because the scale has changed. I think I'll need to fix the content staging for that.

Fixed in latest release.

@donmccurdy
Copy link
Owner

Tracking the remaining parts of this issue in:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants