瀏覽代碼

Use the Static global illumination mode in GeometryInstance3D by default

This makes VoxelGI and SDFGI work out of the box with primitive meshes,
loaded OBJ meshes and CSG nodes.
Hugo Locurcio 3 年之前
父節點
當前提交
610363add0

+ 0 - 2
scene/3d/visual_instance_3d.cpp

@@ -471,7 +471,6 @@ void GeometryInstance3D::_bind_methods() {
 	ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "visibility_range_end", PROPERTY_HINT_RANGE, "0.0,4096.0,0.01,suffix:m"), "set_visibility_range_end", "get_visibility_range_end");
 	ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "visibility_range_end", PROPERTY_HINT_RANGE, "0.0,4096.0,0.01,suffix:m"), "set_visibility_range_end", "get_visibility_range_end");
 	ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "visibility_range_end_margin", PROPERTY_HINT_RANGE, "0.0,4096.0,0.01,suffix:m"), "set_visibility_range_end_margin", "get_visibility_range_end_margin");
 	ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "visibility_range_end_margin", PROPERTY_HINT_RANGE, "0.0,4096.0,0.01,suffix:m"), "set_visibility_range_end_margin", "get_visibility_range_end_margin");
 	ADD_PROPERTY(PropertyInfo(Variant::INT, "visibility_range_fade_mode", PROPERTY_HINT_ENUM, "Disabled,Self,Dependencies"), "set_visibility_range_fade_mode", "get_visibility_range_fade_mode");
 	ADD_PROPERTY(PropertyInfo(Variant::INT, "visibility_range_fade_mode", PROPERTY_HINT_ENUM, "Disabled,Self,Dependencies"), "set_visibility_range_fade_mode", "get_visibility_range_fade_mode");
-	//ADD_SIGNAL( MethodInfo("visibility_changed"));
 
 
 	BIND_ENUM_CONSTANT(SHADOW_CASTING_SETTING_OFF);
 	BIND_ENUM_CONSTANT(SHADOW_CASTING_SETTING_OFF);
 	BIND_ENUM_CONSTANT(SHADOW_CASTING_SETTING_ON);
 	BIND_ENUM_CONSTANT(SHADOW_CASTING_SETTING_ON);
@@ -494,7 +493,6 @@ void GeometryInstance3D::_bind_methods() {
 }
 }
 
 
 GeometryInstance3D::GeometryInstance3D() {
 GeometryInstance3D::GeometryInstance3D() {
-	//RS::get_singleton()->instance_geometry_set_baked_light_texture_index(get_instance(),0);
 }
 }
 
 
 GeometryInstance3D::~GeometryInstance3D() {
 GeometryInstance3D::~GeometryInstance3D() {

+ 1 - 1
scene/3d/visual_instance_3d.h

@@ -126,7 +126,7 @@ private:
 
 
 	float extra_cull_margin = 0.0;
 	float extra_cull_margin = 0.0;
 	LightmapScale lightmap_scale = LIGHTMAP_SCALE_1X;
 	LightmapScale lightmap_scale = LIGHTMAP_SCALE_1X;
-	GIMode gi_mode = GI_MODE_DISABLED;
+	GIMode gi_mode = GI_MODE_STATIC;
 	bool ignore_occlusion_culling = false;
 	bool ignore_occlusion_culling = false;
 
 
 	const StringName *_instance_uniform_get_remap(const StringName p_name) const;
 	const StringName *_instance_uniform_get_remap(const StringName p_name) const;

+ 1 - 1
servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h

@@ -536,7 +536,7 @@ class RenderForwardClustered : public RendererSceneRenderRD {
 			AABB aabb;
 			AABB aabb;
 
 
 			bool use_dynamic_gi = false;
 			bool use_dynamic_gi = false;
-			bool use_baked_light = false;
+			bool use_baked_light = true;
 			bool cast_double_sided_shadows = false;
 			bool cast_double_sided_shadows = false;
 			bool mirror = false;
 			bool mirror = false;
 			bool dirty_dependencies = false;
 			bool dirty_dependencies = false;

+ 1 - 1
servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h

@@ -591,7 +591,7 @@ protected:
 			RID material_overlay;
 			RID material_overlay;
 			AABB aabb;
 			AABB aabb;
 
 
-			bool use_baked_light = false;
+			bool use_baked_light = true;
 			bool cast_double_sided_shadows = false;
 			bool cast_double_sided_shadows = false;
 			// bool mirror = false; // !BAS! Does not seem used, we already have this in the main struct
 			// bool mirror = false; // !BAS! Does not seem used, we already have this in the main struct
 
 

+ 1 - 1
servers/rendering/renderer_scene_cull.h

@@ -526,7 +526,7 @@ public:
 			receive_shadows = true;
 			receive_shadows = true;
 			visible = true;
 			visible = true;
 			layer_mask = 1;
 			layer_mask = 1;
-			baked_light = false;
+			baked_light = true;
 			dynamic_gi = false;
 			dynamic_gi = false;
 			redraw_if_visible = false;
 			redraw_if_visible = false;
 			lightmap_slice_index = 0;
 			lightmap_slice_index = 0;