Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // demo10.cpp
- uniform = glGetUniformLocation(ss->m_activeShader->m_programObject, "CameraPosition");
- glUniformMatrix3fv(uniform, 1, GL_FALSE, (float*)&ss->m_activeCamera->getPosition()[0]);
- // shader
- float GetTessLevel(float distance0, float distance1)
- {
- //3. some logic based on distances
- float avgDst = (distance0 + distance1) / 2.0f;
- if(avgDst > 0.5){
- return 1;
- }else if(avgDst > 0.2){
- return 2;
- }else{
- return 3;
- }
- }
- float d0 = distance(CameraPosition, wcPosition[0]);
- gl_TessLevelOuter[0] = GetTessLevel(d1, d2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement