render_scene_buffers_gles3.h 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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_gl.h"
  35. class RenderSceneBuffersGLES3 : public RenderSceneBuffers {
  36. GDCLASS(RenderSceneBuffersGLES3, RenderSceneBuffers);
  37. public:
  38. // Original implementation, need to investigate which ones we'll keep like this and what we'll change...
  39. int internal_width = 0;
  40. int internal_height = 0;
  41. int width = 0;
  42. int height = 0;
  43. //float fsr_sharpness = 0.2f;
  44. RS::ViewportMSAA msaa = RS::VIEWPORT_MSAA_DISABLED;
  45. //RS::ViewportScreenSpaceAA screen_space_aa = RS::VIEWPORT_SCREEN_SPACE_AA_DISABLED;
  46. //bool use_debanding = false;
  47. uint32_t view_count = 1;
  48. RID render_target;
  49. //built-in textures used for ping pong image processing and blurring
  50. struct Blur {
  51. RID texture;
  52. struct Mipmap {
  53. RID texture;
  54. int width;
  55. int height;
  56. GLuint fbo;
  57. };
  58. Vector<Mipmap> mipmaps;
  59. };
  60. Blur blur[2]; //the second one starts from the first mipmap
  61. private:
  62. public:
  63. virtual ~RenderSceneBuffersGLES3();
  64. virtual void configure(const RenderSceneBuffersConfiguration *p_config) override;
  65. virtual void set_fsr_sharpness(float p_fsr_sharpness) override{};
  66. virtual void set_texture_mipmap_bias(float p_texture_mipmap_bias) override{};
  67. virtual void set_use_debanding(bool p_use_debanding) override{};
  68. void free_render_buffer_data();
  69. };
  70. #endif // GLES3_ENABLED
  71. #endif // RENDER_SCENE_BUFFERS_GLES3_H