render_scene_buffers_gles3.h 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /**************************************************************************/
  2. /* render_scene_buffers_gles3.h */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #ifndef RENDER_SCENE_BUFFERS_GLES3_H
  31. #define RENDER_SCENE_BUFFERS_GLES3_H
  32. #ifdef GLES3_ENABLED
  33. #include "servers/rendering/storage/render_scene_buffers.h"
  34. #include "platform_config.h"
  35. #ifndef OPENGL_INCLUDE_H
  36. #include <GLES3/gl3.h>
  37. #else
  38. #include OPENGL_INCLUDE_H
  39. #endif
  40. class RenderSceneBuffersGLES3 : public RenderSceneBuffers {
  41. GDCLASS(RenderSceneBuffersGLES3, RenderSceneBuffers);
  42. public:
  43. // Original implementation, need to investigate which ones we'll keep like this and what we'll change...
  44. int internal_width = 0;
  45. int internal_height = 0;
  46. int width = 0;
  47. int height = 0;
  48. //float fsr_sharpness = 0.2f;
  49. RS::ViewportMSAA msaa = RS::VIEWPORT_MSAA_DISABLED;
  50. //RS::ViewportScreenSpaceAA screen_space_aa = RS::VIEWPORT_SCREEN_SPACE_AA_DISABLED;
  51. //bool use_debanding = false;
  52. uint32_t view_count = 1;
  53. RID render_target;
  54. //built-in textures used for ping pong image processing and blurring
  55. struct Blur {
  56. RID texture;
  57. struct Mipmap {
  58. RID texture;
  59. int width;
  60. int height;
  61. GLuint fbo;
  62. };
  63. Vector<Mipmap> mipmaps;
  64. };
  65. Blur blur[2]; //the second one starts from the first mipmap
  66. private:
  67. public:
  68. virtual ~RenderSceneBuffersGLES3();
  69. virtual void configure(RID p_render_target, const Size2i p_internal_size, const Size2i p_target_size, RS::ViewportScaling3DMode p_scaling_3d_mode, float p_fsr_sharpness, float p_texture_mipmap_bias, RS::ViewportMSAA p_msaa, RenderingServer::ViewportScreenSpaceAA p_screen_space_aa, bool p_use_taa, bool p_use_debanding, uint32_t p_view_count) override;
  70. virtual void set_fsr_sharpness(float p_fsr_sharpness) override{};
  71. virtual void set_texture_mipmap_bias(float p_texture_mipmap_bias) override{};
  72. virtual void set_use_debanding(bool p_use_debanding) override{};
  73. void free_render_buffer_data();
  74. };
  75. #endif // GLES3_ENABLED
  76. #endif // RENDER_SCENE_BUFFERS_GLES3_H