Framebuffers.cpp 779 B

123456789101112131415161718192021222324252627
  1. #include "client/rendering/Framebuffers.h"
  2. void Framebuffers::resize(const Size& size) {
  3. world.resize(size);
  4. ssao.resize(size);
  5. ssaoBlur.resize(size);
  6. shadow.resize(size);
  7. }
  8. Error Framebuffers::init(const Size& size) {
  9. Error error =
  10. world.init(size, TextureFormat::float32(3), TextureFormat::float32(3),
  11. TextureFormat::color8(4), TextureFormat::float32(1),
  12. TextureFormat::depth32(true));
  13. if(error.has()) {
  14. return error;
  15. }
  16. error = ssao.init(size, TextureFormat::float32(1));
  17. if(error.has()) {
  18. return error;
  19. }
  20. error = ssaoBlur.init(size, TextureFormat::float32(1));
  21. if(error.has()) {
  22. return error;
  23. }
  24. return shadow.init(size, TextureFormat::depth32());
  25. }