KhronosGroup / KhronosGroup/glTF
KHR_materials_ior: Using ior=0 with transmission?
- Dominant language
- HTML
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 17h 26m
- Merged PRs (30d)
- 5
Description
From the KHR_materials_ior specification —
> Valid values for ior are numbers greater than or equal to 1. In addition, a value of 0 is allowed. This value gives full weight to layer, i.e., the Fresnel term evaluates to 1 independent of the view or light direction. It is useful in combination with KHR_materials_specular to seamlessly support the specular-glossiness workflow.
This would seem to suggest that ior=0 is a special case, meant for converting spec/gloss to metal/rough materials with KHR_materials_specular. The specification does not mention whether ior=0 is a meaningful choice with transmission or volume. We ran into this case with user-created model from Blender, using transmission and ior=0. This turned out to be a mistake (values of 1 – 1.33 would have been more appropriate), but it got me wondering whether the usage is correct, and/or something that the validator should warn about.
As a test, I've modified the [TransmissionRoughnessTest](https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/TransmissionRoughnessTest) sample to include ior=0 and ior=1000. The last row, unlabeled, is opaque with default IOR. I believe three.js currently hits a "divide by zero" with ior=0 in transmission, and the result for that row varies on different devices.
[TransmissionIORTest.blend.zip](https://github.com/KhronosGroup/glTF/files/11618494/TransmissionIORTest.blend.zip)
[TransmissionIORTest.glb.zip](https://github.com/mrdoob/three.js/files/11616209/TransmissionIORTest.glb.zip)
| engine | screenshot|
|---|---|
| three | |
| babylon | |
| khronos | |
| playcanvas | |
Contributor guide
Research direction
Start with the KHR_materials_ior specification and the modified TransmissionRoughnessTest sample, then inspect the attached Blender and GLB files in engines that support transmission. Determine whether ior=0 with transmission or volume is valid and whether the validator should warn; done means the specification and validator behavior are clarified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- blender, three.js
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100