question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Examples: webgl_loader_gltf_transmission issues

See original GitHub issue

Reposting https://github.com/mrdoob/three.js/issues/21000#issuecomment-862597968 so as to consolidate some remaining issues.

  1. webgl_loader_gltf_transmission has the transparent property of each sphere to set to false. Is that what the loader should be doing? What should transparent be set to when transmission is non-zero?

  2. After setting transparent to true, only front-faces show the hot-spot. (This may be a known limitation, but @mrdoob just added support for properly rendering back-faces of double-sided meshes.) There should be two hot-spots. Screen Shot 2021-06-16 at 1 53 43 PM

  3. FIXED: This is caused by issue 7. below. Screen Shot 2021-06-16 at 1 51 42 PM

  4. FIXED Also, in Chrome and Firefox (not Safari)

THREE.WebGLProgram: gl.getProgramInfoLog() WARNING: Output of vertex shader ‘vUv’ not read by fragment shader

Transmission always sets the USE_UV flag.

  1. FIXED: If performant, I think the dimensions of the “transmission render target” should match the dimensions of the “current render target”. Doing so will prevent artifacts like the following:
Screen Shot 2021-06-21 at 9 04 34 PM
  1. FIXED In the following code snippet, transmissionFactor is applied to getIBLVolumeRefraction() twice. I expect that is a physical modeling error.

https://github.com/mrdoob/three.js/blob/dd6ab3cf310f78a8375b8b2037db12ce8e31e82c/src/renderers/shaders/ShaderChunk/transmission_fragment.glsl.js#L23-L28

  1. FIXED Also in the above snippet, totalSpecular has units of radiance, and therefore cannot be the correct argument because the function expects a unit-less quantity. A reasonable guess would be material.specularColor, instead.
  • Device: Desktop
  • OS: macOS 11.4
  • Browser: Chrome, Firefox, Safari
  • Three.js version: r130dev

/ping @takahirox @donmccurdy

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:32 (13 by maintainers)

github_iconTop GitHub Comments

6reactions
cx20commented, Jul 31, 2021

Thank you for fixing the shader. I tried again with the latest version of the library. Looks good.

Library IridescentDishWithOlives.gltf - closed IridescentDishWithOlives.gltf - open
glTF Sample Viewer image image
Three.js r131dev image image
Three.js r131.1 image image
4reactions
takahiroxcommented, Jul 30, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Broken rendering in gltf models with transmission on safari ...
Hi, if I load gltf models with transmission on Babylon sandbox, rendering is broken, as if the color buffer is never cleared (but...
Read more >
glTF and WebGL - GDC 2019 - YouTube
Khronos Dev Day presentations & videos: https://khr.io/riJoin our Developer Slack: www.khr.io/slack02:00 Ken Russell, Google14:30 Patrick ...
Read more >
cx20/gltf-test: Testing the glTF Loader and WebGL Library
Model Name, Models, Formats, Libraries, Tests. Simple models, 11, 2, 21, 440. More complex models, 18, 4, 21, 1,440. PBR Sample, 9, 4,...
Read more >
Load 3D Models in glTF Format - Discover three.js!
Here, we show you how to load complex animated models and add them to your scene. These models were originally created in Blender...
Read more >
ThreeJS my GLTF loading speed is too slow on host server?
There are several way in order to speed up transmission time. ... inconvenient to use platform independent texture compression with WebGL.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found