diff options
author | clayjohn <claynjohn@gmail.com> | 2022-11-10 12:07:54 -0800 |
---|---|---|
committer | clayjohn <claynjohn@gmail.com> | 2022-11-10 12:47:26 -0800 |
commit | 8e41221404359dafad69f09be138e6c2dfebd373 (patch) | |
tree | c576def8f80fa0ba13af8906448e95a08b3ce793 /servers/rendering/renderer_rd/effects/copy_effects.h | |
parent | e25d9281d4f6f0b5b4d972b25cddaa1009ad1d26 (diff) |
Use raster versions of copy effects for 2D operations when using the mobile renderer
This PR implements a few basic copy operations in raster that weren't available before
Diffstat (limited to 'servers/rendering/renderer_rd/effects/copy_effects.h')
-rw-r--r-- | servers/rendering/renderer_rd/effects/copy_effects.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/servers/rendering/renderer_rd/effects/copy_effects.h b/servers/rendering/renderer_rd/effects/copy_effects.h index 0ddb60ebef..cda4f70730 100644 --- a/servers/rendering/renderer_rd/effects/copy_effects.h +++ b/servers/rendering/renderer_rd/effects/copy_effects.h @@ -63,6 +63,8 @@ private: BLUR_MODE_GAUSSIAN_GLOW_AUTO_EXPOSURE, BLUR_MODE_COPY, + BLUR_MODE_SET_COLOR, + BLUR_MODE_MAX }; @@ -174,6 +176,8 @@ private: COPY_TO_FB_MULTIVIEW, COPY_TO_FB_MULTIVIEW_WITH_DEPTH, + + COPY_TO_FB_SET_COLOR, COPY_TO_FB_MAX, }; @@ -186,7 +190,9 @@ private: uint32_t force_luminance; uint32_t alpha_to_zero; uint32_t srgb; - uint32_t pad; + uint32_t alpha_to_one; + + float set_color[4]; }; struct CopyToFb { @@ -316,11 +322,12 @@ public: void copy_cubemap_to_panorama(RID p_source_cube, RID p_dest_panorama, const Size2i &p_panorama_size, float p_lod, bool p_is_array); void copy_depth_to_rect(RID p_source_rd_texture, RID p_dest_framebuffer, const Rect2i &p_rect, bool p_flip_y = false); void copy_depth_to_rect_and_linearize(RID p_source_rd_texture, RID p_dest_texture, const Rect2i &p_rect, bool p_flip_y, float p_z_near, float p_z_far); - void copy_to_fb_rect(RID p_source_rd_texture, RID p_dest_framebuffer, const Rect2i &p_rect, bool p_flip_y = false, bool p_force_luminance = false, bool p_alpha_to_zero = false, bool p_srgb = false, RID p_secondary = RID(), bool p_multiview = false); + void copy_to_fb_rect(RID p_source_rd_texture, RID p_dest_framebuffer, const Rect2i &p_rect, bool p_flip_y = false, bool p_force_luminance = false, bool p_alpha_to_zero = false, bool p_srgb = false, RID p_secondary = RID(), bool p_multiview = false, bool alpha_to_one = false); void copy_to_atlas_fb(RID p_source_rd_texture, RID p_dest_framebuffer, const Rect2 &p_uv_rect, RD::DrawListID p_draw_list, bool p_flip_y = false, bool p_panorama = false); void copy_raster(RID p_source_texture, RID p_dest_framebuffer); void gaussian_blur(RID p_source_rd_texture, RID p_texture, const Rect2i &p_region, bool p_8bit_dst = false); + void gaussian_blur_raster(RID p_source_rd_texture, RID p_dest_texture, const Rect2i &p_region, const Size2i &p_size); void gaussian_glow(RID p_source_rd_texture, RID p_back_texture, const Size2i &p_size, float p_strength = 1.0, bool p_high_quality = false, bool p_first_pass = false, float p_luminance_cap = 16.0, float p_exposure = 1.0, float p_bloom = 0.0, float p_hdr_bleed_threshold = 1.0, float p_hdr_bleed_scale = 1.0, RID p_auto_exposure = RID(), float p_auto_exposure_scale = 1.0); void gaussian_glow_raster(RID p_source_rd_texture, RID p_half_texture, RID p_dest_texture, float p_luminance_multiplier, const Size2i &p_size, float p_strength = 1.0, bool p_high_quality = false, bool p_first_pass = false, float p_luminance_cap = 16.0, float p_exposure = 1.0, float p_bloom = 0.0, float p_hdr_bleed_threshold = 1.0, float p_hdr_bleed_scale = 1.0, RID p_auto_exposure = RID(), float p_auto_exposure_scale = 1.0); @@ -328,6 +335,7 @@ public: void make_mipmap_raster(RID p_source_rd_texture, RID p_dest_texture, const Size2i &p_size); void set_color(RID p_dest_texture, const Color &p_color, const Rect2i &p_region, bool p_8bit_dst = false); + void set_color_raster(RID p_dest_texture, const Color &p_color, const Rect2i &p_region); void copy_cubemap_to_dp(RID p_source_rd_texture, RID p_dst_framebuffer, const Rect2 &p_rect, const Vector2 &p_dst_size, float p_z_near, float p_z_far, bool p_dp_flip); void cubemap_downsample(RID p_source_cubemap, RID p_dest_cubemap, const Size2i &p_size); |