Skip to content

Commit

Permalink
Added missing credit headers, organized code
Browse files Browse the repository at this point in the history
  • Loading branch information
TechDevOnGitHub committed Jul 12, 2022
1 parent 3755bb3 commit 2bad6a0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
5 changes: 0 additions & 5 deletions shaders/lib/atmospherics/sky.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ See AGREEMENT.txt for more information.
*/


vec3 Saturation(vec3 color, float saturation)
{
return mix(vec3(GetLuminance(color)), color, saturation);
}

vec3 GetSkyColor(vec3 viewPos, vec3 lightCol)
{
vec3 result = vec3(0.0);
Expand Down
8 changes: 8 additions & 0 deletions shaders/lib/global.glsl
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
----------------------------------------------------------------
Lux Shader by https://github.com/TechDevOnGithub/
Based on BSL Shaders v7.1.05 by Capt Tatsu https://bitslablab.com
See AGREEMENT.txt for more information.
----------------------------------------------------------------
*/

#include "settings.glsl"
#include "util/constants.glsl"
#include "util/common.glsl"
14 changes: 14 additions & 0 deletions shaders/lib/util/common.glsl
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
----------------------------------------------------------------
Lux Shader by https://github.com/TechDevOnGithub/
Based on BSL Shaders v7.1.05 by Capt Tatsu https://bitslablab.com
See AGREEMENT.txt for more information.
----------------------------------------------------------------
*/


float GetLuminance(vec3 color)
{
return dot(color, vec3(0.2125, 0.7154, 0.0721));
Expand Down Expand Up @@ -99,4 +108,9 @@ vec3 SRGBToLinear(vec3 x)
vec3 linearLo = x / 12.92;
vec3 linearHi = pow((x + 0.055) / 1.055, vec3(2.4));
return mix(linearHi, linearLo, step(x, vec3(0.04045)));
}

vec3 Saturation(vec3 color, float saturation)
{
return mix(vec3(GetLuminance(color)), color, saturation);
}
9 changes: 9 additions & 0 deletions shaders/lib/util/constants.glsl
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
----------------------------------------------------------------
Lux Shader by https://github.com/TechDevOnGithub/
Based on BSL Shaders v7.1.05 by Capt Tatsu https://bitslablab.com
See AGREEMENT.txt for more information.
----------------------------------------------------------------
*/


const float PI = 3.14159265359;
const float TAU = 6.28318530718;
const float PHI = 2.39996322973;
Expand Down

0 comments on commit 2bad6a0

Please sign in to comment.