summaryrefslogtreecommitdiff
path: root/drivers/gles1
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-05-29 10:56:39 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-05-29 10:56:39 -0300
commit6f0b4678e26c04abfc88c0226c803e78a108de98 (patch)
tree51b99b2ece75e5782c0b14c97bb6913c48e7f363 /drivers/gles1
parentd9adf2627a70ab37408aca9ae4140c6280dfe6df (diff)
More 3D Improvements
-=-=-=-=-=-=-=-=-=-= -Sprite3D and AnimatedSprite3D support. -Opaque pre-pass works, is compatible with shadows -Improved shadow map rendering (can differentiate between plain opaque and opaque with shaders/discard/etc) -Added option to use alpha discard in FixedMaterial -Improved Glow FX, many more options (three modes, Additive, Screen and SoftLight), strength and scale -Ability for Background (image or cubemap) to send to glow buffer -Dumb Deploy of clients now actually works in Android -Many Many rendering fixes, 3D is much more usable now.
Diffstat (limited to 'drivers/gles1')
-rw-r--r--drivers/gles1/rasterizer_gles1.cpp81
-rw-r--r--drivers/gles1/rasterizer_gles1.h28
2 files changed, 109 insertions, 0 deletions
diff --git a/drivers/gles1/rasterizer_gles1.cpp b/drivers/gles1/rasterizer_gles1.cpp
index 60c88af508..9e13f12abe 100644
--- a/drivers/gles1/rasterizer_gles1.cpp
+++ b/drivers/gles1/rasterizer_gles1.cpp
@@ -2165,6 +2165,74 @@ int RasterizerGLES1::multimesh_get_visible_instances(RID p_multimesh) const {
}
+/* IMMEDIATE API */
+
+
+RID RasterizerGLES1::immediate_create() {
+
+ Immediate *im = memnew( Immediate );
+ return immediate_owner.make_rid(im);
+
+}
+
+void RasterizerGLES1::immediate_begin(RID p_immediate, VS::PrimitiveType p_rimitive, RID p_texture){
+
+
+}
+void RasterizerGLES1::immediate_vertex(RID p_immediate,const Vector3& p_vertex){
+
+
+}
+void RasterizerGLES1::immediate_normal(RID p_immediate,const Vector3& p_normal){
+
+
+}
+void RasterizerGLES1::immediate_tangent(RID p_immediate,const Plane& p_tangent){
+
+
+}
+void RasterizerGLES1::immediate_color(RID p_immediate,const Color& p_color){
+
+
+}
+void RasterizerGLES1::immediate_uv(RID p_immediate,const Vector2& tex_uv){
+
+
+}
+void RasterizerGLES1::immediate_uv2(RID p_immediate,const Vector2& tex_uv){
+
+
+}
+
+void RasterizerGLES1::immediate_end(RID p_immediate){
+
+
+}
+void RasterizerGLES1::immediate_clear(RID p_immediate) {
+
+
+}
+
+AABB RasterizerGLES1::immediate_get_aabb(RID p_immediate) const {
+
+ return AABB(Vector3(-1,-1,-1),Vector3(2,2,2));
+}
+
+void RasterizerGLES1::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 RasterizerGLES1::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 */
@@ -5327,6 +5395,12 @@ bool RasterizerGLES1::is_mesh(const RID& p_rid) const {
return mesh_owner.owns(p_rid);
}
+
+bool RasterizerGLES1::is_immediate(const RID& p_rid) const {
+
+ return immediate_owner.owns(p_rid);
+}
+
bool RasterizerGLES1::is_multimesh(const RID& p_rid) const {
return multimesh_owner.owns(p_rid);
@@ -5447,6 +5521,13 @@ void RasterizerGLES1::free(const RID& p_rid) {
particles_owner.free(p_rid);
memdelete(particles);
+ } else if (immediate_owner.owns(p_rid)) {
+
+ Immediate *immediate = immediate_owner.get(p_rid);
+ ERR_FAIL_COND(!immediate);
+
+ immediate_owner.free(p_rid);
+ memdelete(immediate);
} else if (particles_instance_owner.owns(p_rid)) {
ParticlesInstance *particles_isntance = particles_instance_owner.get(p_rid);
diff --git a/drivers/gles1/rasterizer_gles1.h b/drivers/gles1/rasterizer_gles1.h
index dbb411c8a3..323d00a467 100644
--- a/drivers/gles1/rasterizer_gles1.h
+++ b/drivers/gles1/rasterizer_gles1.h
@@ -371,6 +371,15 @@ class RasterizerGLES1 : 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
@@ -963,6 +972,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 AABB immediate_get_aabb(RID p_immediate) const;
+ virtual void immediate_set_material(RID p_immediate,RID p_material);
+ virtual RID immediate_get_material(RID p_immediate) const;
+
+
/* PARTICLES API */
virtual RID particles_create();
@@ -1120,6 +1146,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();
@@ -1176,6 +1203,7 @@ public:
virtual bool is_material(const RID& p_rid) const;
virtual bool is_mesh(const RID& p_rid) const;
virtual bool is_multimesh(const RID& p_rid) const;
+ virtual bool is_immediate(const RID& p_rid) const;
virtual bool is_particles(const RID &p_beam) const;
virtual bool is_light(const RID& p_rid) const;