Home Technical Talk

Game engines and IOR

Hey guys, I have a question concerning the use of IOR on games.
We know that one of the key points on making a believable material is adjusting the IOR value, specially when talking about metal and glass.
I know that there are ways to change the IOR value of your metal on engines like UE4 and unity, but my questions is:
Is that optimal? Is it commonly used on games? Or it will make the engine heavier by having this extra math going on behind every metal shader.
Thanks!

Replies

  • MmAaXx
    Offline / Send Message
    MmAaXx polycounter lvl 10
    you shouls use a proper reflection color that rapresent the f0 value in the IOR.
    For example, for dieletric materials f1.45 could be replaced with a sRGB value of 60 (r60 g60 b60)
    for metals you should put the diffuse black and the proper metal color in the reflection instead.

    But depend also about the engine and his workflow, so proably you have to use the metalness workflow that is another story bu behind it you have the same theory.

    cheers.
  • yukonwanderer
    Offline / Send Message
    yukonwanderer polygon
    If you import materials from substance painter is this automatically set up properly?
  • MmAaXx
    Offline / Send Message
    MmAaXx polycounter lvl 10
    @yukonwanderer
    not really, I mean Substance  painter and Designer take care of the most par, but is really better to know what are you doing, understand a little bit of theory is always better.
  • rohMizuno
    I see, so for the metalness  work flow, do you know if people have been using a extra map only for IOR control? 
  • ActionDawg
    Offline / Send Message
    ActionDawg greentooth
    The metalness workflow replaces a constant IOR for nonmetals (usually 1.5, aka 4% reflection) with whatever you put in the Albedo map. So if you have a metalness map where a spot is pure metal it is going to use the Albedo as an IOR (its actually a reflection coefficient, but basically IOR) instead. No tweaking should be necessary beyond that.
  • EarthQuake
    IOR is not a common way to control reflectivity in games. Generally, reflectivity is set with an explicit spec map, or with a metalness map. In the metalness map workflow, for metals you set reflectivity directly with the albedo color, for non-metals, it's fixed to 4% reflectivity.

    I think there is some confusion with IOR, that IOR is something magical that game artists can't control with real-time shaders. In reality, IOR is just a different scale or unit system for defining reflectivity (literally, how reflective a material is). IOR isn't "math heavy" per say, it's just a really inconvenient and confusing reference system to use (for instance, metals and insulators map to different IOR scales), so the 0-100% reflectivity system is generally used instead.

    So, unless you're doing some scientific thing and getting the exact IOR is very important to your project, you can safely ignore the concept of IOR in games.
  • rohMizuno
    that does make sense, thanks for clarifying that for me!
Sign In or Register to comment.