summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorJoosep Jääger <joosep.jaager@gmail.com>2021-05-19 15:12:55 +0300
committerJoosep Jääger <joosep.jaager@gmail.com>2021-05-25 12:15:08 +0300
commit16567321ba49fbba13c79c5613166f6793481e3a (patch)
tree66751d60da7d8d1a5533167e2e971ae7197e3f9c /scene
parentd0aaf4a1fd9e9943436ab6255a6d52257a794ce6 (diff)
Added constants PI, TAU and E to the shader language
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/color_picker.cpp2
-rw-r--r--scene/resources/sky_material.cpp2
2 files changed, 0 insertions, 4 deletions
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index 9ccb2886e1..c0b4563615 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -91,7 +91,6 @@ void ColorPicker::init_shaders() {
wheel_shader.instance();
wheel_shader->set_code(
"shader_type canvas_item;"
- "const float TAU = 6.28318530718;"
"void fragment() {"
" float x = UV.x - 0.5;"
" float y = UV.y - 0.5;"
@@ -111,7 +110,6 @@ void ColorPicker::init_shaders() {
circle_shader.instance();
circle_shader->set_code(
"shader_type canvas_item;"
- "const float TAU = 6.28318530718;"
"uniform float v = 1.0;"
"void fragment() {"
" float x = UV.x - 0.5;"
diff --git a/scene/resources/sky_material.cpp b/scene/resources/sky_material.cpp
index f50ee9c4c8..9d79c22159 100644
--- a/scene/resources/sky_material.cpp
+++ b/scene/resources/sky_material.cpp
@@ -193,7 +193,6 @@ ProceduralSkyMaterial::ProceduralSkyMaterial() {
code += "uniform float ground_energy = 1.0;\n\n";
code += "uniform float sun_angle_max = 1.74;\n";
code += "uniform float sun_curve : hint_range(0, 1) = 0.05;\n\n";
- code += "const float PI = 3.1415926535897932384626433833;\n\n";
code += "void sky() {\n";
code += "\tfloat v_angle = acos(clamp(EYEDIR.y, -1.0, 1.0));\n";
code += "\tfloat c = (1.0 - v_angle / (PI * 0.5));\n";
@@ -499,7 +498,6 @@ PhysicalSkyMaterial::PhysicalSkyMaterial() {
code += "uniform sampler2D night_sky : hint_black;";
- code += "const float PI = 3.141592653589793238462643383279502884197169;\n";
code += "const vec3 UP = vec3( 0.0, 1.0, 0.0 );\n\n";
code += "// Sun constants\n";