- Home /
 
               Question by 
               dr-electro · May 16, 2012 at 12:20 PM · 
                shaderioscg  
              
 
              Multiple tex2D commands in fragment shader needed, is there a workaround?
Hi. I have to use multiple tex2D commands in my fragment shader, to make use of multiple uv-sets. Unfortunately this heavily decreases the framerate on my iPod 4G (30fps down to 23fps with just 1 additional tex2D call).
This is a simplified version of my fragment shader (still causing the speed issues):
        v2f vert (appdata v)
         {
             v2f o;
             o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
             
             o.uv1 = v.texcoord;
             o.uv2 = v.texcoord1;
             
             return o;
         
         }
 
         half4 frag (v2f i) : COLOR
         {
            half4 tex = tex2D (_MainTex, i.uv1);
             half4 texcol2 = tex2D (_MainTex, i.uv2);
                                                                                               
             return tex + texcol2;
         }
is there anything i can do to achieve a better performance for this shader (without using fixed function)? Thanks!
               Comment
              
 
               
              Your answer
 
 
             Follow this Question
Related Questions
Shader fails on iOS 0 Answers
Why does this IOS / OGLES shader not match PC version? 0 Answers
Shader no longer working on iOS 1 Answer
How to force the compilation of a shader in Unity? 5 Answers
What rules govern backface culling on IOS hardware? 0 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                