Search Unity

Simple Refraction/Glass

Discussion in 'Image Effects' started by SpinningClock, Jul 24, 2017.

  1. SpinningClock

    SpinningClock

    Joined:
    Jul 18, 2017
    Posts:
    1
    Hi there,

    Is there any standard Unity Materials, that can replicate the look of standard un mottled glass (like a bottle) with some refraction. At the moment there is " shader > FX > glass > StainedBumpDistort" but this has no standard smoothnes/metal settings, and seems unwieldy when trying to replicate 'normal', 'flat' glass.

    I have tried to use "fantastic glass" but this seems to throw up errors and struggles if there is more than a few bottles in the scene.

    Unreal appears to have a standard glass material by default which works really nicely, surely unity has something similar ?

    Anything like this would be great:


    Thanks
     
  2. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    Unreal has a material editor to easily create it. You can use Amplify Shader Editor to easily create it too.
    Just assign a float as refraction in Amplify Shader Editor
    photo_2017-07-26_04-56-19.jpg
    photo_2017-07-26_04-56-59.jpg
     
  3. spinning_clock

    spinning_clock

    Joined:
    Jun 22, 2015
    Posts:
    23
    Thanks for the response, these look good - will investigate further. It does seem strange that convincing glass is omitted from default unity assets after all of these unity releases, and third party plugins seem to be the only way forward.
     
  4. UnityFan18

    UnityFan18

    Joined:
    Jul 4, 2016
    Posts:
    62
    Im also looking for the exact same thing. It seems like third-part plugins are the only option. Does anyone know any good links or tutorials for adding refraction to glass in Unity?
     
  5. Pode

    Pode

    Joined:
    Nov 13, 2013
    Posts:
    145
    The problem in realtime 3D is to refract what's around the transparent geometry. If you only refract into an envmap, there's a Cg shader function for that ("refract()").
    If you want to refract the 3D around you, you need to render it onscreen without the 3D model causing the refraction.
    You will then refract into that image. That's why Unity provides the "StainedBumpDistort" shader, which is just a normal map that scramble pixel access over a GrabPass (to make it simple).