Advertisement
arxeiss

Untitled

Apr 19th, 2017
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. // demo10.cpp
  2. uniform = glGetUniformLocation(ss->m_activeShader->m_programObject, "CameraPosition");
  3.     glUniformMatrix3fv(uniform, 1, GL_FALSE, (float*)&ss->m_activeCamera->getPosition()[0]);
  4.  
  5. // shader
  6. float GetTessLevel(float distance0, float distance1)
  7. {
  8.     //3. some logic based on distances
  9.     float avgDst = (distance0 + distance1) / 2.0f;     
  10.     if(avgDst > 0.5){
  11.         return 1;
  12.     }else if(avgDst > 0.2){
  13.         return 2;
  14.     }else{
  15.         return 3;
  16.     }
  17. }
  18.  
  19. float d0 = distance(CameraPosition, wcPosition[0]);
  20. gl_TessLevelOuter[0] = GetTessLevel(d1, d2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement