Search Unity

Windows Build - Graphical Bugs With Refraction

Discussion in 'General Graphics' started by ShadyAlien, Jan 8, 2017.

  1. ShadyAlien

    ShadyAlien

    Joined:
    Aug 28, 2009
    Posts:
    210
    I'm having some weird issues with my windows builds. These issues do not occur in mac builds or in the editor. The problem is that refraction shaders are very inconsistent as whether or not they'll actually refract, with most (but not all) materials (using unity's default refraction shader) failing to refract anything. I'm using Lux's geometry refraction shader as well, which also does not work in the build, and AQUAS Lite, which utilizes refraction and seems to be working fine in most places except one. In one area, I get these weird artifacts (pictures attached). Has anybody seen artifacts like this before? I'm not sure what's causing this. The issue occurs on both windows machines I've tried (Windows 10 and 7), on both AMD and nvidia cards with D3D11. I don't know if these problems are related or not, my guess is that they are since all of the shaders that are not working involve refraction. Screenshot (70).png Screenshot (69).png
     
  2. ShadyAlien

    ShadyAlien

    Joined:
    Aug 28, 2009
    Posts:
    210
    After messing around a little more, I've discovered the problem with the refraction shaders is that they are in fact refracting, but not nearly enough. Even with the value distortion value cranked to full, you can barely see the difference. On mac builds and in the editor, these shaders are working as advertised, so to speak, but in windows, they hardly refract anything at all.
     
  3. ShadyAlien

    ShadyAlien

    Joined:
    Aug 28, 2009
    Posts:
    210
    Upon further investigation the artifacts seem to be caused by the Advanced Foliage Shader that's being used on the plants. It only occurs in certain areas, and only in the build.

    I fixed the refraction by hacking the shader to add a multiplier to the distortion amount value, which I can change based on the target platform. Still not sure why that's acting differently on Windows, but I at least have a workaround for now.