- Home /
 
 
               Question by 
               Dzugaru · Mar 19, 2012 at 03:14 PM · 
                ipadglvertexcoloripad2  
              
 
              iPad per-vertex color doesn't always work
I'm trying to draw large number (thousands) of particles with per-vertex color using GL class like this:
 void OnPostRender()
 {
 ...
 GL.PushMatrix();
 material.SetPass(0);        
 GL.LoadPixelMatrix();
 GL.Begin();
 GL.Color(...);
 GL.TexCoord2(...);
 GL.Vertex3();
 ... etc. etc.
 GL.End();
 GL.PopMatrix();
 }
 
               I've got a shader that look like this:
 ...    
 Blend One One
 BindChannels {
    Bind "Vertex", vertex
    Bind "texcoord", texcoord
    Bind "Color", color
 } 
     
 SubShader {
     Pass {
     Cull Off    
     ZTest Always                    
     Lighting Off
     ZWrite Off
     SetTexture [_MainTex] {
     combine texture * primary
 }
 }
 }
 
               It works perfectly on PC and Mac, but doesn't draw anything on iPad (primary seems to be (0,0,0,0)) in case I don't have any OBJECTS WITH TRAILS rendered right now. Basically - the moment any trail renderer appear on screen - my particles appear too.
               Comment
              
 
               
              Your answer
 
             Follow this Question
Related Questions
Cannot lower keyboard on iPad2 3 Answers
Unity Game Testing: iPad1, iPad2, or both? 2 Answers
iPad 2 and Augmented Reality? 1 Answer
How do I enable iAds on my unity game for iPhone? 0 Answers
Unity 4 Build not working on iOS 5 1 Answer