Framebuffers.cpp 936 B

1234567891011121314151617181920212223242526272829
  1. #include "client/rendering/Framebuffers.h"
  2. Framebuffers::Framebuffers(const WindowSize& size) :
  3. world(size, Framebuffer::POSITION | Framebuffer::NORMAL | Framebuffer::COLOR | Framebuffer::RED | Framebuffer::DEPTH),
  4. ssao(size, Framebuffer::RED),
  5. ssaoBlur(size, Framebuffer::RED),
  6. shadow(size, Framebuffer::DEPTH),
  7. antialias(size, Framebuffer::COLOR) {
  8. }
  9. void Framebuffers::resize(uint width, uint height) {
  10. world.resize(width, height);
  11. ssao.resize(width, height);
  12. ssaoBlur.resize(width, height);
  13. shadow.resize(width, height);
  14. antialias.resize(width, height);
  15. }
  16. bool Framebuffers::hasError() const {
  17. return world.hasError() || ssao.hasError() || ssaoBlur.hasError() || shadow.hasError() || antialias.hasError();
  18. }
  19. void Framebuffers::setFactor(int factor) {
  20. world.setFactor(factor);
  21. ssao.setFactor(factor);
  22. ssaoBlur.setFactor(factor);
  23. shadow.setFactor(factor);
  24. antialias.setFactor(factor);
  25. }