Quantcast
Channel: Questions in topic: "unity3.5"
Viewing all articles
Browse latest Browse all 122

AlphaTest shader work slowly in Unity3.5?

$
0
0
Hey guys, last day I upgrade my unity to the version 3.5(from 3.4), but my projects performance on iPhone become very slowly since a shader is not working efficiently, it is very simple code to implement a shader with **ZWrite** and **AlphaTest**, I don't know why if I change the code "AlphaTest Greater [_Cutoff]" to "Blend SrcAlpha OneMinusSrcAlpha", then the fps change from 30 to 50, my scene contains about 100 objects which have the same texture and alpha channel. In unity3.4, my shader's performance is OK but, I want to know if there exist any change about transparent/particles shader in version 3.5, or what is the best way to implement an efficiently transparent shader? Here is my code: Shader "Custom/Alpha" { Properties { _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} _Cutoff ("Base Alpha cutoff", Range (0,.9)) = .5 } Category { BindChannels { Bind "Color", color Bind "Vertex", vertex Bind "TexCoord", texcoord } ZWrite On SubShader { Pass { AlphaTest Greater [_Cutoff] // this line cause my scene very slow //Blend SrcAlpha OneMinusSrcAlpha SetTexture [_MainTex] { combine texture } } } } }

Viewing all articles
Browse latest Browse all 122

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>