daily pastebin goal
29%
SHARE
TWEET

Untitled

a guest Jan 17th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Luminca punctiforma
  2. int start_punctiforma = 0;
  3. glm::vec3 lightPos1;
  4. GLuint lightPos1Loc;
  5.  
  6. //SPOT LIGHT
  7. float flashLightCutoff1;
  8. float flashLightCutoff2;
  9. int start_spotlight = 0;
  10. glm::vec3 flashLightDirection;
  11. glm::vec3 flashLightPosition;
  12. //SPOT LIGHT
  13. ___________________________________________________________________________________
  14. //LUMINA PUNCTIFORMA - START
  15.     if (glfwGetKey(glWindow, GLFW_KEY_V) == GLFW_PRESS)
  16.     {
  17.         myCustomShader.useShaderProgram();
  18.         start_punctiforma = 1;
  19.         glUniform1i(glGetUniformLocation(myCustomShader.shaderProgram, "start_punctiforma"), start_punctiforma);
  20.     }
  21.     //LUMINA PUNCTIFORMA - STOP
  22.     if (glfwGetKey(glWindow, GLFW_KEY_B) == GLFW_PRESS)
  23.     {
  24.         myCustomShader.useShaderProgram();
  25.         start_punctiforma = 0;
  26.         glUniform1i(glGetUniformLocation(myCustomShader.shaderProgram, "start_punctiforma"), start_punctiforma);
  27.     }
  28.  
  29.  
  30.     //LUMINA SPOTLIGHT - START
  31.     if (glfwGetKey(glWindow, GLFW_KEY_N) == GLFW_PRESS)
  32.     {
  33.         myCustomShader.useShaderProgram();
  34.         start_spotlight = 1;
  35.         glUniform1i(glGetUniformLocation(myCustomShader.shaderProgram, "start_spotlight"), start_spotlight);
  36.     }
  37.     //LUMINA SPOTLIGHT - STOP
  38.     if (glfwGetKey(glWindow, GLFW_KEY_M) == GLFW_PRESS)
  39.     {
  40.         myCustomShader.useShaderProgram();
  41.         start_spotlight = 0;
  42.         glUniform1i(glGetUniformLocation(myCustomShader.shaderProgram, "start_spotlight"), start_spotlight);
  43.     }
  44.  
  45. ____________________________________________
  46.  
  47. //LUMINA PUNCTIFORMA
  48.     lightPos1 = glm::vec3(3.0f, -1.0f, -15.0f);//coordonate lumina punctiforma
  49.     lightPos1Loc = glGetUniformLocation(myCustomShader.shaderProgram, "lightPos1");
  50.     glUniform3fv(lightPos1Loc, 1, glm::value_ptr(lightPos1));
  51.  
  52.  
  53.     //LUMINA SPOT
  54.     flashLightCutoff1 = glm::cos(glm::radians(40.5f));
  55.     flashLightCutoff2 = glm::cos(glm::radians(100.5f));
  56.  
  57.     flashLightDirection = glm::vec3(0, -1, 0);
  58.     flashLightPosition = glm::vec3(-20.0f, 0.0f, 4.0f);//coordonate lumina spotlight
  59.  
  60.     glUniform1f(glGetUniformLocation(myCustomShader.shaderProgram, "flashLightCutoff1"), flashLightCutoff1);
  61.     glUniform1f(glGetUniformLocation(myCustomShader.shaderProgram, "flashLightCutoff2"), flashLightCutoff2);
  62.  
  63.     glUniform3fv(glGetUniformLocation(myCustomShader.shaderProgram, "flashLightDirection"), 1, glm::value_ptr(flashLightDirection));
  64.     glUniform3fv(glGetUniformLocation(myCustomShader.shaderProgram, "flashLightPosition"), 1, glm::value_ptr(flashLightPosition));
  65.     //LUMINA SPOT
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top