summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorCarl Olsson <carl.olsson@gmail.com>2015-02-02 21:34:47 +1000
committerCarl Olsson <carl.olsson@gmail.com>2015-02-02 21:34:47 +1000
commitee44664b2a14c0878f2e137dc4b6a1fbf4013eab (patch)
tree1a1e4712f96c84a2457200a6047030b72d7981d1 /servers
parentc5bf43f6eb8aa9815362b1f771396e68c7f26f0f (diff)
parent67d357191ff74b2cfc80015941363a97e7ee19fd (diff)
Merge branch 'master' of https://github.com/okamstudio/godot
Diffstat (limited to 'servers')
-rw-r--r--servers/visual/shader_language.cpp1
-rw-r--r--servers/visual/visual_server_raster.cpp85
-rw-r--r--servers/visual/visual_server_raster.h34
-rw-r--r--servers/visual/visual_server_wrap_mt.h23
-rw-r--r--servers/visual_server.h33
5 files changed, 176 insertions, 0 deletions
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp
index 9a76a009a9..dfa0172e82 100644
--- a/servers/visual/shader_language.cpp
+++ b/servers/visual/shader_language.cpp
@@ -1112,6 +1112,7 @@ const ShaderLanguage::BuiltinsDef ShaderLanguage::ci_vertex_builtins_defs[]={
{ "SRC_VERTEX", TYPE_VEC2},
{ "VERTEX", TYPE_VEC2},
+ { "WORLD_VERTEX", TYPE_VEC2},
{ "UV", TYPE_VEC2},
{ "COLOR", TYPE_VEC4},
{ "VAR1", TYPE_VEC4},
diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp
index 118ea3b8e1..6842c66912 100644
--- a/servers/visual/visual_server_raster.cpp
+++ b/servers/visual/visual_server_raster.cpp
@@ -3828,6 +3828,91 @@ void VisualServerRaster::canvas_item_raise(RID p_item) {
}
+/***** CANVAS LIGHT *******/
+
+RID VisualServerRaster::canvas_light_create() {
+
+ return RID();
+}
+
+void VisualServerRaster::canvas_light_attach_to_canvas(RID p_light,RID p_canvas){
+
+
+}
+void VisualServerRaster::canvas_light_set_enabled(RID p_light, bool p_enabled){
+
+
+}
+void VisualServerRaster::canvas_light_set_transform(RID p_light, const Matrix32& p_transform){
+
+
+}
+void VisualServerRaster::canvas_light_set_texture(RID p_light, RID p_texture){
+
+
+}
+void VisualServerRaster::canvas_light_set_texture_offset(RID p_light, const Vector2& p_offset){
+
+
+}
+void VisualServerRaster::canvas_light_set_color(RID p_light, const Color& p_color){
+
+
+}
+void VisualServerRaster::canvas_light_set_height(RID p_light, float p_height){
+
+
+}
+void VisualServerRaster::canvas_light_set_z_range(RID p_light, int p_min_z,int p_max_z){
+
+
+}
+void VisualServerRaster::canvas_light_set_item_mask(RID p_light, int p_mask){
+
+
+}
+
+void VisualServerRaster::canvas_light_set_blend_mode(RID p_light, CanvasLightBlendMode p_blend_mode){
+
+
+}
+void VisualServerRaster::canvas_light_set_shadow_enabled(RID p_light, bool p_enabled){
+
+
+}
+void VisualServerRaster::canvas_light_set_shadow_buffer_size(RID p_light, int p_size){
+
+
+}
+void VisualServerRaster::canvas_light_set_shadow_filter(RID p_light, int p_size){
+
+
+}
+
+/****** CANVAS LIGHT OCCLUDER ******/
+
+RID VisualServerRaster::canvas_light_occluder_create() {
+
+ return RID();
+}
+
+void VisualServerRaster::canvas_light_occluder_attach_to_canvas(RID p_occluder,RID p_canvas) {
+
+
+}
+
+void VisualServerRaster::canvas_light_occluder_set_enabled(RID p_occluder,bool p_enabled){
+
+
+}
+
+void VisualServerRaster::canvas_light_occluder_set_shape(RID p_occluder,const DVector<Vector2>& p_shape){
+
+
+}
+
+
+
/******** CANVAS *********/
diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h
index e270ec1a4a..cd58355873 100644
--- a/servers/visual/visual_server_raster.h
+++ b/servers/visual/visual_server_raster.h
@@ -1122,9 +1122,43 @@ public:
virtual void canvas_item_set_use_parent_shader(RID p_item, bool p_enable);
+
virtual void canvas_item_set_shader_param(RID p_canvas_item, const StringName& p_param, const Variant& p_value);
virtual Variant canvas_item_get_shader_param(RID p_canvas_item, const StringName& p_param) const;
+ virtual RID canvas_light_create();
+ virtual void canvas_light_attach_to_canvas(RID p_light,RID p_canvas);
+ virtual void canvas_light_set_enabled(RID p_light, bool p_enabled);
+ virtual void canvas_light_set_transform(RID p_light, const Matrix32& p_transform);
+ virtual void canvas_light_set_texture(RID p_light, RID p_texture);
+ virtual void canvas_light_set_texture_offset(RID p_light, const Vector2& p_offset);
+ virtual void canvas_light_set_color(RID p_light, const Color& p_color);
+ virtual void canvas_light_set_height(RID p_light, float p_height);
+ virtual void canvas_light_set_z_range(RID p_light, int p_min_z,int p_max_z);
+ virtual void canvas_light_set_item_mask(RID p_light, int p_mask);
+
+ enum CanvasightBlendMode {
+ CANVAS_LIGHT_BLEND_ADD,
+ CANVAS_LIGHT_BLEND_SUB,
+ CANVAS_LIGHT_BLEND_MULTIPLY,
+ CANVAS_LIGHT_BLEND_DODGE,
+ CANVAS_LIGHT_BLEND_BURN,
+ CANVAS_LIGHT_BLEND_LIGHTEN,
+ CANVAS_LIGHT_BLEND_DARKEN,
+ CANVAS_LIGHT_BLEND_OVERLAY,
+ CANVAS_LIGHT_BLEND_SCREEN,
+ };
+ virtual void canvas_light_set_blend_mode(RID p_light, CanvasLightBlendMode p_blend_mode);
+ virtual void canvas_light_set_shadow_enabled(RID p_light, bool p_enabled);
+ virtual void canvas_light_set_shadow_buffer_size(RID p_light, int p_size);
+ virtual void canvas_light_set_shadow_filter(RID p_light, int p_size);
+
+
+ virtual RID canvas_light_occluder_create();
+ virtual void canvas_light_occluder_attach_to_canvas(RID p_occluder,RID p_canvas);
+ virtual void canvas_light_occluder_set_enabled(RID p_occluder,bool p_enabled);
+ virtual void canvas_light_occluder_set_shape(RID p_occluder,const DVector<Vector2>& p_shape);
+
virtual void canvas_item_clear(RID p_item);
virtual void canvas_item_raise(RID p_item);
diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h
index 4ba7b7143c..21f6aad5e5 100644
--- a/servers/visual/visual_server_wrap_mt.h
+++ b/servers/visual/visual_server_wrap_mt.h
@@ -1145,6 +1145,29 @@ public:
FUNC1(canvas_item_clear,RID);
FUNC1(canvas_item_raise,RID);
+ /* CANVAS LIGHT */
+ FUNC0R(RID,canvas_light_create);
+ FUNC2(canvas_light_attach_to_canvas,RID,RID);
+ FUNC2(canvas_light_set_enabled,RID,bool);
+ FUNC2(canvas_light_set_transform,RID,const Matrix32&);
+ FUNC2(canvas_light_set_texture,RID,RID);
+ FUNC2(canvas_light_set_texture_offset,RID,const Vector2&);
+ FUNC2(canvas_light_set_color,RID,const Color&);
+ FUNC2(canvas_light_set_height,RID,float);
+ FUNC3(canvas_light_set_z_range,RID,int,int);
+ FUNC2(canvas_light_set_item_mask,RID,int);
+
+ FUNC2(canvas_light_set_blend_mode,RID,CanvasLightBlendMode);
+ FUNC2(canvas_light_set_shadow_enabled,RID,bool);
+ FUNC2(canvas_light_set_shadow_buffer_size,RID,int);
+ FUNC2(canvas_light_set_shadow_filter,RID,int);
+
+ /* CANVAS OCCLUDER */
+
+ FUNC0R(RID,canvas_light_occluder_create);
+ FUNC2(canvas_light_occluder_attach_to_canvas,RID,RID);
+ FUNC2(canvas_light_occluder_set_enabled,RID,bool);
+ FUNC2(canvas_light_occluder_set_shape,RID,const DVector<Vector2>&);
/* CURSOR */
FUNC2(cursor_set_rotation,float , int ); // radians
diff --git a/servers/visual_server.h b/servers/visual_server.h
index 979355d339..4116e28654 100644
--- a/servers/visual_server.h
+++ b/servers/visual_server.h
@@ -999,6 +999,39 @@ public:
virtual void canvas_item_set_shader_param(RID p_canvas_item, const StringName& p_param, const Variant& p_value)=0;
virtual Variant canvas_item_get_shader_param(RID p_canvas_item, const StringName& p_param) const=0;
+ virtual RID canvas_light_create()=0;
+ virtual void canvas_light_attach_to_canvas(RID p_light,RID p_canvas)=0;
+ virtual void canvas_light_set_enabled(RID p_light, bool p_enabled)=0;
+ virtual void canvas_light_set_transform(RID p_light, const Matrix32& p_transform)=0;
+ virtual void canvas_light_set_texture(RID p_light, RID p_texture)=0;
+ virtual void canvas_light_set_texture_offset(RID p_light, const Vector2& p_offset)=0;
+ virtual void canvas_light_set_color(RID p_light, const Color& p_color)=0;
+ virtual void canvas_light_set_height(RID p_light, float p_height)=0;
+ virtual void canvas_light_set_z_range(RID p_light, int p_min_z,int p_max_z)=0;
+ virtual void canvas_light_set_item_mask(RID p_light, int p_mask)=0;
+
+ enum CanvasLightBlendMode {
+ CANVAS_LIGHT_BLEND_ADD,
+ CANVAS_LIGHT_BLEND_SUB,
+ CANVAS_LIGHT_BLEND_MULTIPLY,
+ CANVAS_LIGHT_BLEND_DODGE,
+ CANVAS_LIGHT_BLEND_BURN,
+ CANVAS_LIGHT_BLEND_LIGHTEN,
+ CANVAS_LIGHT_BLEND_DARKEN,
+ CANVAS_LIGHT_BLEND_OVERLAY,
+ CANVAS_LIGHT_BLEND_SCREEN,
+ };
+ virtual void canvas_light_set_blend_mode(RID p_light, CanvasLightBlendMode p_blend_mode)=0;
+ virtual void canvas_light_set_shadow_enabled(RID p_light, bool p_enabled)=0;
+ virtual void canvas_light_set_shadow_buffer_size(RID p_light, int p_size)=0;
+ virtual void canvas_light_set_shadow_filter(RID p_light, int p_size)=0;
+
+
+ virtual RID canvas_light_occluder_create()=0;
+ virtual void canvas_light_occluder_attach_to_canvas(RID p_occluder,RID p_canvas)=0;
+ virtual void canvas_light_occluder_set_enabled(RID p_occluder,bool p_enabled)=0;
+ virtual void canvas_light_occluder_set_shape(RID p_occluder,const DVector<Vector2>& p_shape)=0;
+
/* CURSOR */
virtual void cursor_set_rotation(float p_rotation, int p_cursor = 0)=0; // radians
virtual void cursor_set_texture(RID p_texture, const Point2 &p_center_offset = Point2(0, 0), int p_cursor=0)=0;