Advertisement
ShaXbee

filtrowanie tekstur

Sep 10th, 2014
465
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. void TTexturesManager::SetFiltering(int filter)
  2. {
  3. if (filter<4) //rozmycie przy powiêkszeniu
  4. {//brak rozmycia z bliska - tych jest 4: 0..3, aby nie by³o przeskoku
  5. glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
  6. filter+=4;
  7. }
  8. else
  9. glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
  10. switch (filter) //rozmycie przy oddaleniu
  11. {case 4: //najbli¿szy z tekstury
  12. glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); break;
  13. case 5: //œrednia z tekstury
  14. glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); break;
  15. case 6: //najbli¿szy z mipmapy
  16. glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST_MIPMAP_NEAREST); break;
  17. case 7: //œrednia z mipmapy
  18. glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST); break;
  19. case 8: //najbli¿szy z dwóch mipmap
  20. glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST_MIPMAP_LINEAR); break;
  21. case 9: //œrednia z dwóch mipmap
  22. glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR); break;
  23. }
  24. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement