diff options
Diffstat (limited to 'servers/rendering')
-rw-r--r-- | servers/rendering/rasterizer_dummy.h | 11 | ||||
-rw-r--r-- | servers/rendering/renderer_canvas_render.h | 2 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/renderer_canvas_render_rd.h | 2 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp | 3 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/renderer_scene_gi_rd.h | 6 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/renderer_storage_rd.cpp | 57 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/renderer_storage_rd.h | 12 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/shaders/gi.glsl | 27 | ||||
-rw-r--r-- | servers/rendering/renderer_scene.h | 2 | ||||
-rw-r--r-- | servers/rendering/renderer_scene_cull.cpp | 34 | ||||
-rw-r--r-- | servers/rendering/renderer_scene_cull.h | 4 | ||||
-rw-r--r-- | servers/rendering/renderer_scene_occlusion_cull.cpp | 2 | ||||
-rw-r--r-- | servers/rendering/renderer_storage.h | 9 | ||||
-rw-r--r-- | servers/rendering/renderer_viewport.cpp | 17 | ||||
-rw-r--r-- | servers/rendering/renderer_viewport.h | 10 | ||||
-rw-r--r-- | servers/rendering/rendering_server_default.cpp | 26 | ||||
-rw-r--r-- | servers/rendering/rendering_server_default.h | 39 |
17 files changed, 33 insertions, 230 deletions
diff --git a/servers/rendering/rasterizer_dummy.h b/servers/rendering/rasterizer_dummy.h index bc5aae2b48..3d4cca3586 100644 --- a/servers/rendering/rasterizer_dummy.h +++ b/servers/rendering/rasterizer_dummy.h @@ -225,7 +225,6 @@ public: } void texture_2d_layered_initialize(RID p_texture, const Vector<Ref<Image>> &p_layers, RS::TextureLayeredType p_layered_type) override {} - void texture_2d_update_immediate(RID p_texture, const Ref<Image> &p_image, int p_layer = 0) override {} void texture_2d_update(RID p_texture, const Ref<Image> &p_image, int p_layer = 0) override {} void texture_3d_initialize(RID p_texture, Image::Format, int p_width, int p_height, int p_depth, bool p_mipmaps, const Vector<Ref<Image>> &p_data) override {} void texture_3d_update(RID p_texture, const Vector<Ref<Image>> &p_data) override {} @@ -406,10 +405,8 @@ public: void light_directional_set_shadow_mode(RID p_light, RS::LightDirectionalShadowMode p_mode) override {} void light_directional_set_blend_splits(RID p_light, bool p_enable) override {} bool light_directional_get_blend_splits(RID p_light) const override { return false; } - void light_directional_set_shadow_depth_range_mode(RID p_light, RS::LightDirectionalShadowDepthRangeMode p_range_mode) override {} void light_directional_set_sky_only(RID p_light, bool p_sky_only) override {} bool light_directional_is_sky_only(RID p_light) const override { return false; } - RS::LightDirectionalShadowDepthRangeMode light_directional_get_shadow_depth_range_mode(RID p_light) const override { return RS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE; } RS::LightDirectionalShadowMode light_directional_get_shadow_mode(RID p_light) override { return RS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL; } RS::LightOmniShadowMode light_omni_get_shadow_mode(RID p_light) override { return RS::LIGHT_OMNI_SHADOW_DUAL_PARABOLOID; } @@ -491,12 +488,6 @@ public: void voxel_gi_set_energy(RID p_voxel_gi, float p_range) override {} float voxel_gi_get_energy(RID p_voxel_gi) const override { return 0.0; } - void voxel_gi_set_ao(RID p_voxel_gi, float p_ao) override {} - float voxel_gi_get_ao(RID p_voxel_gi) const override { return 0; } - - void voxel_gi_set_ao_size(RID p_voxel_gi, float p_strength) override {} - float voxel_gi_get_ao_size(RID p_voxel_gi) const override { return 0; } - void voxel_gi_set_bias(RID p_voxel_gi, float p_range) override {} float voxel_gi_get_bias(RID p_voxel_gi) const override { return 0.0; } @@ -719,8 +710,6 @@ public: void occluder_polygon_set_cull_mode(RID p_occluder, RS::CanvasOccluderPolygonCullMode p_mode) override {} void set_shadow_texture_size(int p_size) override {} - void draw_window_margins(int *p_margins, RID *p_margin_textures) override {} - bool free(RID p_rid) override { return true; } void update() override {} diff --git a/servers/rendering/renderer_canvas_render.h b/servers/rendering/renderer_canvas_render.h index c10b9db035..8afe9ef410 100644 --- a/servers/rendering/renderer_canvas_render.h +++ b/servers/rendering/renderer_canvas_render.h @@ -608,8 +608,6 @@ public: virtual void occluder_polygon_set_cull_mode(RID p_occluder, RS::CanvasOccluderPolygonCullMode p_mode) = 0; virtual void set_shadow_texture_size(int p_size) = 0; - virtual void draw_window_margins(int *p_margins, RID *p_margin_textures) = 0; - virtual bool free(RID p_rid) = 0; virtual void update() = 0; diff --git a/servers/rendering/renderer_rd/renderer_canvas_render_rd.h b/servers/rendering/renderer_rd/renderer_canvas_render_rd.h index 8c1376e2dc..1bc3769450 100644 --- a/servers/rendering/renderer_rd/renderer_canvas_render_rd.h +++ b/servers/rendering/renderer_rd/renderer_canvas_render_rd.h @@ -457,8 +457,6 @@ public: void canvas_debug_viewport_shadows(Light *p_lights_with_shadow) {} - void draw_window_margins(int *p_margins, RID *p_margin_textures) {} - virtual void set_shadow_texture_size(int p_size); void set_time(double p_time); diff --git a/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp index be1642998c..9228e06d7e 100644 --- a/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp @@ -3078,9 +3078,6 @@ void RendererSceneGIRD::setup_voxel_gi_instances(RID p_render_buffers, const Tra gipd.bias = storage->voxel_gi_get_bias(base_probe); gipd.normal_bias = storage->voxel_gi_get_normal_bias(base_probe); gipd.blend_ambient = !storage->voxel_gi_is_interior(base_probe); - gipd.anisotropy_strength = 0; - gipd.ao = storage->voxel_gi_get_ao(base_probe); - gipd.ao_size = Math::pow(storage->voxel_gi_get_ao_size(base_probe), 4.0f); gipd.mipmaps = gipi->mipmaps.size(); } diff --git a/servers/rendering/renderer_rd/renderer_scene_gi_rd.h b/servers/rendering/renderer_rd/renderer_scene_gi_rd.h index 45fc7b3951..128bf09063 100644 --- a/servers/rendering/renderer_rd/renderer_scene_gi_rd.h +++ b/servers/rendering/renderer_rd/renderer_scene_gi_rd.h @@ -611,9 +611,9 @@ public: uint32_t blend_ambient; uint32_t texture_slot; - float anisotropy_strength; - float ao; - float ao_size; + uint32_t pad0; + uint32_t pad1; + uint32_t pad2; uint32_t mipmaps; }; diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.cpp b/servers/rendering/renderer_rd/renderer_storage_rd.cpp index ee6fee6142..3809c93e67 100644 --- a/servers/rendering/renderer_rd/renderer_storage_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_storage_rd.cpp @@ -35,6 +35,7 @@ #include "core/io/resource_loader.h" #include "core/math/math_defs.h" #include "renderer_compositor_rd.h" +#include "servers/rendering/rendering_server_globals.h" #include "servers/rendering/shader_language.h" bool RendererStorageRD::can_create_resources_async() const { @@ -883,10 +884,6 @@ void RendererStorageRD::_texture_2d_update(RID p_texture, const Ref<Image> &p_im RD::get_singleton()->texture_update(tex->rd_texture, p_layer, validated->get_data()); } -void RendererStorageRD::texture_2d_update_immediate(RID p_texture, const Ref<Image> &p_image, int p_layer) { - _texture_2d_update(p_texture, p_image, p_layer, true); -} - void RendererStorageRD::texture_2d_update(RID p_texture, const Ref<Image> &p_image, int p_layer) { _texture_2d_update(p_texture, p_image, p_layer, false); } @@ -2463,7 +2460,7 @@ void RendererStorageRD::mesh_add_surface(RID p_mesh, const RS::SurfaceData &p_su } break; case RS::ARRAY_COLOR: { - attrib_stride += sizeof(int16_t) * 4; + attrib_stride += sizeof(uint32_t); } break; case RS::ARRAY_TEX_UV: { attrib_stride += sizeof(float) * 2; @@ -3258,8 +3255,8 @@ void RendererStorageRD::_mesh_surface_generate_version_for_input_mask(Mesh::Surf case RS::ARRAY_COLOR: { vd.offset = attribute_stride; - vd.format = RD::DATA_FORMAT_R16G16B16A16_SFLOAT; - attribute_stride += sizeof(int16_t) * 4; + vd.format = RD::DATA_FORMAT_R8G8B8A8_UNORM; + attribute_stride += sizeof(int8_t) * 4; buffer = s->attribute_buffer; } break; case RS::ARRAY_TEX_UV: { @@ -3921,6 +3918,7 @@ void RendererStorageRD::particles_set_emitting(RID p_particles, bool p_emitting) } bool RendererStorageRD::particles_get_emitting(RID p_particles) { + ERR_FAIL_COND_V_MSG(RSG::threaded, false, "This function should never be used with threaded rendering, as it stalls the renderer."); Particles *particles = particles_owner.getornull(p_particles); ERR_FAIL_COND_V(!particles, false); @@ -4243,6 +4241,10 @@ void RendererStorageRD::particles_request_process(RID p_particles) { } AABB RendererStorageRD::particles_get_current_aabb(RID p_particles) { + if (RSG::threaded) { + WARN_PRINT_ONCE("Calling this function with threaded rendering enabled stalls the renderer, use with care."); + } + const Particles *particles = particles_owner.getornull(p_particles); ERR_FAIL_COND_V(!particles, AABB()); @@ -5127,6 +5129,7 @@ void RendererStorageRD::update_particles() { } bool RendererStorageRD::particles_is_inactive(RID p_particles) const { + ERR_FAIL_COND_V_MSG(RSG::threaded, false, "This function should never be used with threaded rendering, as it stalls the renderer."); const Particles *particles = particles_owner.getornull(p_particles); ERR_FAIL_COND_V(!particles, false); return !particles->emitting && particles->inactive; @@ -6028,20 +6031,6 @@ RS::LightDirectionalShadowMode RendererStorageRD::light_directional_get_shadow_m return light->directional_shadow_mode; } -void RendererStorageRD::light_directional_set_shadow_depth_range_mode(RID p_light, RS::LightDirectionalShadowDepthRangeMode p_range_mode) { - Light *light = light_owner.getornull(p_light); - ERR_FAIL_COND(!light); - - light->directional_range_mode = p_range_mode; -} - -RS::LightDirectionalShadowDepthRangeMode RendererStorageRD::light_directional_get_shadow_depth_range_mode(RID p_light) const { - const Light *light = light_owner.getornull(p_light); - ERR_FAIL_COND_V(!light, RS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE); - - return light->directional_range_mode; -} - uint32_t RendererStorageRD::light_get_max_sdfgi_cascade(RID p_light) { const Light *light = light_owner.getornull(p_light); ERR_FAIL_COND_V(!light, 0); @@ -6635,32 +6624,6 @@ float RendererStorageRD::voxel_gi_get_energy(RID p_voxel_gi) const { return voxel_gi->energy; } -void RendererStorageRD::voxel_gi_set_ao(RID p_voxel_gi, float p_ao) { - VoxelGI *voxel_gi = voxel_gi_owner.getornull(p_voxel_gi); - ERR_FAIL_COND(!voxel_gi); - - voxel_gi->ao = p_ao; -} - -float RendererStorageRD::voxel_gi_get_ao(RID p_voxel_gi) const { - VoxelGI *voxel_gi = voxel_gi_owner.getornull(p_voxel_gi); - ERR_FAIL_COND_V(!voxel_gi, 0); - return voxel_gi->ao; -} - -void RendererStorageRD::voxel_gi_set_ao_size(RID p_voxel_gi, float p_strength) { - VoxelGI *voxel_gi = voxel_gi_owner.getornull(p_voxel_gi); - ERR_FAIL_COND(!voxel_gi); - - voxel_gi->ao_size = p_strength; -} - -float RendererStorageRD::voxel_gi_get_ao_size(RID p_voxel_gi) const { - VoxelGI *voxel_gi = voxel_gi_owner.getornull(p_voxel_gi); - ERR_FAIL_COND_V(!voxel_gi, 0); - return voxel_gi->ao_size; -} - void RendererStorageRD::voxel_gi_set_bias(RID p_voxel_gi, float p_bias) { VoxelGI *voxel_gi = voxel_gi_owner.getornull(p_voxel_gi); ERR_FAIL_COND(!voxel_gi); diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.h b/servers/rendering/renderer_rd/renderer_storage_rd.h index e09b1d6b16..26739b11da 100644 --- a/servers/rendering/renderer_rd/renderer_storage_rd.h +++ b/servers/rendering/renderer_rd/renderer_storage_rd.h @@ -1002,7 +1002,6 @@ private: uint32_t cull_mask = 0xFFFFFFFF; RS::LightOmniShadowMode omni_shadow_mode = RS::LIGHT_OMNI_SHADOW_DUAL_PARABOLOID; RS::LightDirectionalShadowMode directional_shadow_mode = RS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL; - RS::LightDirectionalShadowDepthRangeMode directional_range_mode = RS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE; bool directional_blend_splits = false; bool directional_sky_only = false; uint64_t version = 0; @@ -1076,8 +1075,6 @@ private: float dynamic_range = 4.0; float energy = 1.0; - float ao = 0.0; - float ao_size = 0.5; float bias = 1.4; float normal_bias = 0.0; float propagation = 0.7; @@ -1298,7 +1295,6 @@ public: virtual void _texture_2d_update(RID p_texture, const Ref<Image> &p_image, int p_layer, bool p_immediate); - virtual void texture_2d_update_immediate(RID p_texture, const Ref<Image> &p_image, int p_layer = 0); //mostly used for video and streaming virtual void texture_2d_update(RID p_texture, const Ref<Image> &p_image, int p_layer = 0); virtual void texture_3d_update(RID p_texture, const Vector<Ref<Image>> &p_data); virtual void texture_proxy_update(RID p_texture, RID p_proxy_to); @@ -1816,8 +1812,6 @@ public: bool light_directional_get_blend_splits(RID p_light) const; void light_directional_set_sky_only(RID p_light, bool p_sky_only); bool light_directional_is_sky_only(RID p_light) const; - void light_directional_set_shadow_depth_range_mode(RID p_light, RS::LightDirectionalShadowDepthRangeMode p_range_mode); - RS::LightDirectionalShadowDepthRangeMode light_directional_get_shadow_depth_range_mode(RID p_light) const; RS::LightDirectionalShadowMode light_directional_get_shadow_mode(RID p_light); RS::LightOmniShadowMode light_omni_get_shadow_mode(RID p_light); @@ -2040,12 +2034,6 @@ public: void voxel_gi_set_energy(RID p_voxel_gi, float p_energy); float voxel_gi_get_energy(RID p_voxel_gi) const; - void voxel_gi_set_ao(RID p_voxel_gi, float p_ao); - float voxel_gi_get_ao(RID p_voxel_gi) const; - - void voxel_gi_set_ao_size(RID p_voxel_gi, float p_strength); - float voxel_gi_get_ao_size(RID p_voxel_gi) const; - void voxel_gi_set_bias(RID p_voxel_gi, float p_bias); float voxel_gi_get_bias(RID p_voxel_gi) const; diff --git a/servers/rendering/renderer_rd/shaders/gi.glsl b/servers/rendering/renderer_rd/shaders/gi.glsl index 3977f4efa0..60c881881d 100644 --- a/servers/rendering/renderer_rd/shaders/gi.glsl +++ b/servers/rendering/renderer_rd/shaders/gi.glsl @@ -77,9 +77,9 @@ struct VoxelGIData { bool blend_ambient; uint texture_slot; - float anisotropy_strength; - float ambient_occlusion; - float ambient_occlusion_size; + uint pad0; + uint pad1; + uint pad2; uint mipmaps; }; @@ -551,27 +551,6 @@ void voxel_gi_compute(uint index, vec3 position, vec3 normal, vec3 ref_vec, mat3 } } - if (voxel_gi_instances.data[index].ambient_occlusion > 0.001) { - float size = 1.0 + voxel_gi_instances.data[index].ambient_occlusion_size * 7.0; - - float taps, blend; - blend = modf(size, taps); - float ao = 0.0; - for (float i = 1.0; i <= taps; i++) { - vec3 ofs = (position + normal * (i * 0.5 + 1.0)) * cell_size; - ao += textureLod(sampler3D(voxel_gi_textures[index], linear_sampler_with_mipmaps), ofs, i - 1.0).a * i; - } - - if (blend > 0.001) { - vec3 ofs = (position + normal * ((taps + 1.0) * 0.5 + 1.0)) * cell_size; - ao += textureLod(sampler3D(voxel_gi_textures[index], linear_sampler_with_mipmaps), ofs, taps).a * (taps + 1.0) * blend; - } - - ao = 1.0 - min(1.0, ao); - - light.rgb = mix(params.ao_color, light.rgb, mix(1.0, ao, voxel_gi_instances.data[index].ambient_occlusion)); - } - light.rgb *= voxel_gi_instances.data[index].dynamic_range; if (!voxel_gi_instances.data[index].blend_ambient) { light.a = 1.0; diff --git a/servers/rendering/renderer_scene.h b/servers/rendering/renderer_scene.h index d71425f465..d2e9f64335 100644 --- a/servers/rendering/renderer_scene.h +++ b/servers/rendering/renderer_scene.h @@ -56,7 +56,6 @@ public: virtual RID scenario_allocate() = 0; virtual void scenario_initialize(RID p_rid) = 0; - virtual void scenario_set_debug(RID p_scenario, RS::ScenarioDebugMode p_debug_mode) = 0; virtual void scenario_set_environment(RID p_scenario, RID p_environment) = 0; virtual void scenario_set_camera_effects(RID p_scenario, RID p_fx) = 0; virtual void scenario_set_fallback_environment(RID p_scenario, RID p_environment) = 0; @@ -81,7 +80,6 @@ public: virtual void instance_set_custom_aabb(RID p_instance, AABB p_aabb) = 0; virtual void instance_attach_skeleton(RID p_instance, RID p_skeleton) = 0; - virtual void instance_set_exterior(RID p_instance, bool p_enabled) = 0; virtual void instance_set_extra_visibility_margin(RID p_instance, real_t p_margin) = 0; virtual void instance_set_visibility_parent(RID p_instance, RID p_parent_instance) = 0; diff --git a/servers/rendering/renderer_scene_cull.cpp b/servers/rendering/renderer_scene_cull.cpp index 7e7139463b..2e148fefcf 100644 --- a/servers/rendering/renderer_scene_cull.cpp +++ b/servers/rendering/renderer_scene_cull.cpp @@ -330,12 +330,6 @@ void RendererSceneCull::scenario_initialize(RID p_rid) { RendererSceneOcclusionCull::get_singleton()->add_scenario(p_rid); } -void RendererSceneCull::scenario_set_debug(RID p_scenario, RS::ScenarioDebugMode p_debug_mode) { - Scenario *scenario = scenario_owner.getornull(p_scenario); - ERR_FAIL_COND(!scenario); - scenario->debug = p_debug_mode; -} - void RendererSceneCull::scenario_set_environment(RID p_scenario, RID p_environment) { Scenario *scenario = scenario_owner.getornull(p_scenario); ERR_FAIL_COND(!scenario); @@ -939,9 +933,6 @@ void RendererSceneCull::instance_attach_skeleton(RID p_instance, RID p_skeleton) } } -void RendererSceneCull::instance_set_exterior(RID p_instance, bool p_enabled) { -} - void RendererSceneCull::instance_set_extra_visibility_margin(RID p_instance, real_t p_margin) { Instance *instance = instance_owner.getornull(p_instance); ERR_FAIL_COND(!instance); @@ -1886,8 +1877,6 @@ void RendererSceneCull::_light_instance_setup_directional_shadow(int p_shadow_in max_distance = MAX(max_distance, p_cam_projection.get_z_near() + 0.001); real_t min_distance = MIN(p_cam_projection.get_z_near(), max_distance); - RS::LightDirectionalShadowDepthRangeMode depth_range_mode = RSG::storage->light_directional_get_shadow_depth_range_mode(p_instance->base); - real_t pancake_size = RSG::storage->light_get_param(p_instance->base, RS::LIGHT_PARAM_SHADOW_PANCAKE_SIZE); real_t range = max_distance - min_distance; @@ -2047,22 +2036,13 @@ void RendererSceneCull::_light_instance_setup_directional_shadow(int p_shadow_in } } - x_max_cam = x_vec.dot(center) + radius + soft_shadow_expand; - x_min_cam = x_vec.dot(center) - radius - soft_shadow_expand; - y_max_cam = y_vec.dot(center) + radius + soft_shadow_expand; - y_min_cam = y_vec.dot(center) - radius - soft_shadow_expand; - - if (depth_range_mode == RS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE) { - //this trick here is what stabilizes the shadow (make potential jaggies to not move) - //at the cost of some wasted resolution. Still the quality increase is very well worth it - - real_t unit = radius * 2.0 / texture_size; - - x_max_cam = Math::snapped(x_max_cam, unit); - x_min_cam = Math::snapped(x_min_cam, unit); - y_max_cam = Math::snapped(y_max_cam, unit); - y_min_cam = Math::snapped(y_min_cam, unit); - } + // This trick here is what stabilizes the shadow (make potential jaggies to not move) + // at the cost of some wasted resolution. Still, the quality increase is very well worth it. + const real_t unit = radius * 2.0 / texture_size; + x_max_cam = Math::snapped(x_vec.dot(center) + radius + soft_shadow_expand, unit); + x_min_cam = Math::snapped(x_vec.dot(center) - radius - soft_shadow_expand, unit); + y_max_cam = Math::snapped(y_vec.dot(center) + radius + soft_shadow_expand, unit); + y_min_cam = Math::snapped(y_vec.dot(center) - radius - soft_shadow_expand, unit); } //now that we know all ranges, we can proceed to make the light frustum planes, for culling octree diff --git a/servers/rendering/renderer_scene_cull.h b/servers/rendering/renderer_scene_cull.h index e303f3c739..53fb197fcc 100644 --- a/servers/rendering/renderer_scene_cull.h +++ b/servers/rendering/renderer_scene_cull.h @@ -315,7 +315,6 @@ public: DynamicBVH indexers[INDEXER_MAX]; - RS::ScenarioDebugMode debug; RID self; List<Instance *> directional_lights; @@ -338,7 +337,6 @@ public: Scenario() { indexers[INDEXER_GEOMETRY].set_index(INDEXER_GEOMETRY); indexers[INDEXER_VOLUMES].set_index(INDEXER_VOLUMES); - debug = RS::SCENARIO_DEBUG_DISABLED; used_viewport_visibility_bits = 0; } }; @@ -355,7 +353,6 @@ public: virtual RID scenario_allocate(); virtual void scenario_initialize(RID p_rid); - virtual void scenario_set_debug(RID p_scenario, RS::ScenarioDebugMode p_debug_mode); virtual void scenario_set_environment(RID p_scenario, RID p_environment); virtual void scenario_set_camera_effects(RID p_scenario, RID p_fx); virtual void scenario_set_fallback_environment(RID p_scenario, RID p_environment); @@ -914,7 +911,6 @@ public: virtual void instance_set_custom_aabb(RID p_instance, AABB p_aabb); virtual void instance_attach_skeleton(RID p_instance, RID p_skeleton); - virtual void instance_set_exterior(RID p_instance, bool p_enabled); virtual void instance_set_extra_visibility_margin(RID p_instance, real_t p_margin); diff --git a/servers/rendering/renderer_scene_occlusion_cull.cpp b/servers/rendering/renderer_scene_occlusion_cull.cpp index 54795f32a7..1b8aea36d7 100644 --- a/servers/rendering/renderer_scene_occlusion_cull.cpp +++ b/servers/rendering/renderer_scene_occlusion_cull.cpp @@ -185,7 +185,7 @@ RID RendererSceneOcclusionCull::HZBuffer::get_debug_texture() { if (debug_texture.is_null()) { debug_texture = RS::get_singleton()->texture_2d_create(debug_image); } else { - RenderingServer::get_singleton()->texture_2d_update_immediate(debug_texture, debug_image); + RenderingServer::get_singleton()->texture_2d_update(debug_texture, debug_image); } return debug_texture; diff --git a/servers/rendering/renderer_storage.h b/servers/rendering/renderer_storage.h index 62b23acedf..c491e05be5 100644 --- a/servers/rendering/renderer_storage.h +++ b/servers/rendering/renderer_storage.h @@ -130,7 +130,6 @@ public: virtual void texture_3d_initialize(RID p_texture, Image::Format, int p_width, int p_height, int p_depth, bool p_mipmaps, const Vector<Ref<Image>> &p_data) = 0; virtual void texture_proxy_initialize(RID p_texture, RID p_base) = 0; //all slices, then all the mipmaps, must be coherent - virtual void texture_2d_update_immediate(RID p_texture, const Ref<Image> &p_image, int p_layer = 0) = 0; //mostly used for video and streaming virtual void texture_2d_update(RID p_texture, const Ref<Image> &p_image, int p_layer = 0) = 0; virtual void texture_3d_update(RID p_texture, const Vector<Ref<Image>> &p_data) = 0; virtual void texture_proxy_update(RID p_proxy, RID p_base) = 0; @@ -332,8 +331,6 @@ public: virtual bool light_directional_get_blend_splits(RID p_light) const = 0; virtual void light_directional_set_sky_only(RID p_light, bool p_sky_only) = 0; virtual bool light_directional_is_sky_only(RID p_light) const = 0; - virtual void light_directional_set_shadow_depth_range_mode(RID p_light, RS::LightDirectionalShadowDepthRangeMode p_range_mode) = 0; - virtual RS::LightDirectionalShadowDepthRangeMode light_directional_get_shadow_depth_range_mode(RID p_light) const = 0; virtual RS::LightDirectionalShadowMode light_directional_get_shadow_mode(RID p_light) = 0; virtual RS::LightOmniShadowMode light_omni_get_shadow_mode(RID p_light) = 0; @@ -422,12 +419,6 @@ public: virtual void voxel_gi_set_energy(RID p_voxel_gi, float p_energy) = 0; virtual float voxel_gi_get_energy(RID p_voxel_gi) const = 0; - virtual void voxel_gi_set_ao(RID p_voxel_gi, float p_ao) = 0; - virtual float voxel_gi_get_ao(RID p_voxel_gi) const = 0; - - virtual void voxel_gi_set_ao_size(RID p_voxel_gi, float p_strength) = 0; - virtual float voxel_gi_get_ao_size(RID p_voxel_gi) const = 0; - virtual void voxel_gi_set_bias(RID p_voxel_gi, float p_bias) = 0; virtual float voxel_gi_get_bias(RID p_voxel_gi) const = 0; diff --git a/servers/rendering/renderer_viewport.cpp b/servers/rendering/renderer_viewport.cpp index 2cf4c035a9..b3301fc607 100644 --- a/servers/rendering/renderer_viewport.cpp +++ b/servers/rendering/renderer_viewport.cpp @@ -114,7 +114,7 @@ void RendererViewport::_draw_viewport(Viewport *p_viewport, uint32_t p_view_coun Color bgcolor = RSG::storage->get_default_clear_color(); - if (!p_viewport->hide_canvas && !p_viewport->disable_environment && RSG::scene->is_scenario(p_viewport->scenario)) { + if (!p_viewport->disable_2d && !p_viewport->disable_environment && RSG::scene->is_scenario(p_viewport->scenario)) { RID environment = RSG::scene->scenario_get_environment(p_viewport->scenario); if (RSG::scene->is_environment(environment)) { scenario_draw_canvas_bg = RSG::scene->environment_get_background(environment) == RS::ENV_BG_CANVAS; @@ -145,7 +145,7 @@ void RendererViewport::_draw_viewport(Viewport *p_viewport, uint32_t p_view_coun _draw_3d(p_viewport); } - if (!p_viewport->hide_canvas) { + if (!p_viewport->disable_2d) { int i = 0; Map<Viewport::CanvasKey, Viewport::CanvasData *> canvas_map; @@ -633,8 +633,6 @@ void RendererViewport::viewport_initialize(RID p_rid) { viewport_owner.initialize_rid(p_rid); Viewport *viewport = viewport_owner.getornull(p_rid); viewport->self = p_rid; - viewport->hide_scenario = false; - viewport->hide_canvas = false; viewport->render_target = RSG::storage->render_target_create(); viewport->shadow_atlas = RSG::scene->shadow_atlas_create(); viewport->viewport_render_direct_to_screen = false; @@ -791,18 +789,11 @@ RID RendererViewport::viewport_get_occluder_debug_texture(RID p_viewport) const return RID(); } -void RendererViewport::viewport_set_hide_scenario(RID p_viewport, bool p_hide) { +void RendererViewport::viewport_set_disable_2d(RID p_viewport, bool p_disable) { Viewport *viewport = viewport_owner.getornull(p_viewport); ERR_FAIL_COND(!viewport); - viewport->hide_scenario = p_hide; -} - -void RendererViewport::viewport_set_hide_canvas(RID p_viewport, bool p_hide) { - Viewport *viewport = viewport_owner.getornull(p_viewport); - ERR_FAIL_COND(!viewport); - - viewport->hide_canvas = p_hide; + viewport->disable_2d = p_disable; } void RendererViewport::viewport_set_disable_environment(RID p_viewport, bool p_disable) { diff --git a/servers/rendering/renderer_viewport.h b/servers/rendering/renderer_viewport.h index ca40829648..bf47bda148 100644 --- a/servers/rendering/renderer_viewport.h +++ b/servers/rendering/renderer_viewport.h @@ -68,9 +68,8 @@ public: Rect2 viewport_to_screen_rect; bool viewport_render_direct_to_screen; - bool hide_scenario; - bool hide_canvas; - bool disable_environment; + bool disable_2d = false; + bool disable_environment = false; bool disable_3d = false; bool measure_render_time; @@ -138,7 +137,7 @@ public: update_mode = RS::VIEWPORT_UPDATE_WHEN_VISIBLE; clear_mode = RS::VIEWPORT_CLEAR_ALWAYS; transparent_bg = false; - disable_environment = false; + viewport_to_screen = DisplayServer::INVALID_WINDOW_ID; shadow_atlas_size = 0; measure_render_time = false; @@ -218,8 +217,7 @@ public: RID viewport_get_texture(RID p_viewport) const; RID viewport_get_occluder_debug_texture(RID p_viewport) const; - void viewport_set_hide_scenario(RID p_viewport, bool p_hide); - void viewport_set_hide_canvas(RID p_viewport, bool p_hide); + void viewport_set_disable_2d(RID p_viewport, bool p_disable); void viewport_set_disable_environment(RID p_viewport, bool p_disable); void viewport_set_disable_3d(RID p_viewport, bool p_disable); diff --git a/servers/rendering/rendering_server_default.cpp b/servers/rendering/rendering_server_default.cpp index 629d212b69..aad6163a16 100644 --- a/servers/rendering/rendering_server_default.cpp +++ b/servers/rendering/rendering_server_default.cpp @@ -42,26 +42,6 @@ int RenderingServerDefault::changes = 0; -/* BLACK BARS */ - -void RenderingServerDefault::black_bars_set_margins(int p_left, int p_top, int p_right, int p_bottom) { - black_margin[SIDE_LEFT] = p_left; - black_margin[SIDE_TOP] = p_top; - black_margin[SIDE_RIGHT] = p_right; - black_margin[SIDE_BOTTOM] = p_bottom; -} - -void RenderingServerDefault::black_bars_set_images(RID p_left, RID p_top, RID p_right, RID p_bottom) { - black_image[SIDE_LEFT] = p_left; - black_image[SIDE_TOP] = p_top; - black_image[SIDE_RIGHT] = p_right; - black_image[SIDE_BOTTOM] = p_bottom; -} - -void RenderingServerDefault::_draw_margins() { - RSG::canvas_render->draw_window_margins(black_margin, black_image); -}; - /* FREE */ void RenderingServerDefault::_free(RID p_rid) { @@ -114,7 +94,6 @@ void RenderingServerDefault::_draw(bool p_swap_buffers, double frame_step) { RSG::viewport->draw_viewports(); RSG::canvas_render->update(); - _draw_margins(); RSG::rasterizer->end_frame(p_swap_buffers); RSG::canvas->update_visibility_notifiers(); @@ -410,11 +389,6 @@ RenderingServerDefault::RenderingServerDefault(bool p_create_thread) : sr->set_scene_render(RSG::rasterizer->get_scene()); frame_profile_frame = 0; - - for (int i = 0; i < 4; i++) { - black_margin[i] = 0; - black_image[i] = RID(); - } } RenderingServerDefault::~RenderingServerDefault() { diff --git a/servers/rendering/rendering_server_default.h b/servers/rendering/rendering_server_default.h index 22c1f6d909..70bba91bab 100644 --- a/servers/rendering/rendering_server_default.h +++ b/servers/rendering/rendering_server_default.h @@ -58,9 +58,6 @@ class RenderingServerDefault : public RenderingServer { static int changes; RID test_cube; - int black_margin[4]; - RID black_image[4]; - struct FrameDrawnCallbacks { ObjectID object; StringName method; @@ -69,7 +66,6 @@ class RenderingServerDefault : public RenderingServer { List<FrameDrawnCallbacks> frame_drawn_callbacks; - void _draw_margins(); static void _changes_changed() {} uint64_t frame_profile_frame; @@ -192,8 +188,6 @@ public: FUNCRIDTEX6(texture_3d, Image::Format, int, int, int, bool, const Vector<Ref<Image>> &) FUNCRIDTEX1(texture_proxy, RID) - //goes pass-through - FUNC3(texture_2d_update_immediate, RID, const Ref<Image> &, int) //these go through command queue if they are in another thread FUNC3(texture_2d_update, RID, const Ref<Image> &, int) FUNC2(texture_3d_update, RID, const Vector<Ref<Image>> &) @@ -368,7 +362,6 @@ public: FUNC2(light_directional_set_shadow_mode, RID, LightDirectionalShadowMode) FUNC2(light_directional_set_blend_splits, RID, bool) FUNC2(light_directional_set_sky_only, RID, bool) - FUNC2(light_directional_set_shadow_depth_range_mode, RID, LightDirectionalShadowDepthRangeMode) /* PROBE API */ @@ -418,34 +411,12 @@ public: FUNC1RC(Transform3D, voxel_gi_get_to_cell_xform, RID) FUNC2(voxel_gi_set_dynamic_range, RID, float) - FUNC1RC(float, voxel_gi_get_dynamic_range, RID) - FUNC2(voxel_gi_set_propagation, RID, float) - FUNC1RC(float, voxel_gi_get_propagation, RID) - FUNC2(voxel_gi_set_energy, RID, float) - FUNC1RC(float, voxel_gi_get_energy, RID) - - FUNC2(voxel_gi_set_ao, RID, float) - FUNC1RC(float, voxel_gi_get_ao, RID) - - FUNC2(voxel_gi_set_ao_size, RID, float) - FUNC1RC(float, voxel_gi_get_ao_size, RID) - FUNC2(voxel_gi_set_bias, RID, float) - FUNC1RC(float, voxel_gi_get_bias, RID) - FUNC2(voxel_gi_set_normal_bias, RID, float) - FUNC1RC(float, voxel_gi_get_normal_bias, RID) - FUNC2(voxel_gi_set_interior, RID, bool) - FUNC1RC(bool, voxel_gi_is_interior, RID) - FUNC2(voxel_gi_set_use_two_bounces, RID, bool) - FUNC1RC(bool, voxel_gi_is_using_two_bounces, RID) - - FUNC2(voxel_gi_set_anisotropy_strength, RID, float) - FUNC1RC(float, voxel_gi_get_anisotropy_strength, RID) /* LIGHTMAP */ @@ -569,8 +540,7 @@ public: FUNC1RC(RID, viewport_get_texture, RID) - FUNC2(viewport_set_hide_scenario, RID, bool) - FUNC2(viewport_set_hide_canvas, RID, bool) + FUNC2(viewport_set_disable_2d, RID, bool) FUNC2(viewport_set_disable_environment, RID, bool) FUNC2(viewport_set_disable_3d, RID, bool) @@ -697,7 +667,6 @@ public: FUNCRIDSPLIT(scenario) - FUNC2(scenario_set_debug, RID, ScenarioDebugMode) FUNC2(scenario_set_environment, RID, RID) FUNC2(scenario_set_camera_effects, RID, RID) FUNC2(scenario_set_fallback_environment, RID, RID) @@ -717,7 +686,6 @@ public: FUNC2(instance_set_custom_aabb, RID, AABB) FUNC2(instance_attach_skeleton, RID, RID) - FUNC2(instance_set_exterior, RID, bool) FUNC2(instance_set_extra_visibility_margin, RID, real_t) FUNC2(instance_set_visibility_parent, RID, RID) @@ -885,11 +853,6 @@ public: #undef WRITE_ACTION #undef SYNC_DEBUG - /* BLACK BARS */ - - virtual void black_bars_set_margins(int p_left, int p_top, int p_right, int p_bottom) override; - virtual void black_bars_set_images(RID p_left, RID p_top, RID p_right, RID p_bottom) override; - /* FREE */ virtual void free(RID p_rid) override { |