summaryrefslogtreecommitdiff
path: root/servers/visual
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-07-07 17:44:21 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-07-07 17:44:21 -0300
commit9ff6d55822647c87eef392147ea15641d0922d47 (patch)
tree4a132cccc1ecb9f7de27a94475363fcf527986c6 /servers/visual
parent3d68949a1cc41b4865618bddde23122f66764ee1 (diff)
Polygon2D
-=-=-=-=- Another gift for those who make 2D games: -Edit polygons, concave or convex, color them, texture them and uv-map them -Corresponding editor -Can have a custom pivot, so they are compatible with bones and IK
Diffstat (limited to 'servers/visual')
-rw-r--r--servers/visual/rasterizer.cpp2
-rw-r--r--servers/visual/visual_server_raster.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/servers/visual/rasterizer.cpp b/servers/visual/rasterizer.cpp
index 610e9a6a1b..e160b4dccc 100644
--- a/servers/visual/rasterizer.cpp
+++ b/servers/visual/rasterizer.cpp
@@ -96,7 +96,7 @@ RID Rasterizer::_create_shader(const FixedMaterialShaderKey& p_key) {
} else {
uv_str=_TEXUVSTR(VS::FIXED_MATERIAL_PARAM_NORMAL);
}
- scode+="vec3 normal=tex( fmp_normal_tex,"+uv_str+").xyz * 2.0 - vec3(1.0,1.0,1.0);\n";
+ scode+="vec3 normal=tex( fmp_normal_tex,"+uv_str+").xyz * vec3(2.0,2.0,1.0) - vec3(1.0,1.0,0.0);\n";
scode+="NORMAL = mix( NORMAL,mat3(TANGENT,BINORMAL,NORMAL) * normal, fmp_normal);\n";
code+=scode;
}
diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp
index f171b47e9c..7c1f03b71b 100644
--- a/servers/visual/visual_server_raster.cpp
+++ b/servers/visual/visual_server_raster.cpp
@@ -3432,7 +3432,7 @@ void VisualServerRaster::canvas_item_add_triangle_array(RID p_item, const Vector
ERR_FAIL_COND(!canvas_item);
int ps = p_points.size();
- ERR_FAIL_COND(!p_colors.empty() && p_colors.size()!=ps);
+ ERR_FAIL_COND(!p_colors.empty() && p_colors.size()!=ps && p_colors.size()!=1);
ERR_FAIL_COND(!p_uvs.empty() && p_uvs.size()!=ps);
Vector<int> indices = p_indices;