summaryrefslogtreecommitdiff
path: root/drivers/gles3/effects/copy_effects.cpp
diff options
context:
space:
mode:
authorclayjohn <claynjohn@gmail.com>2022-11-07 22:40:03 -0800
committerclayjohn <claynjohn@gmail.com>2022-11-14 23:28:25 -0800
commit9ce57050a5d12776deedd44fcb82dd5841a56686 (patch)
treea078f43091d787f0d985ee5c1a950fc0962eeaab /drivers/gles3/effects/copy_effects.cpp
parent98e0d599529aee2b090d84acbd9aaa28572c0da8 (diff)
Add GPUParticles to the OpenGL3 renderer.
This includes collision (2D SDF, Box, Sphere, Heightmap), attraction (Box, Sphere), and all sorting modes. This does not include 3D SDF collisions, trails, or manual emission.
Diffstat (limited to 'drivers/gles3/effects/copy_effects.cpp')
-rw-r--r--drivers/gles3/effects/copy_effects.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/gles3/effects/copy_effects.cpp b/drivers/gles3/effects/copy_effects.cpp
index 3acbcf6b53..b552b52cd5 100644
--- a/drivers/gles3/effects/copy_effects.cpp
+++ b/drivers/gles3/effects/copy_effects.cpp
@@ -115,13 +115,21 @@ CopyEffects::~CopyEffects() {
}
void CopyEffects::copy_to_rect(const Rect2 &p_rect) {
- copy.shader.version_bind_shader(copy.shader_version, CopyShaderGLES3::MODE_COPY_SECTION);
+ bool success = copy.shader.version_bind_shader(copy.shader_version, CopyShaderGLES3::MODE_COPY_SECTION);
+ if (!success) {
+ return;
+ }
+
copy.shader.version_set_uniform(CopyShaderGLES3::COPY_SECTION, p_rect.position.x, p_rect.position.y, p_rect.size.x, p_rect.size.y, copy.shader_version, CopyShaderGLES3::MODE_COPY_SECTION);
draw_screen_quad();
}
void CopyEffects::copy_screen() {
- copy.shader.version_bind_shader(copy.shader_version, CopyShaderGLES3::MODE_DEFAULT);
+ bool success = copy.shader.version_bind_shader(copy.shader_version, CopyShaderGLES3::MODE_DEFAULT);
+ if (!success) {
+ return;
+ }
+
draw_screen_triangle();
}
@@ -151,7 +159,11 @@ void CopyEffects::bilinear_blur(GLuint p_source_texture, int p_mipmap_count, con
}
void CopyEffects::set_color(const Color &p_color, const Rect2i &p_region) {
- copy.shader.version_bind_shader(copy.shader_version, CopyShaderGLES3::MODE_SIMPLE_COLOR);
+ bool success = copy.shader.version_bind_shader(copy.shader_version, CopyShaderGLES3::MODE_SIMPLE_COLOR);
+ if (!success) {
+ return;
+ }
+
copy.shader.version_set_uniform(CopyShaderGLES3::COPY_SECTION, p_region.position.x, p_region.position.y, p_region.size.x, p_region.size.y, copy.shader_version, CopyShaderGLES3::MODE_SIMPLE_COLOR);
copy.shader.version_set_uniform(CopyShaderGLES3::COLOR_IN, p_color, copy.shader_version, CopyShaderGLES3::MODE_SIMPLE_COLOR);
draw_screen_quad();