From 903a3aa5f0e128abb1fb752c10b343b34af8f799 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 16 Feb 2017 08:55:11 -0300 Subject: a ton of bug fixes to the renderer --- servers/visual/rasterizer.h | 5 +++++ servers/visual/visual_server_raster.h | 3 +++ servers/visual/visual_server_scene.cpp | 6 ++++++ servers/visual_server.h | 3 +++ 4 files changed, 17 insertions(+) (limited to 'servers') diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 21f7f0769f..dd22986865 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -432,6 +432,9 @@ public: virtual void gi_probe_set_energy(RID p_probe,float p_range)=0; virtual float gi_probe_get_energy(RID p_probe) const=0; + virtual void gi_probe_set_bias(RID p_probe,float p_range)=0; + virtual float gi_probe_get_bias(RID p_probe) const=0; + virtual void gi_probe_set_propagation(RID p_probe,float p_range)=0; virtual float gi_probe_get_propagation(RID p_probe) const=0; @@ -519,6 +522,8 @@ public: virtual bool has_os_feature(const String& p_feature) const=0; + virtual void update_dirty_resources()=0; + static RasterizerStorage*base_signleton; RasterizerStorage(); virtual ~RasterizerStorage() {} diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index ad0cb664c5..7d547e1862 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -825,6 +825,9 @@ public: BIND2(gi_probe_set_energy,RID,float) BIND1RC(float,gi_probe_get_energy,RID) + BIND2(gi_probe_set_bias,RID,float) + BIND1RC(float,gi_probe_get_bias,RID) + BIND2(gi_probe_set_propagation,RID,float) BIND1RC(float,gi_probe_get_propagation,RID) diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp index c54f3dbca5..6f7b2e3aed 100644 --- a/servers/visual/visual_server_scene.cpp +++ b/servers/visual/visual_server_scene.cpp @@ -1556,9 +1556,11 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance,const cull_count--; SWAP(instance_shadow_cull_result[j],instance_shadow_cull_result[cull_count]); j--; + continue; } + instance->transformed_aabb.project_range_in_plane(Plane(z_vec,0),min,max); if (max>z_max) z_max=max; @@ -3475,6 +3477,7 @@ void VisualServerScene::_update_dirty_instance(Instance *p_instance) { } else if (p_instance->base_type==VS::INSTANCE_MULTIMESH) { RID mesh = VSG::storage->multimesh_get_mesh(p_instance->base); if (mesh.is_valid()) { + bool cast_shadows=false; int sc = VSG::storage->mesh_get_surface_count(mesh); @@ -3491,6 +3494,7 @@ void VisualServerScene::_update_dirty_instance(Instance *p_instance) { cast_shadows=true; break; } + } if (!cast_shadows) { @@ -3538,6 +3542,8 @@ void VisualServerScene::_update_dirty_instance(Instance *p_instance) { void VisualServerScene::update_dirty_instances() { + VSG::storage->update_dirty_resources(); + while(_instance_update_list.first()) { _update_dirty_instance( _instance_update_list.first()->self() ); diff --git a/servers/visual_server.h b/servers/visual_server.h index 5c835c2287..08cf34a653 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -475,6 +475,9 @@ public: virtual void gi_probe_set_energy(RID p_probe,float p_range)=0; virtual float gi_probe_get_energy(RID p_probe) const=0; + virtual void gi_probe_set_bias(RID p_probe,float p_range)=0; + virtual float gi_probe_get_bias(RID p_probe) const=0; + virtual void gi_probe_set_propagation(RID p_probe,float p_range)=0; virtual float gi_probe_get_propagation(RID p_probe) const=0; -- cgit v1.2.3