Search Unity

Glass Script

Discussion in 'Scripting' started by Kreeach, Jul 28, 2006.

  1. Kreeach

    Kreeach

    Joined:
    Jul 28, 2006
    Posts:
    6
    How do I make objects with a glass or window properties
     
  2. Darth_Vador

    Darth_Vador

    Joined:
    Jul 25, 2006
    Posts:
    13
    Just go to unifycommunity.com then go to the wiki (snipets) and click on shaders. They have a window shader their.
     
  3. jeremyace

    jeremyace

    Joined:
    Oct 12, 2005
    Posts:
    1,661
    AFAIK that shader is for simulating reflections (cube-map) in building windows as seen from outside, not semi-opaque glass.

    -Jeremy
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    There's a simple glass shader at http://unity3d.com/Documentation/Manual/SL-CullAndDepth.html. It's possible that will be enough do what you want, but you might want to get more involved with reflections and stuff for a more realistic effect. (But if you cut&paste the code there, change the first line to Shader "Simple Glass" { instead of SubShader "Simple Glass" { or else it won't work. That seems to have been a typo....)

    --Eric
     
  5. Morgan

    Morgan

    Joined:
    May 21, 2006
    Posts:
    1,223
    Is there a shader that is totally invisible except for showing specular highlights? That would be what I'd want for a glass cockpit, for instance.