Index of refraction changing material when metalness < 1

The Index of refraction property changes the material appearance of a material if metalness is used and <1 even when refraction is set to 0. Setting index of refraction to 0 renders the object completly black/reflective.

Steps to reproduce:

  • create a cube render object
  • create new material and add it to the cube
  • check use metalness
  • set metalness to something <1
  • observe material changing when chaning index of refraction property

Here is a scene showing the issue:
https://playcanvas.com/project/1059417/overview/refraction-issue

@Gustav_Sterbrant Is this expected behaviour? Should IOR stay at 0.667 regardless?

This also leads to non metallic materials to be very shiny when imported in the editor or at runtime, e.g. from glbs.
This does not occur when using the playcanvas gltf viewer, so I don’t think it is expected behaviour.

@slimbuck Any ideas on this one as it seems to be an import GLB issue too?

Hi @Adolar13 ,

Thanks so much for reporting this issue and providing a repro. It makes fixing the issue so much easier!

I’ve submitted a fix Check for ior 0 by slimbuck · Pull Request #5239 · playcanvas/engine · GitHub.

Thanks again!

1 Like