diff options
author | clayjohn <claynjohn@gmail.com> | 2020-03-19 17:32:19 -0700 |
---|---|---|
committer | clayjohn <claynjohn@gmail.com> | 2020-03-21 20:43:44 -0700 |
commit | 61a74739ca2d201e7e057d85aa99ae68f0500c33 (patch) | |
tree | 73f170a76bb138f01d2df825798d6c4109b81cc8 /servers/visual/rasterizer_rd/rasterizer_effects_rd.h | |
parent | c3fee7ba6cdefd285255b9e1198bc1fdf585b1ac (diff) |
Working sky shader implementation
Diffstat (limited to 'servers/visual/rasterizer_rd/rasterizer_effects_rd.h')
-rw-r--r-- | servers/visual/rasterizer_rd/rasterizer_effects_rd.h | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/servers/visual/rasterizer_rd/rasterizer_effects_rd.h b/servers/visual/rasterizer_rd/rasterizer_effects_rd.h index ab4aa58ce0..562a7b674b 100644 --- a/servers/visual/rasterizer_rd/rasterizer_effects_rd.h +++ b/servers/visual/rasterizer_rd/rasterizer_effects_rd.h @@ -115,12 +115,6 @@ class RasterizerEffectsRD { } blur; - enum CubemapRoughnessSource { - CUBEMAP_ROUGHNESS_SOURCE_PANORAMA, - CUBEMAP_ROUGHNESS_SOURCE_CUBEMAP, - CUBEMAP_ROUGHNESS_SOURCE_MAX - }; - struct CubemapRoughnessPushConstant { uint32_t face_id; uint32_t sample_count; @@ -135,7 +129,7 @@ class RasterizerEffectsRD { CubemapRoughnessPushConstant push_constant; CubemapRoughnessShaderRD shader; RID shader_version; - RID pipelines[CUBEMAP_ROUGHNESS_SOURCE_MAX]; + RID pipeline; } roughness; enum TonemapMode { @@ -341,12 +335,6 @@ class RasterizerEffectsRD { } roughness_limiter; - enum CubemapDownsamplerSource { - CUBEMAP_DOWNSAMPLER_SOURCE_PANORAMA, - CUBEMAP_DOWNSAMPLER_SOURCE_CUBEMAP, - CUBEMAP_DOWNSAMPLER_SOURCE_MAX - }; - struct CubemapDownsamplerPushConstant { uint32_t face_size; float pad[3]; @@ -357,7 +345,7 @@ class RasterizerEffectsRD { CubemapDownsamplerPushConstant push_constant; CubemapDownsamplerShaderRD shader; RID shader_version; - RID pipelines[CUBEMAP_DOWNSAMPLER_SOURCE_MAX]; + RID pipeline; } cubemap_downsampler; @@ -381,6 +369,15 @@ class RasterizerEffectsRD { } filter; + struct SkyPushConstant { + float orientation[12]; + float proj[4]; + float position[3]; + float multiplier; + float time; + float pad[3]; + }; + RID default_sampler; RID default_mipmap_sampler; RID index_buffer; @@ -403,7 +400,7 @@ public: void gaussian_blur(RID p_source_rd_texture, RID p_framebuffer_half, RID p_rd_texture_half, RID p_dest_framebuffer, const Vector2 &p_pixel_size, const Rect2 &p_region); void gaussian_glow(RID p_source_rd_texture, RID p_framebuffer_half, RID p_rd_texture_half, RID p_dest_framebuffer, const Vector2 &p_pixel_size, float p_strength = 1.0, 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_treshold = 1.0, float p_hdr_bleed_scale = 1.0, RID p_auto_exposure = RID(), float p_auto_exposure_grey = 1.0); - void cubemap_roughness(RID p_source_rd_texture, bool p_source_is_panorama, RID p_dest_framebuffer, uint32_t p_face_id, uint32_t p_sample_count, float p_roughness, float p_size); + void cubemap_roughness(RID p_source_rd_texture, RID p_dest_framebuffer, uint32_t p_face_id, uint32_t p_sample_count, float p_roughness, float p_size); void make_mipmap(RID p_source_rd_texture, RID p_framebuffer_half, const Vector2 &p_pixel_size); void copy_cubemap_to_dp(RID p_source_rd_texture, RID p_dest_framebuffer, const Rect2 &p_rect, float p_z_near, float p_z_far, float p_bias, bool p_dp_flip); void luminance_reduction(RID p_source_texture, const Size2i p_source_size, const Vector<RID> p_reduce, RID p_prev_luminance, float p_min_luminance, float p_max_luminance, float p_adjust, bool p_set = false); @@ -449,8 +446,9 @@ public: void generate_ssao(RID p_depth_buffer, RID p_normal_buffer, const Size2i &p_depth_buffer_size, RID p_depth_mipmaps_texture, const Vector<RID> &depth_mipmaps, RID p_ao1, bool p_half_size, RID p_ao2, RID p_upscale_buffer, float p_intensity, float p_radius, float p_bias, const CameraMatrix &p_projection, VS::EnvironmentSSAOQuality p_quality, VS::EnvironmentSSAOBlur p_blur, float p_edge_sharpness); void roughness_limit(RID p_source_normal, RID p_roughness, const Size2i &p_size, float p_curve); - void cubemap_downsample(RID p_source_cubemap, bool p_source_is_panorama, RID p_dest_cubemap, const Size2i &p_size); + void cubemap_downsample(RID p_source_cubemap, RID p_dest_cubemap, const Size2i &p_size); void cubemap_filter(RID p_source_cubemap, Vector<RID> p_dest_cubemap, bool p_use_array); + void render_sky(RD::DrawListID p_list, float p_time, RID p_fb, RID p_samplers, RID p_lights, RenderPipelineVertexFormatCacheRD *p_pipeline, RID p_uniform_set, RID p_texture_set, const CameraMatrix &p_camera, const Basis &p_orientation, float p_multiplier, const Vector3 &p_position); RasterizerEffectsRD(); ~RasterizerEffectsRD(); |