private static void setUpShaders() {
   perPixelShaderProgram =
       ShaderLoader.loadShaderPair(
           VERTEX_SHADER_PER_PIXEL_LIGHTING_LOCATION, FRAGMENT_SHADER_PER_PIXEL_LIGHTING_LOCATION);
   perVertexShaderProgram =
       ShaderLoader.loadShaderPair(
           VERTEX_SHADER_PER_VERTEX_LIGHTING_LOCATION,
           FRAGMENT_SHADER_PER_VERTEX_LIGHTING_LOCATION);
   currentShaderProgram = perPixelShaderProgram;
 }
Ejemplo n.º 2
0
 private static void setUpShaders() {
   shaderProgram = ShaderLoader.loadShaderPair(VERTEX_SHADER_LOCATION, FRAGMENT_SHADER_LOCATION);
   attributeVertex = glGetAttribLocation(shaderProgram, "attributeVertex");
   attributeColour = glGetAttribLocation(shaderProgram, "attributeColour");
   attributeNormal = glGetAttribLocation(shaderProgram, "attributeNormal");
   uniformAmbientLight = glGetUniformLocation(shaderProgram, "uniformAmbientLight");
   uniformLightPosition = glGetUniformLocation(shaderProgram, "uniformLightPosition");
   uniformModelViewMatrix = glGetUniformLocation(shaderProgram, "uniformModelViewMatrix");
   uniformModelViewProjectionMatrix =
       glGetUniformLocation(shaderProgram, "uniformModelViewProjectionMatrix");
   uniformNormalMatrix = glGetUniformLocation(shaderProgram, "uniformNormalMatrix");
   uniformShininess = glGetUniformLocation(shaderProgram, "uniformShininess");
   glValidateProgram(shaderProgram);
 }