summaryrefslogtreecommitdiff
path: root/servers/visual/visual_server_scene.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-11-23 07:04:55 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-11-23 07:04:55 -0300
commit7cf8d75cf8c49d02a72eac1d5342808526fa54ef (patch)
tree01fd616a0d376dccb227388365eba46674e151b5 /servers/visual/visual_server_scene.cpp
parentb72ca046051018628a31bc458dd730384ebddbe8 (diff)
WIP immediates and proper buffers swapping
Diffstat (limited to 'servers/visual/visual_server_scene.cpp')
-rw-r--r--servers/visual/visual_server_scene.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp
index f25e5bc943..2439eacd75 100644
--- a/servers/visual/visual_server_scene.cpp
+++ b/servers/visual/visual_server_scene.cpp
@@ -557,12 +557,9 @@ void VisualServerScene::instance_set_base(RID p_instance, RID p_base){
instance->base_data=light;
} break;
- case VS::INSTANCE_MESH: {
-
- InstanceGeometryData *geom = memnew( InstanceGeometryData );
- instance->base_data=geom;
- } break;
- case VS::INSTANCE_MULTIMESH: {
+ case VS::INSTANCE_MESH:
+ case VS::INSTANCE_MULTIMESH:
+ case VS::INSTANCE_IMMEDIATE: {
InstanceGeometryData *geom = memnew( InstanceGeometryData );
instance->base_data=geom;
@@ -1147,13 +1144,14 @@ void VisualServerScene::_update_instance_aabb(Instance *p_instance) {
new_aabb = VSG::storage->multimesh_get_aabb(p_instance->base);
} break;
-#if 0
case VisualServer::INSTANCE_IMMEDIATE: {
- new_aabb = rasterizer->immediate_get_aabb(p_instance->base);
+ new_aabb = VSG::storage->immediate_get_aabb(p_instance->base);
} break;
+#if 0
+
case VisualServer::INSTANCE_PARTICLES: {
new_aabb = rasterizer->particles_get_aabb(p_instance->base);
@@ -2309,6 +2307,17 @@ void VisualServerScene::_update_dirty_instance(Instance *p_instance) {
can_cast_shadows=false;
}
}
+ } else if (p_instance->base_type==VS::INSTANCE_IMMEDIATE) {
+
+ RID mat = VSG::storage->immediate_get_material(p_instance->base);
+
+ if (!mat.is_valid() || VSG::storage->material_casts_shadows(mat)) {
+ can_cast_shadows=true;
+ } else {
+ can_cast_shadows=false;
+ }
+
+
}