diff options
Diffstat (limited to 'servers/visual')
-rw-r--r-- | servers/visual/shader_language.cpp | 56 | ||||
-rw-r--r-- | servers/visual/visual_server_canvas.cpp | 60 | ||||
-rw-r--r-- | servers/visual/visual_server_scene.h | 28 |
3 files changed, 0 insertions, 144 deletions
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 47e6190cea..834505df9a 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -1897,62 +1897,6 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p return false; } -#if 0 - if (found_builtin) { - - if (p_func->op==OP_CONSTRUCT && all_const) { - - - Vector<float> cdata; - for(int i=0;i<argcount;i++) { - - Variant v = static_cast<ConstantNode*>(p_func->arguments[i+1])->value; - switch(v.get_type()) { - - case Variant::REAL: cdata.push_back(v); break; - case Variant::INT: cdata.push_back(v); break; - case Variant::VECTOR2: { Vector2 v2=v; cdata.push_back(v2.x); cdata.push_back(v2.y); } break; - case Variant::VECTOR3: { Vector3 v3=v; cdata.push_back(v3.x); cdata.push_back(v3.y); cdata.push_back(v3.z);} break; - case Variant::PLANE: { Plane v4=v; cdata.push_back(v4.normal.x); cdata.push_back(v4.normal.y); cdata.push_back(v4.normal.z); cdata.push_back(v4.d); } break; - default: ERR_FAIL_V(NULL); - - } - - } - - ConstantNode *cn = parser.create_node<ConstantNode>(p_func->parent); - Variant data; - switch(p_func->return_cache) { - case TYPE_FLOAT: data = cdata[0]; break; - case TYPE_VEC2: - if (cdata.size()==1) - data = Vector2(cdata[0],cdata[0]); - else - data = Vector2(cdata[0],cdata[1]); - - break; - case TYPE_VEC3: - if (cdata.size()==1) - data = Vector3(cdata[0],cdata[0],cdata[0]); - else - data = Vector3(cdata[0],cdata[1],cdata[2]); - break; - case TYPE_VEC4: - if (cdata.size()==1) - data = Plane(cdata[0],cdata[0],cdata[0],cdata[0]); - else - data = Plane(cdata[0],cdata[1],cdata[2],cdata[3]); - break; - } - - cn->datatype=p_func->return_cache; - cn->value=data; - return cn; - - } - return p_func; - } -#endif // try existing functions.. StringName exclude_function; diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp index 0fed9cc961..532546c5fa 100644 --- a/servers/visual/visual_server_canvas.cpp +++ b/servers/visual/visual_server_canvas.cpp @@ -499,7 +499,6 @@ void VisualServerCanvas::canvas_item_add_multiline(RID p_item, const Vector<Poin pline->antialiased = false; //todo pline->multiline = true; - // if (p_width <= 1) { pline->lines = p_points; pline->line_colors = p_colors; if (pline->line_colors.size() == 0) { @@ -507,66 +506,7 @@ void VisualServerCanvas::canvas_item_add_multiline(RID p_item, const Vector<Poin } else if (pline->line_colors.size() > 1 && pline->line_colors.size() != pline->lines.size()) { pline->line_colors.resize(1); } -#if 0 -//width not yet - } else { - //make a trianglestrip for drawing the line... - Vector2 prev_t; - pline->triangles.resize(p_points.size() * 2); - if (p_antialiased) { - pline->lines.resize(p_points.size() * 2); - } - if (p_colors.size() == 0) { - pline->triangle_colors.push_back(Color(1, 1, 1, 1)); - if (p_antialiased) { - pline->line_colors.push_back(Color(1, 1, 1, 1)); - } - } - if (p_colors.size() == 1) { - pline->triangle_colors = p_colors; - pline->line_colors = p_colors; - } else { - pline->triangle_colors.resize(pline->triangles.size()); - pline->line_colors.resize(pline->lines.size()); - } - - for (int i = 0; i < p_points.size(); i++) { - - Vector2 t; - if (i == p_points.size() - 1) { - t = prev_t; - } else { - t = (p_points[i + 1] - p_points[i]).normalized().tangent(); - if (i == 0) { - prev_t = t; - } - } - - Vector2 tangent = ((t + prev_t).normalized()) * p_width * 0.5; - - if (p_antialiased) { - pline->lines[i] = p_points[i] + tangent; - pline->lines[p_points.size() * 2 - i - 1] = p_points[i] - tangent; - if (pline->line_colors.size() > 1) { - pline->line_colors[i] = p_colors[i]; - pline->line_colors[p_points.size() * 2 - i - 1] = p_colors[i]; - } - } - - pline->triangles[i * 2 + 0] = p_points[i] + tangent; - pline->triangles[i * 2 + 1] = p_points[i] - tangent; - - if (pline->triangle_colors.size() > 1) { - - pline->triangle_colors[i * 2 + 0] = p_colors[i]; - pline->triangle_colors[i * 2 + 1] = p_colors[i]; - } - - prev_t = t; - } - } -#endif canvas_item->rect_dirty = true; canvas_item->commands.push_back(pline); } diff --git a/servers/visual/visual_server_scene.h b/servers/visual/visual_server_scene.h index 4b0c4af09d..689e06de93 100644 --- a/servers/visual/visual_server_scene.h +++ b/servers/visual/visual_server_scene.h @@ -69,34 +69,6 @@ public: Portal() { enabled=true; disable_distance=50; disable_color=Color(); connect_range=0.8; } }; - - struct BakedLight { - - Rasterizer::BakedLightData data; - PoolVector<int> sampler; - AABB octree_aabb; - Size2i octree_tex_size; - Size2i light_tex_size; - - }; - - struct BakedLightSampler { - - float params[BAKED_LIGHT_SAMPLER_MAX]; - int resolution; - Vector<Vector3> dp_cache; - - BakedLightSampler() { - params[BAKED_LIGHT_SAMPLER_STRENGTH]=1.0; - params[BAKED_LIGHT_SAMPLER_ATTENUATION]=1.0; - params[BAKED_LIGHT_SAMPLER_RADIUS]=1.0; - params[BAKED_LIGHT_SAMPLER_DETAIL_RATIO]=0.1; - resolution=16; - } - }; - - void _update_baked_light_sampler_dp_cache(BakedLightSampler * blsamp); - #endif /* CAMERA API */ |