Moguri / panda3d-gltf

glTF utilities for Panda3D
BSD 3-Clause "New" or "Revised" License
81 stars 19 forks source link

Support KHR_materials_ior, set default refractive index to 1.5 #113

Closed rdb closed 2 years ago

rdb commented 2 years ago

Default index of refraction in glTF is 1.5 (resulting in F0 of 0.04), in Panda it is 1.0 for backward compatibility reasons.

Also supports KHR_materials_ior, which allows changing this value.

simplepbr at the moment hardcodes this value: https://github.com/Moguri/panda3d-simplepbr/blob/449335fa9381df68adad7128f6433e22d04a4e58/simplepbr/shaders/simplepbr.frag#L65 …but this may be changed down the line, or respected by other renderers, so it's good to be forward-compatible.