From dcdf59cd7396c0f5c47af78639bc60acf96273fa Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Thu, 4 Nov 2021 18:42:57 +0300 Subject: Added 2D boolean hint for particle emitters in visual shaders --- scene/resources/visual_shader.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'scene/resources/visual_shader.cpp') diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index 1c7c96c894..0aa79b8ceb 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -199,6 +199,10 @@ Vector VisualShaderNode::get_editable_properties() const { return Vector(); } +Map VisualShaderNode::get_editable_properties_names() const { + return Map(); +} + Array VisualShaderNode::get_default_input_values() const { Array ret; for (const KeyValue &E : default_input_values) { @@ -1922,6 +1926,10 @@ void VisualShader::_update_shader() const { global_compute_code += " return mat4(vec4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0), vec4(oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0), vec4(oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0), vec4(0, 0, 0, 1));\n"; global_compute_code += "}\n\n"; + global_compute_code += "vec2 __get_random_unit_vec2(inout uint seed) {\n"; + global_compute_code += " return normalize(vec2(__rand_from_seed_m1_p1(seed), __rand_from_seed_m1_p1(seed)));\n"; + global_compute_code += "}\n\n"; + global_compute_code += "vec3 __get_random_unit_vec3(inout uint seed) {\n"; global_compute_code += " return normalize(vec3(__rand_from_seed_m1_p1(seed), __rand_from_seed_m1_p1(seed), __rand_from_seed_m1_p1(seed)));\n"; global_compute_code += "}\n\n"; -- cgit v1.2.3