summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
Diffstat (limited to 'servers')
-rw-r--r--servers/visual/rasterizer.h13
-rw-r--r--servers/visual/rasterizer_dummy.cpp17
-rw-r--r--servers/visual/rasterizer_dummy.h5
-rw-r--r--servers/visual/visual_server_raster.cpp15
-rw-r--r--servers/visual/visual_server_raster.h5
-rw-r--r--servers/visual/visual_server_wrap_mt.h4
-rw-r--r--servers/visual_server.h8
7 files changed, 64 insertions, 3 deletions
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h
index 0b54fec859..783231d2e5 100644
--- a/servers/visual/rasterizer.h
+++ b/servers/visual/rasterizer.h
@@ -153,6 +153,16 @@ protected:
void _free_fixed_material(const RID& p_material);
public:
+
+ enum ShadowFilterTechnique {
+ SHADOW_FILTER_NONE,
+ SHADOW_FILTER_PCF5,
+ SHADOW_FILTER_PCF13,
+ SHADOW_FILTER_ESM,
+ SHADOW_FILTER_VSM,
+ };
+
+
/* TEXTURE API */
virtual RID texture_create()=0;
@@ -264,6 +274,9 @@ public:
virtual AABB mesh_get_aabb(RID p_mesh) const=0;
+ virtual void mesh_set_custom_aabb(RID p_mesh,const AABB& p_aabb)=0;
+ virtual AABB mesh_get_custom_aabb(RID p_mesh) const=0;
+
/* MULTIMESH API */
virtual RID multimesh_create()=0;
diff --git a/servers/visual/rasterizer_dummy.cpp b/servers/visual/rasterizer_dummy.cpp
index bfb427f2e8..39c02c2037 100644
--- a/servers/visual/rasterizer_dummy.cpp
+++ b/servers/visual/rasterizer_dummy.cpp
@@ -587,6 +587,23 @@ AABB RasterizerDummy::mesh_get_aabb(RID p_mesh) const {
return aabb;
}
+void RasterizerDummy::mesh_set_custom_aabb(RID p_mesh,const AABB& p_aabb) {
+
+ Mesh *mesh = mesh_owner.get( p_mesh );
+ ERR_FAIL_COND(!mesh);
+
+ mesh->custom_aabb=p_aabb;
+}
+
+AABB RasterizerDummy::mesh_get_custom_aabb(RID p_mesh) const {
+
+ const Mesh *mesh = mesh_owner.get( p_mesh );
+ ERR_FAIL_COND_V(!mesh,AABB());
+
+ return mesh->custom_aabb;
+
+}
+
/* MULTIMESH API */
RID RasterizerDummy::multimesh_create() {
diff --git a/servers/visual/rasterizer_dummy.h b/servers/visual/rasterizer_dummy.h
index e1fa521284..880e19c9b0 100644
--- a/servers/visual/rasterizer_dummy.h
+++ b/servers/visual/rasterizer_dummy.h
@@ -189,6 +189,7 @@ class RasterizerDummy : public Rasterizer {
Vector<Surface*> surfaces;
int morph_target_count;
VS::MorphTargetMode morph_target_mode;
+ AABB custom_aabb;
mutable uint64_t last_pass;
Mesh() {
@@ -464,6 +465,10 @@ public:
virtual AABB mesh_get_aabb(RID p_mesh) const;
+ virtual void mesh_set_custom_aabb(RID p_mesh,const AABB& p_aabb);
+ virtual AABB mesh_get_custom_aabb(RID p_mesh) const;
+
+
/* MULTIMESH API */
virtual RID multimesh_create();
diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp
index 2108e5b9c2..6b74b34ba1 100644
--- a/servers/visual/visual_server_raster.cpp
+++ b/servers/visual/visual_server_raster.cpp
@@ -434,6 +434,21 @@ int VisualServerRaster::mesh_get_surface_count(RID p_mesh) const{
}
+
+void VisualServerRaster::mesh_set_custom_aabb(RID p_mesh,const AABB& p_aabb) {
+
+ VS_CHANGED;
+ _dependency_queue_update(p_mesh,true);
+ rasterizer->mesh_set_custom_aabb(p_mesh,p_aabb);
+
+}
+
+AABB VisualServerRaster::mesh_get_custom_aabb(RID p_mesh) const {
+
+ return rasterizer->mesh_get_custom_aabb(p_mesh);
+}
+
+
/* MULTIMESH */
RID VisualServerRaster::multimesh_create() {
diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h
index d3d504a7c6..c281e0b9e6 100644
--- a/servers/visual/visual_server_raster.h
+++ b/servers/visual/visual_server_raster.h
@@ -742,7 +742,10 @@ public:
virtual void mesh_remove_surface(RID p_mesh,int p_index);
virtual int mesh_get_surface_count(RID p_mesh) const;
-
+
+ virtual void mesh_set_custom_aabb(RID p_mesh,const AABB& p_aabb);
+ virtual AABB mesh_get_custom_aabb(RID p_mesh) const;
+
/* MULTIMESH API */
diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h
index c8f00c3786..87e13cb202 100644
--- a/servers/visual/visual_server_wrap_mt.h
+++ b/servers/visual/visual_server_wrap_mt.h
@@ -696,6 +696,7 @@ public:
FUNC2(mesh_set_morph_target_count,RID,int);
FUNC1RC(int,mesh_get_morph_target_count,RID);
+
FUNC2(mesh_set_morph_target_mode,RID,MorphTargetMode);
FUNC1RC(MorphTargetMode,mesh_get_morph_target_mode,RID);
@@ -717,6 +718,9 @@ public:
FUNC1RC(int,mesh_get_surface_count,RID);
+ FUNC2(mesh_set_custom_aabb,RID,const AABB&);
+ FUNC1RC(AABB,mesh_get_custom_aabb,RID);
+
/* MULTIMESH API */
diff --git a/servers/visual_server.h b/servers/visual_server.h
index 4cf0c96228..4bf2ecab68 100644
--- a/servers/visual_server.h
+++ b/servers/visual_server.h
@@ -334,7 +334,10 @@ public:
virtual void mesh_remove_surface(RID p_mesh,int p_index)=0;
virtual int mesh_get_surface_count(RID p_mesh) const=0;
-
+
+ virtual void mesh_set_custom_aabb(RID p_mesh,const AABB& p_aabb)=0;
+ virtual AABB mesh_get_custom_aabb(RID p_mesh) const=0;
+
/* MULTIMESH API */
virtual RID multimesh_create()=0;
@@ -502,7 +505,8 @@ public:
enum LightDirectionalShadowMode {
LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL,
LIGHT_DIRECTIONAL_SHADOW_PERSPECTIVE,
- LIGHT_DIRECTIONAL_SHADOW_PARALLEL_SPLIT
+ LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS,
+ LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS
};
virtual void light_directional_set_shadow_mode(RID p_light,LightDirectionalShadowMode p_mode)=0;