x


Transparent Reflective

I found similar questions answered already, however what I like to implement is a little bit different.I want to create a transparent reflective shader where I can control the transparency + reflection with a texture (instead of a color value) Here's my shader,

Shader "myshader" { Properties { _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} _Cube ("Cubemap", CUBE) = "" {} } SubShader { Tags {"Queue"="transparent" "RenderType"="transparent" }

    Cull Off

    CGPROGRAM
    #pragma surface surf Lambert alpha



    struct Input 
    {
        float3 worldRefl;
        float4 _MainTex;
    };

    samplerCUBE _Cube;
    float4 _MainTex;

    void surf (Input IN, inout SurfaceOutput o) {
        o.Albedo = _MainTex.rgb;
        o.Emission = texCUBE (_Cube, IN.worldRefl).rgb*_MainTex.a;
        o.Alpha = _MainTex.a;
    }
    ENDCG
} 
FallBack "Transparent/Diffuse"

}

which isn't working, no error messages though

ANY help greatly appreciated, Thank You!

more ▼

asked May 01 '11 at 09:18 AM

user-12247 (google) gravatar image

user-12247 (google)
1 1 1 1

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1660
x178
x20

asked: May 01 '11 at 09:18 AM

Seen: 997 times

Last Updated: May 01 '11 at 09:18 AM