x


Mobile controlled transparency shader

I'm pretty new to any shader or programming. So my issue is, i had done following shader:

 Shader "Mobile/Background A" {
 Properties {
 _MainTex ("Base (RGB)", 2D) = "white" {}
 _Alpha("_Alpha", Float) = 1
 }

 SubShader {
 Tags {"Queue" = "Background" }
        Material { }
        Lighting Off
        Zwrite off

 CGPROGRAM
 #pragma surface surf Lambert alpha

 sampler2D _MainTex;
 fixed _Alpha;

 struct Input {
 fixed2 uv_MainTex;
 };

 void surf (Input IN, inout SurfaceOutput o) {
 fixed4 c = tex2D(_MainTex, IN.uv_MainTex);
 o.Albedo = c;
 o.Alpha = _Alpha;
 }
 ENDCG
 }

 Fallback "Diffuse"
 }

It is not fast enough. Is there any obvious mistakes that i made?

WBR.

more ▼

asked Jan 11 '12 at 02:15 PM

Reijin gravatar image

Reijin
61 2 2 2

(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:

x1963
x1655
x413

asked: Jan 11 '12 at 02:15 PM

Seen: 642 times

Last Updated: Jan 11 '12 at 02:15 PM