Search Unity

Can't see a shader I have in my assets folder...

Discussion in 'Shaders' started by garyhaus, Jun 20, 2007.

  1. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Can someone help me? I have the Glass(unlit) shader in my assets directory, but it is not showing up as a choice in the shader list for assignment to my objects. Thanks for the help in advance.

    Gary
     
  2. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Try to reimport the shader. Does it give errors? What's the name at the start of the shader?
     
  3. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Aras,

    Thanks. I tried that... To no avail. It just doesn' t show up in the list. It does however add another Default shader. No errors.

    Gary
     
  4. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    File a bug report and attach the shader file.
     
  5. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    When you receive it the shader is in the GlassUnlit folder in the Pro Assets directory.

    Gary
     
  6. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    I did not receive any bug report with this shader, but I think I have it from your other bug report :) The problem is that the shader contains invalid characters, if you select it in Unity the inspector shows little cross signs. Currently Unity reports an empty error for this shader and Unitron displays those characters as spaces...

    Anyway, here is the fixed shader:
    Code (csharp):
    1. Shader "Window (unlit)" {
    2. Properties {
    3.     _Color ("Glass Color", Color) = (1,1,1,0.5)
    4.     _Cube ("Reflection cubemap", Cube) = "" { TexGen CubeReflect }
    5. }
    6. Category {
    7.     Tags {"Queue" = "Transparent" }
    8.     Blend SrcAlpha OneMinusSrcAlpha
    9.     ZWrite Off
    10.     BindChannels {
    11.         Bind "Vertex", vertex
    12.         Bind "Normal", normal
    13.     }
    14.     // cards with cube maps
    15.     SubShader {
    16.         Pass {
    17.             SetTexture [_Cube] {
    18.                 constantColor [_Color]
    19.                 combine texture * constant, constant
    20.             }
    21.         }
    22.     }
    23.     // cards without cube maps - just simple transparency
    24.     SubShader {
    25.         Pass {
    26.             SetTexture [_Dummy] {
    27.                 constantColor [_Color]
    28.                 combine constant
    29.             }
    30.         }
    31.     }
    32. }
    33. }
     
  7. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    Aras,

    Thank you!!!!

    Gary