summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
Diffstat (limited to 'servers')
-rw-r--r--servers/visual/rasterizer.cpp6
-rw-r--r--servers/visual/rasterizer.h22
-rw-r--r--servers/visual/rasterizer_dummy.cpp80
-rw-r--r--servers/visual/rasterizer_dummy.h29
-rw-r--r--servers/visual/shader_language.cpp2
-rw-r--r--servers/visual/visual_server_raster.cpp77
-rw-r--r--servers/visual/visual_server_raster.h15
-rw-r--r--servers/visual/visual_server_wrap_mt.h16
-rw-r--r--servers/visual_server.cpp49
-rw-r--r--servers/visual_server.h43
10 files changed, 336 insertions, 3 deletions
diff --git a/servers/visual/rasterizer.cpp b/servers/visual/rasterizer.cpp
index 2de49d3d81..e21848eac2 100644
--- a/servers/visual/rasterizer.cpp
+++ b/servers/visual/rasterizer.cpp
@@ -157,6 +157,9 @@ RID Rasterizer::_create_shader(const FixedMaterialShaderKey& p_key) {
if (p_key.use_alpha) {
code+="DIFFUSE_ALPHA=diffuse;\n";
+ if (p_key.discard_alpha) {
+ code+="DISCARD=diffuse.a<0.5;\n";
+ }
} else {
code+="DIFFUSE=diffuse.rgb;\n";
}
@@ -262,6 +265,7 @@ void Rasterizer::_free_shader(const FixedMaterialShaderKey& p_key) {
void Rasterizer::fixed_material_set_flag(RID p_material, VS::FixedMaterialFlags p_flag, bool p_enabled) {
+
Map<RID,FixedMaterial*>::Element *E = fixed_materials.find(p_material);
ERR_FAIL_COND(!E);
FixedMaterial &fm=*E->get();
@@ -271,6 +275,7 @@ void Rasterizer::fixed_material_set_flag(RID p_material, VS::FixedMaterialFlags
case VS::FIXED_MATERIAL_FLAG_USE_ALPHA: fm.use_alpha=p_enabled; break;
case VS::FIXED_MATERIAL_FLAG_USE_COLOR_ARRAY: fm.use_color_array=p_enabled; break;
case VS::FIXED_MATERIAL_FLAG_USE_POINT_SIZE: fm.use_pointsize=p_enabled; break;
+ case VS::FIXED_MATERIAL_FLAG_DISCARD_ALPHA: fm.discard_alpha=p_enabled; break;
}
if (!fm.dirty_list.in_list())
@@ -288,6 +293,7 @@ bool Rasterizer::fixed_material_get_flag(RID p_material, VS::FixedMaterialFlags
case VS::FIXED_MATERIAL_FLAG_USE_ALPHA: return fm.use_alpha;; break;
case VS::FIXED_MATERIAL_FLAG_USE_COLOR_ARRAY: return fm.use_color_array;; break;
case VS::FIXED_MATERIAL_FLAG_USE_POINT_SIZE: return fm.use_pointsize;; break;
+ case VS::FIXED_MATERIAL_FLAG_DISCARD_ALPHA: return fm.discard_alpha;; break;
}
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h
index 783231d2e5..a3cdff9859 100644
--- a/servers/visual/rasterizer.h
+++ b/servers/visual/rasterizer.h
@@ -55,6 +55,7 @@ protected:
bool use_alpha:1;
bool use_color_array:1;
bool use_pointsize:1;
+ bool discard_alpha:1;
bool valid:1;
};
@@ -80,6 +81,7 @@ protected:
RID self;
bool use_alpha;
bool use_color_array;
+ bool discard_alpha;
bool use_pointsize;
float point_size;
Transform uv_xform;
@@ -100,6 +102,7 @@ protected:
k.use_alpha=use_alpha;
k.use_color_array=use_color_array;
k.use_pointsize=use_pointsize;
+ k.discard_alpha=discard_alpha;
k.detail_blend=detail_blend;
k.valid=true;
for(int i=0;i<VS::FIXED_MATERIAL_PARAM_MAX;i++) {
@@ -119,6 +122,7 @@ protected:
use_alpha=false;
use_color_array=false;
use_pointsize=false;
+ discard_alpha=false;
point_size=1.0;
detail_blend=VS::MATERIAL_BLEND_MODE_MIX;
for(int i=0;i<VS::FIXED_MATERIAL_PARAM_MAX;i++) {
@@ -298,6 +302,22 @@ public:
virtual void multimesh_set_visible_instances(RID p_multimesh,int p_visible)=0;
virtual int multimesh_get_visible_instances(RID p_multimesh) const=0;
+ /* IMMEDIATE API */
+
+ virtual RID immediate_create()=0;
+ virtual void immediate_begin(RID p_immediate,VS::PrimitiveType p_rimitive,RID p_texture=RID())=0;
+ virtual void immediate_vertex(RID p_immediate,const Vector3& p_vertex)=0;
+ virtual void immediate_normal(RID p_immediate,const Vector3& p_normal)=0;
+ virtual void immediate_tangent(RID p_immediate,const Plane& p_tangent)=0;
+ virtual void immediate_color(RID p_immediate,const Color& p_color)=0;
+ virtual void immediate_uv(RID p_immediate,const Vector2& tex_uv)=0;
+ virtual void immediate_uv2(RID p_immediate,const Vector2& tex_uv)=0;
+ virtual void immediate_end(RID p_immediate)=0;
+ virtual void immediate_clear(RID p_immediate)=0;
+ virtual AABB immediate_get_aabb(RID p_immediate) const=0;
+ virtual void immediate_set_material(RID p_immediate,RID p_material)=0;
+ virtual RID immediate_get_material(RID p_immediate) const=0;
+
/* PARTICLES API */
@@ -487,6 +507,7 @@ public:
virtual void add_mesh( const RID& p_mesh, const InstanceData *p_data)=0;
virtual void add_multimesh( const RID& p_multimesh, const InstanceData *p_data)=0;
+ virtual void add_immediate( const RID& p_immediate, const InstanceData *p_data)=0;
virtual void add_particles( const RID& p_particle_instance, const InstanceData *p_data)=0;
@@ -544,6 +565,7 @@ public:
virtual bool is_material(const RID& p_rid) const=0;
virtual bool is_mesh(const RID& p_rid) const=0;
virtual bool is_multimesh(const RID& p_rid) const=0;
+ virtual bool is_immediate(const RID& p_rid) const=0;
virtual bool is_particles(const RID &p_beam) const=0;
virtual bool is_light(const RID& p_rid) const=0;
diff --git a/servers/visual/rasterizer_dummy.cpp b/servers/visual/rasterizer_dummy.cpp
index 39c02c2037..1d55693bfb 100644
--- a/servers/visual/rasterizer_dummy.cpp
+++ b/servers/visual/rasterizer_dummy.cpp
@@ -709,6 +709,74 @@ int RasterizerDummy::multimesh_get_visible_instances(RID p_multimesh) const {
}
+/* IMMEDIATE API */
+
+
+RID RasterizerDummy::immediate_create() {
+
+ Immediate *im = memnew( Immediate );
+ return immediate_owner.make_rid(im);
+
+}
+
+void RasterizerDummy::immediate_begin(RID p_immediate,VS::PrimitiveType p_rimitive,RID p_texture){
+
+
+}
+void RasterizerDummy::immediate_vertex(RID p_immediate,const Vector3& p_vertex){
+
+
+}
+void RasterizerDummy::immediate_normal(RID p_immediate,const Vector3& p_normal){
+
+
+}
+void RasterizerDummy::immediate_tangent(RID p_immediate,const Plane& p_tangent){
+
+
+}
+void RasterizerDummy::immediate_color(RID p_immediate,const Color& p_color){
+
+
+}
+void RasterizerDummy::immediate_uv(RID p_immediate,const Vector2& tex_uv){
+
+
+}
+void RasterizerDummy::immediate_uv2(RID p_immediate,const Vector2& tex_uv){
+
+
+}
+
+void RasterizerDummy::immediate_end(RID p_immediate){
+
+
+}
+void RasterizerDummy::immediate_clear(RID p_immediate) {
+
+
+}
+
+AABB RasterizerDummy::immediate_get_aabb(RID p_immediate) const {
+
+ return AABB(Vector3(-1,-1,-1),Vector3(2,2,2));
+}
+
+void RasterizerDummy::immediate_set_material(RID p_immediate,RID p_material) {
+
+ Immediate *im = immediate_owner.get(p_immediate);
+ ERR_FAIL_COND(!im);
+ im->material=p_material;
+
+}
+
+RID RasterizerDummy::immediate_get_material(RID p_immediate) const {
+
+ const Immediate *im = immediate_owner.get(p_immediate);
+ ERR_FAIL_COND_V(!im,RID());
+ return im->material;
+
+}
/* PARTICLES API */
@@ -1627,6 +1695,12 @@ bool RasterizerDummy::is_mesh(const RID& p_rid) const {
return mesh_owner.owns(p_rid);
}
+
+bool RasterizerDummy::is_immediate(const RID& p_rid) const {
+
+ return immediate_owner.owns(p_rid);
+}
+
bool RasterizerDummy::is_multimesh(const RID& p_rid) const {
return multimesh_owner.owns(p_rid);
@@ -1703,6 +1777,12 @@ void RasterizerDummy::free(const RID& p_rid) {
multimesh_owner.free(p_rid);
memdelete(multimesh);
+ } else if (immediate_owner.owns(p_rid)) {
+
+ Immediate *immediate = immediate_owner.get(p_rid);
+ immediate_owner.free(p_rid);
+ memdelete(immediate);
+
} else if (particles_owner.owns(p_rid)) {
Particles *particles = particles_owner.get(p_rid);
diff --git a/servers/visual/rasterizer_dummy.h b/servers/visual/rasterizer_dummy.h
index 880e19c9b0..b683a25bdc 100644
--- a/servers/visual/rasterizer_dummy.h
+++ b/servers/visual/rasterizer_dummy.h
@@ -231,8 +231,18 @@ class RasterizerDummy : public Rasterizer {
};
+
mutable RID_Owner<MultiMesh> multimesh_owner;
+ struct Immediate {
+
+
+ RID material;
+ int empty;
+ };
+
+ mutable RID_Owner<Immediate> immediate_owner;
+
struct Particles : public Geometry {
ParticleSystemSW data; // software particle system
@@ -490,6 +500,23 @@ public:
virtual void multimesh_set_visible_instances(RID p_multimesh,int p_visible);
virtual int multimesh_get_visible_instances(RID p_multimesh) const;
+ /* IMMEDIATE API */
+
+ virtual RID immediate_create();
+ virtual void immediate_begin(RID p_immediate,VS::PrimitiveType p_rimitive,RID p_texture=RID());
+ virtual void immediate_vertex(RID p_immediate,const Vector3& p_vertex);
+ virtual void immediate_normal(RID p_immediate,const Vector3& p_normal);
+ virtual void immediate_tangent(RID p_immediate,const Plane& p_tangent);
+ virtual void immediate_color(RID p_immediate,const Color& p_color);
+ virtual void immediate_uv(RID p_immediate,const Vector2& tex_uv);
+ virtual void immediate_uv2(RID p_immediate,const Vector2& tex_uv);
+ virtual void immediate_end(RID p_immediate);
+ virtual void immediate_clear(RID p_immediate);
+ virtual void immediate_set_material(RID p_immediate,RID p_material);
+ virtual RID immediate_get_material(RID p_immediate) const;
+
+ virtual AABB immediate_get_aabb(RID p_mesh) const;
+
/* PARTICLES API */
virtual RID particles_create();
@@ -647,6 +674,7 @@ public:
virtual void add_mesh( const RID& p_mesh, const InstanceData *p_data);
virtual void add_multimesh( const RID& p_multimesh, const InstanceData *p_data);
+ virtual void add_immediate( const RID& p_immediate, const InstanceData *p_data) {}
virtual void add_particles( const RID& p_particle_instance, const InstanceData *p_data);
virtual void end_scene();
@@ -692,6 +720,7 @@ public:
virtual bool is_texture(const RID& p_rid) const;
virtual bool is_material(const RID& p_rid) const;
virtual bool is_mesh(const RID& p_rid) const;
+ virtual bool is_immediate(const RID& p_rid) const;
virtual bool is_multimesh(const RID& p_rid) const;
virtual bool is_particles(const RID &p_beam) const;
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp
index 3061c2ddff..cdc1f678e7 100644
--- a/servers/visual/shader_language.cpp
+++ b/servers/visual/shader_language.cpp
@@ -1034,7 +1034,7 @@ const ShaderLanguage::BuiltinsDef ShaderLanguage::fragment_builtins_defs[]={
{ "SPEC_EXP", TYPE_FLOAT},
{ "GLOW", TYPE_FLOAT},
{ "SHADE_PARAM", TYPE_FLOAT},
- { "DISCARD", TYPE_FLOAT},
+ { "DISCARD", TYPE_BOOL},
{ "SCREEN_UV", TYPE_VEC2},
{ "POINT_COORD", TYPE_VEC2},
{ "INV_CAMERA_MATRIX", TYPE_MAT4},
diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp
index 6b74b34ba1..bffc1c43fe 100644
--- a/servers/visual/visual_server_raster.cpp
+++ b/servers/visual/visual_server_raster.cpp
@@ -519,6 +519,72 @@ int VisualServerRaster::multimesh_get_visible_instances(RID p_multimesh) const {
}
+/* IMMEDIATE API */
+
+
+RID VisualServerRaster::immediate_create() {
+
+ return rasterizer->immediate_create();
+}
+
+void VisualServerRaster::immediate_begin(RID p_immediate,PrimitiveType p_primitive,RID p_texture){
+
+ rasterizer->immediate_begin(p_immediate,p_primitive,p_texture);
+}
+void VisualServerRaster::immediate_vertex(RID p_immediate,const Vector3& p_vertex){
+
+ rasterizer->immediate_vertex(p_immediate,p_vertex);
+
+}
+void VisualServerRaster::immediate_normal(RID p_immediate,const Vector3& p_normal){
+
+ rasterizer->immediate_normal(p_immediate,p_normal);
+
+}
+void VisualServerRaster::immediate_tangent(RID p_immediate,const Plane& p_tangent){
+
+ rasterizer->immediate_tangent(p_immediate,p_tangent);
+
+}
+void VisualServerRaster::immediate_color(RID p_immediate,const Color& p_color){
+
+ rasterizer->immediate_color(p_immediate,p_color);
+
+}
+void VisualServerRaster::immediate_uv(RID p_immediate,const Vector2& p_uv){
+
+ rasterizer->immediate_uv(p_immediate,p_uv);
+
+}
+void VisualServerRaster::immediate_uv2(RID p_immediate,const Vector2& p_uv2){
+
+ rasterizer->immediate_uv2(p_immediate,p_uv2);
+
+}
+void VisualServerRaster::immediate_end(RID p_immediate){
+
+ VS_CHANGED;
+ _dependency_queue_update(p_immediate,true);
+ rasterizer->immediate_end(p_immediate);
+
+}
+void VisualServerRaster::immediate_clear(RID p_immediate){
+
+ VS_CHANGED;
+ _dependency_queue_update(p_immediate,true);
+ rasterizer->immediate_clear(p_immediate);
+
+}
+
+void VisualServerRaster::immediate_set_material(RID p_immediate,RID p_material) {
+
+ rasterizer->immediate_set_material(p_immediate,p_material);
+}
+
+RID VisualServerRaster::immediate_get_material(RID p_immediate) const {
+
+ return rasterizer->immediate_get_material(p_immediate);
+}
/* PARTICLES API */
@@ -1705,6 +1771,8 @@ void VisualServerRaster::instance_set_base(RID p_instance, RID p_base) {
instance->data.morph_values.resize( rasterizer->mesh_get_morph_target_count(p_base));
} else if (rasterizer->is_multimesh(p_base)) {
instance->base_type=INSTANCE_MULTIMESH;
+ } else if (rasterizer->is_immediate(p_base)) {
+ instance->base_type=INSTANCE_IMMEDIATE;
} else if (rasterizer->is_particles(p_base)) {
instance->base_type=INSTANCE_PARTICLES;
instance->particles_info=memnew( Instance::ParticlesInfo );
@@ -2468,6 +2536,12 @@ void VisualServerRaster::_update_instance_aabb(Instance *p_instance) {
new_aabb = rasterizer->multimesh_get_aabb(p_instance->base_rid);
} break;
+ case VisualServer::INSTANCE_IMMEDIATE: {
+
+ new_aabb = rasterizer->immediate_get_aabb(p_instance->base_rid);
+
+
+ } break;
case VisualServer::INSTANCE_PARTICLES: {
new_aabb = rasterizer->particles_get_aabb(p_instance->base_rid);
@@ -3498,6 +3572,9 @@ void VisualServerRaster::_instance_draw(Instance *p_instance) {
case INSTANCE_MULTIMESH: {
rasterizer->add_multimesh(p_instance->base_rid, &p_instance->data);
} break;
+ case INSTANCE_IMMEDIATE: {
+ rasterizer->add_immediate(p_instance->base_rid, &p_instance->data);
+ } break;
case INSTANCE_PARTICLES: {
rasterizer->add_particles(p_instance->particles_info->instance, &p_instance->data);
} break;
diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h
index c281e0b9e6..f6ef4ba6d5 100644
--- a/servers/visual/visual_server_raster.h
+++ b/servers/visual/visual_server_raster.h
@@ -766,6 +766,21 @@ public:
virtual void multimesh_set_visible_instances(RID p_multimesh,int p_visible);
virtual int multimesh_get_visible_instances(RID p_multimesh) const;
+ /* IMMEDIATE API */
+
+ virtual RID immediate_create();
+ virtual void immediate_begin(RID p_immediate,PrimitiveType p_rimitive,RID p_texture=RID());
+ virtual void immediate_vertex(RID p_immediate,const Vector3& p_vertex);
+ virtual void immediate_normal(RID p_immediate,const Vector3& p_normal);
+ virtual void immediate_tangent(RID p_immediate,const Plane& p_tangent);
+ virtual void immediate_color(RID p_immediate,const Color& p_color);
+ virtual void immediate_uv(RID p_immediate, const Vector2& p_uv);
+ virtual void immediate_uv2(RID p_immediate,const Vector2& tex_uv);
+ virtual void immediate_end(RID p_immediate);
+ virtual void immediate_clear(RID p_immediate);
+ virtual void immediate_set_material(RID p_immediate,RID p_material);
+ virtual RID immediate_get_material(RID p_immediate) const;
+
/* PARTICLES API */
diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h
index 87e13cb202..cfc4bd8605 100644
--- a/servers/visual/visual_server_wrap_mt.h
+++ b/servers/visual/visual_server_wrap_mt.h
@@ -741,6 +741,22 @@ public:
FUNC2(multimesh_set_visible_instances,RID,int);
FUNC1RC(int,multimesh_get_visible_instances,RID);
+ /* IMMEDIATE API */
+
+
+ FUNC0R(RID,immediate_create);
+ FUNC3(immediate_begin,RID,PrimitiveType,RID);
+ FUNC2(immediate_vertex,RID,const Vector3&);
+ FUNC2(immediate_normal,RID,const Vector3&);
+ FUNC2(immediate_tangent,RID,const Plane&);
+ FUNC2(immediate_color,RID,const Color&);
+ FUNC2(immediate_uv,RID,const Vector2&);
+ FUNC2(immediate_uv2,RID,const Vector2&);
+ FUNC1(immediate_end,RID);
+ FUNC1(immediate_clear,RID);
+ FUNC2(immediate_set_material,RID,RID);
+ FUNC1RC(RID,immediate_get_material,RID);
+
/* PARTICLES API */
diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp
index a45e2c8eaf..08cc57e307 100644
--- a/servers/visual_server.cpp
+++ b/servers/visual_server.cpp
@@ -274,6 +274,55 @@ RID VisualServer::make_sphere_mesh(int p_lats,int p_lons,float p_radius) {
return mesh;
}
+
+RID VisualServer::material_2d_get(bool p_shaded, bool p_transparent, bool p_cut_alpha, bool p_opaque_prepass) {
+
+ int version=0;
+ if (p_shaded)
+ version=1;
+ if (p_transparent)
+ version|=2;
+ if (p_cut_alpha)
+ version|=4;
+ if (p_opaque_prepass)
+ version|=8;
+ if (material_2d[version].is_valid())
+ return material_2d[version];
+
+ //not valid, make
+
+ material_2d[version]=fixed_material_create();
+ fixed_material_set_flag(material_2d[version],FIXED_MATERIAL_FLAG_USE_ALPHA,p_transparent);
+ fixed_material_set_flag(material_2d[version],FIXED_MATERIAL_FLAG_USE_COLOR_ARRAY,true);
+ fixed_material_set_flag(material_2d[version],FIXED_MATERIAL_FLAG_DISCARD_ALPHA,p_cut_alpha);
+ material_set_flag(material_2d[version],MATERIAL_FLAG_UNSHADED,!p_shaded);
+ material_set_flag(material_2d[version],MATERIAL_FLAG_DOUBLE_SIDED,true);
+ material_set_hint(material_2d[version],MATERIAL_HINT_OPAQUE_PRE_PASS,p_opaque_prepass);
+ fixed_material_set_texture(material_2d[version],FIXED_MATERIAL_PARAM_DIFFUSE,get_white_texture());
+ //material cut alpha?
+ return material_2d[version];
+}
+
+RID VisualServer::get_white_texture() {
+
+ if (white_texture.is_valid())
+ return white_texture;
+
+ DVector<uint8_t> wt;
+ wt.resize(16*3);
+ {
+ DVector<uint8_t>::Write w =wt.write();
+ for(int i=0;i<16*3;i++)
+ w[i]=255;
+ }
+ Image white(4,4,0,Image::FORMAT_RGB,wt);
+ white_texture=texture_create();
+ texture_allocate(white_texture,4,4,Image::FORMAT_RGB);
+ texture_set_data(white_texture,white);
+ return white_texture;
+
+}
+
void VisualServer::_bind_methods() {
diff --git a/servers/visual_server.h b/servers/visual_server.h
index e1793a230e..e5d1e75702 100644
--- a/servers/visual_server.h
+++ b/servers/visual_server.h
@@ -56,6 +56,8 @@ class VisualServer : public Object {
protected:
RID _make_test_cube();
RID test_texture;
+ RID white_texture;
+ RID material_2d[16];
static VisualServer* (*create_func)();
static void _bind_methods();
@@ -189,6 +191,7 @@ public:
MATERIAL_HINT_OPAQUE_PRE_PASS,
MATERIAL_HINT_NO_SHADOW,
MATERIAL_HINT_NO_DEPTH_DRAW,
+ MATERIAL_HINT_NO_DEPTH_DRAW_FOR_ALPHA,
MATERIAL_HINT_MAX
};
@@ -241,6 +244,7 @@ public:
FIXED_MATERIAL_FLAG_USE_ALPHA,
FIXED_MATERIAL_FLAG_USE_COLOR_ARRAY,
FIXED_MATERIAL_FLAG_USE_POINT_SIZE,
+ FIXED_MATERIAL_FLAG_DISCARD_ALPHA,
FIXED_MATERIAL_FLAG_MAX,
};
@@ -360,7 +364,22 @@ public:
virtual void multimesh_set_visible_instances(RID p_multimesh,int p_visible)=0;
virtual int multimesh_get_visible_instances(RID p_multimesh) const=0;
-
+ /* IMMEDIATE API */
+
+ virtual RID immediate_create()=0;
+ virtual void immediate_begin(RID p_immediate,PrimitiveType p_rimitive,RID p_texture=RID())=0;
+ virtual void immediate_vertex(RID p_immediate,const Vector3& p_vertex)=0;
+ virtual void immediate_normal(RID p_immediate,const Vector3& p_normal)=0;
+ virtual void immediate_tangent(RID p_immediate,const Plane& p_tangent)=0;
+ virtual void immediate_color(RID p_immediate,const Color& p_color)=0;
+ virtual void immediate_uv(RID p_immediate,const Vector2& tex_uv)=0;
+ virtual void immediate_uv2(RID p_immediate,const Vector2& tex_uv)=0;
+ virtual void immediate_end(RID p_immediate)=0;
+ virtual void immediate_clear(RID p_immediate)=0;
+ virtual void immediate_set_material(RID p_immediate,RID p_material)=0;
+ virtual RID immediate_get_material(RID p_immediate) const=0;
+
+
/* PARTICLES API */
virtual RID particles_create()=0;
@@ -556,6 +575,8 @@ public:
virtual void portal_set_connect_range(RID p_portal, float p_range) =0;
virtual float portal_get_connect_range(RID p_portal) const =0;
+
+
/* CAMERA API */
virtual RID camera_create()=0;
@@ -675,6 +696,7 @@ public:
ENV_BG_PARAM_CUBEMAP,
ENV_BG_PARAM_ENERGY,
ENV_BG_PARAM_SCALE,
+ ENV_BG_PARAM_GLOW,
ENV_BG_PARAM_MAX
};
@@ -698,8 +720,17 @@ public:
virtual void environment_set_enable_fx(RID p_env,EnvironmentFx p_effect,bool p_enabled)=0;
virtual bool environment_is_fx_enabled(RID p_env,EnvironmentFx p_mode) const=0;
+ enum EnvironmentFxBlurBlendMode {
+ ENV_FX_BLUR_BLEND_MODE_ADDITIVE,
+ ENV_FX_BLUR_BLEND_MODE_SCREEN,
+ ENV_FX_BLUR_BLEND_MODE_SOFTLIGHT,
+ };
+
enum EnvironmentFxParam {
ENV_FX_PARAM_GLOW_BLUR_PASSES,
+ ENV_FX_PARAM_GLOW_BLUR_SCALE,
+ ENV_FX_PARAM_GLOW_BLUR_STRENGTH,
+ ENV_FX_PARAM_GLOW_BLUR_BLEND_MODE,
ENV_FX_PARAM_GLOW_BLOOM,
ENV_FX_PARAM_GLOW_BLOOM_TRESHOLD,
ENV_FX_PARAM_DOF_BLUR_PASSES,
@@ -756,12 +787,13 @@ public:
INSTANCE_NONE,
INSTANCE_MESH,
INSTANCE_MULTIMESH,
+ INSTANCE_IMMEDIATE,
INSTANCE_PARTICLES,
INSTANCE_LIGHT,
INSTANCE_ROOM,
INSTANCE_PORTAL,
- INSTANCE_GEOMETRY_MASK=(1<<INSTANCE_MESH)|(1<<INSTANCE_MULTIMESH)|(1<<INSTANCE_PARTICLES)
+ INSTANCE_GEOMETRY_MASK=(1<<INSTANCE_MESH)|(1<<INSTANCE_MULTIMESH)|(1<<INSTANCE_IMMEDIATE)|(1<<INSTANCE_PARTICLES)
};
@@ -931,6 +963,12 @@ public:
};
virtual int get_render_info(RenderInfo p_info)=0;
+
+
+ /* Materials for 2D on 3D */
+
+
+ RID material_2d_get(bool p_shaded, bool p_transparent, bool p_cut_alpha,bool p_opaque_prepass);
/* TESTING */
@@ -938,6 +976,7 @@ public:
virtual RID get_test_cube()=0;
virtual RID get_test_texture();
+ virtual RID get_white_texture();
virtual RID make_sphere_mesh(int p_lats,int p_lons,float p_radius);