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
31#ifndef RENDER_SCENE_BUFFERS_GLES3_H
32#define RENDER_SCENE_BUFFERS_GLES3_H
33
34#ifdef GLES3_ENABLED
35
36#include "servers/rendering/storage/render_scene_buffers.h"
37
38#include "platform_config.h"
39#ifndef OPENGL_INCLUDE_H
40#include <GLES3/gl3.h>
41#else
42#include OPENGL_INCLUDE_H
43#endif
44
45class RenderSceneBuffersGLES3 : public RenderSceneBuffers {
46 GDCLASS(RenderSceneBuffersGLES3, RenderSceneBuffers);
47
48public:
49 // Original implementation, need to investigate which ones we'll keep like this and what we'll change...
50
51 int internal_width = 0;
52 int internal_height = 0;
53 int width = 0;
54 int height = 0;
55 //float fsr_sharpness = 0.2f;
56 RS::ViewportMSAA msaa = RS::VIEWPORT_MSAA_DISABLED;
57 //RS::ViewportScreenSpaceAA screen_space_aa = RS::VIEWPORT_SCREEN_SPACE_AA_DISABLED;
58 //bool use_debanding = false;
59 uint32_t view_count = 1;
60
61 RID render_target;
62
63 //built-in textures used for ping pong image processing and blurring
64 struct Blur {
65 RID texture;
66
67 struct Mipmap {
68 RID texture;
69 int width;
70 int height;
71 GLuint fbo;
72 };
73
74 Vector<Mipmap> mipmaps;
75 };
76
77 Blur blur[2]; //the second one starts from the first mipmap
78
79private:
80public:
81 virtual ~RenderSceneBuffersGLES3();
82 virtual void configure(const RenderSceneBuffersConfiguration *p_config) override;
83
84 virtual void set_fsr_sharpness(float p_fsr_sharpness) override{};
85 virtual void set_texture_mipmap_bias(float p_texture_mipmap_bias) override{};
86 virtual void set_use_debanding(bool p_use_debanding) override{};
87
88 void free_render_buffer_data();
89};
90
91#endif // GLES3_ENABLED
92
93#endif // RENDER_SCENE_BUFFERS_GLES3_H
94