summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-05-25 18:07:15 +0200
committerGitHub <noreply@github.com>2021-05-25 18:07:15 +0200
commitf1abfbbeb11836dd1e680f02075f3655f1e0c2f0 (patch)
tree36c788d97877f79b74e362b6dc883733a8d2ac3a /scene
parent554382d8ad22313eadf15d6de34ea57d3cf66f94 (diff)
parent16567321ba49fbba13c79c5613166f6793481e3a (diff)
Merge pull request #48837 from Soupstraw/shader-pi
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";