Project

General

Profile

« Previous | Next » 

Revision fe3cee39

Added by Leszek Koltunski over 7 years ago

1. Workaround for th issue that my shitty Nexus 4 crashes while compiling the vertext shader (actually the wave function)
2. Improvements to the Dynamics app

View differences:

src/main/res/raw/main_vertex_shader.glsl
462 462

  
463 463
      vec3 normal = cross(sx,sy);
464 464

  
465
      if( normal.z > 0.0 )
466
        {
467
        n.x = (n.x*normal.z + n.z*normal.x);
468
        n.y = (n.y*normal.z + n.z*normal.y);
469
        n.z = (n.z*normal.z);
470
        }
465
      if( normal.z<=0.0 )                   // Why this bizarre shit rather than the straightforward
466
        {                                   //
467
        normal.x= 0.0;                      // if( normal.z>0.0 )
468
        normal.y= 0.0;                      //   {
469
        normal.z= 1.0;                      //   n.x = (n.x*normal.z + n.z*normal.x);
470
        }                                   //   n.y = (n.y*normal.z + n.z*normal.y);
471
                                            //   n.z = (n.z*normal.z);
472
                                            //   }
473
      n.x = (n.x*normal.z + n.z*normal.x);  //
474
      n.y = (n.y*normal.z + n.z*normal.y);  // ? Because if we do the above, my shitty Nexus4 crashes
475
      n.z = (n.z*normal.z);                 // during shader compilation!
471 476
      }
472 477
    }
473 478
  }

Also available in: Unified diff