summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2021-10-19 14:57:12 +0200
committerraysan5 <[email protected]>2021-10-19 14:57:12 +0200
commitfec0ce34c5da82fcd36446abddd235e36bc0f5be (patch)
tree1aefbcd77ec9b7d8408806666a086bf41fb8ac98
parent719c1551cc4f773fa667aaf4d34e7d11bc93c85e (diff)
downloadraylib-fec0ce34c5da82fcd36446abddd235e36bc0f5be.tar.gz
raylib-fec0ce34c5da82fcd36446abddd235e36bc0f5be.zip
Remove trailing spaces
-rw-r--r--examples/models/resources/shaders/glsl100/cubemap.fs2
-rw-r--r--examples/models/resources/shaders/glsl100/skybox.fs4
-rw-r--r--examples/models/resources/shaders/glsl330/cubemap.fs2
-rw-r--r--examples/models/resources/shaders/glsl330/skybox.fs2
-rw-r--r--examples/others/resources/shaders/glsl100/point_particle.vs6
-rw-r--r--examples/others/resources/shaders/glsl330/point_particle.vs6
-rw-r--r--examples/shaders/resources/shaders/glsl100/base.fs4
-rw-r--r--examples/shaders/resources/shaders/glsl100/base.vs4
-rw-r--r--examples/shaders/resources/shaders/glsl100/blur.fs8
-rw-r--r--examples/shaders/resources/shaders/glsl100/color_mix.fs4
-rw-r--r--examples/shaders/resources/shaders/glsl100/cross_hatching.fs16
-rw-r--r--examples/shaders/resources/shaders/glsl100/cross_stitching.fs8
-rw-r--r--examples/shaders/resources/shaders/glsl100/cubes_panning.fs12
-rw-r--r--examples/shaders/resources/shaders/glsl100/depth.fs2
-rw-r--r--examples/shaders/resources/shaders/glsl100/distortion.fs4
-rw-r--r--examples/shaders/resources/shaders/glsl100/eratosthenes.fs8
-rw-r--r--examples/shaders/resources/shaders/glsl100/fisheye.fs2
-rw-r--r--examples/shaders/resources/shaders/glsl100/fog.fs6
-rw-r--r--examples/shaders/resources/shaders/glsl100/grayscale.fs4
-rw-r--r--examples/shaders/resources/shaders/glsl100/julia_set.fs6
-rw-r--r--examples/shaders/resources/shaders/glsl100/lighting.fs12
-rw-r--r--examples/shaders/resources/shaders/glsl100/outline.fs27
-rw-r--r--examples/shaders/resources/shaders/glsl100/palette_switch.fs4
-rw-r--r--examples/shaders/resources/shaders/glsl100/pixelizer.fs10
-rw-r--r--examples/shaders/resources/shaders/glsl100/posterization.fs8
-rw-r--r--examples/shaders/resources/shaders/glsl100/predator.fs6
-rw-r--r--examples/shaders/resources/shaders/glsl100/raymarching.fs44
-rw-r--r--examples/shaders/resources/shaders/glsl100/reload.fs28
-rw-r--r--examples/shaders/resources/shaders/glsl100/scanlines.fs2
-rw-r--r--examples/shaders/resources/shaders/glsl100/sobel.fs10
-rw-r--r--examples/shaders/resources/shaders/glsl100/spotlight.fs20
-rw-r--r--examples/shaders/resources/shaders/glsl100/swirl.fs6
-rw-r--r--examples/shaders/resources/shaders/glsl120/base.fs4
-rw-r--r--examples/shaders/resources/shaders/glsl120/base.vs4
-rw-r--r--examples/shaders/resources/shaders/glsl120/base_lighting.vs2
-rw-r--r--examples/shaders/resources/shaders/glsl120/bloom.fs6
-rw-r--r--examples/shaders/resources/shaders/glsl120/blur.fs8
-rw-r--r--examples/shaders/resources/shaders/glsl120/cross_hatching.fs16
-rw-r--r--examples/shaders/resources/shaders/glsl120/cross_stitching.fs8
-rw-r--r--examples/shaders/resources/shaders/glsl120/distortion.fs4
-rw-r--r--examples/shaders/resources/shaders/glsl120/fisheye.fs2
-rw-r--r--examples/shaders/resources/shaders/glsl120/fog.fs6
-rw-r--r--examples/shaders/resources/shaders/glsl120/grayscale.fs4
-rw-r--r--examples/shaders/resources/shaders/glsl120/pixelizer.fs10
-rw-r--r--examples/shaders/resources/shaders/glsl120/posterization.fs8
-rw-r--r--examples/shaders/resources/shaders/glsl120/predator.fs6
-rw-r--r--examples/shaders/resources/shaders/glsl120/scanlines.fs2
-rw-r--r--examples/shaders/resources/shaders/glsl120/sobel.fs10
-rw-r--r--examples/shaders/resources/shaders/glsl120/swirl.fs6
-rw-r--r--examples/shaders/resources/shaders/glsl330/base.fs4
-rw-r--r--examples/shaders/resources/shaders/glsl330/base.vs4
-rw-r--r--examples/shaders/resources/shaders/glsl330/base_lighting_instanced.vs2
-rw-r--r--examples/shaders/resources/shaders/glsl330/bloom.fs6
-rw-r--r--examples/shaders/resources/shaders/glsl330/blur.fs4
-rw-r--r--examples/shaders/resources/shaders/glsl330/color_mix.fs2
-rw-r--r--examples/shaders/resources/shaders/glsl330/cross_hatching.fs8
-rw-r--r--examples/shaders/resources/shaders/glsl330/cross_stitching.fs2
-rw-r--r--examples/shaders/resources/shaders/glsl330/cubes_panning.fs12
-rw-r--r--examples/shaders/resources/shaders/glsl330/depth.fs2
-rw-r--r--examples/shaders/resources/shaders/glsl330/distortion.fs4
-rw-r--r--examples/shaders/resources/shaders/glsl330/eratosthenes.fs8
-rw-r--r--examples/shaders/resources/shaders/glsl330/fisheye.fs2
-rw-r--r--examples/shaders/resources/shaders/glsl330/fog.fs6
-rw-r--r--examples/shaders/resources/shaders/glsl330/grayscale.fs4
-rw-r--r--examples/shaders/resources/shaders/glsl330/julia_set.fs10
-rw-r--r--examples/shaders/resources/shaders/glsl330/lighting.fs12
-rw-r--r--examples/shaders/resources/shaders/glsl330/outline.fs24
-rw-r--r--examples/shaders/resources/shaders/glsl330/overdraw.fs8
-rw-r--r--examples/shaders/resources/shaders/glsl330/posterization.fs4
-rw-r--r--examples/shaders/resources/shaders/glsl330/predator.fs8
-rw-r--r--examples/shaders/resources/shaders/glsl330/raymarching.fs42
-rw-r--r--examples/shaders/resources/shaders/glsl330/reload.fs2
-rw-r--r--examples/shaders/resources/shaders/glsl330/scanlines.fs2
-rw-r--r--examples/shaders/resources/shaders/glsl330/sobel.fs10
-rw-r--r--examples/shaders/resources/shaders/glsl330/spotlight.fs14
-rw-r--r--examples/shaders/resources/shaders/glsl330/swirl.fs6
-rw-r--r--examples/text/resources/shaders/glsl100/alpha_discard.fs4
-rw-r--r--examples/text/resources/shaders/glsl100/sdf.fs2
-rw-r--r--examples/text/resources/shaders/glsl330/sdf.fs2
-rw-r--r--src/rlgl.h8
80 files changed, 310 insertions, 311 deletions
diff --git a/examples/models/resources/shaders/glsl100/cubemap.fs b/examples/models/resources/shaders/glsl100/cubemap.fs
index 402cdea0..7d1bde0a 100644
--- a/examples/models/resources/shaders/glsl100/cubemap.fs
+++ b/examples/models/resources/shaders/glsl100/cubemap.fs
@@ -18,7 +18,7 @@ vec2 SampleSphericalMap(vec3 v)
void main()
{
- // Normalize local position
+ // Normalize local position
vec2 uv = SampleSphericalMap(normalize(fragPosition));
// Fetch color from texture map
diff --git a/examples/models/resources/shaders/glsl100/skybox.fs b/examples/models/resources/shaders/glsl100/skybox.fs
index 4aa4ec9c..0ea6876c 100644
--- a/examples/models/resources/shaders/glsl100/skybox.fs
+++ b/examples/models/resources/shaders/glsl100/skybox.fs
@@ -19,8 +19,8 @@ void main()
else texelColor = textureCube(environmentMap, fragPosition);
vec3 color = vec3(texelColor.x, texelColor.y, texelColor.z);
-
- if (doGamma)// Apply gamma correction
+
+ if (doGamma) // Apply gamma correction
{
color = color/(color + vec3(1.0));
color = pow(color, vec3(1.0/2.2));
diff --git a/examples/models/resources/shaders/glsl330/cubemap.fs b/examples/models/resources/shaders/glsl330/cubemap.fs
index e4d4ddd4..f59003f9 100644
--- a/examples/models/resources/shaders/glsl330/cubemap.fs
+++ b/examples/models/resources/shaders/glsl330/cubemap.fs
@@ -19,7 +19,7 @@ vec2 SampleSphericalMap(vec3 v)
void main()
{
- // Normalize local position
+ // Normalize local position
vec2 uv = SampleSphericalMap(normalize(fragPosition));
// Fetch color from texture map
diff --git a/examples/models/resources/shaders/glsl330/skybox.fs b/examples/models/resources/shaders/glsl330/skybox.fs
index bb96fc3c..d71fef0c 100644
--- a/examples/models/resources/shaders/glsl330/skybox.fs
+++ b/examples/models/resources/shaders/glsl330/skybox.fs
@@ -20,7 +20,7 @@ void main()
else color = texture(environmentMap, fragPosition).rgb;
if (doGamma)// Apply gamma correction
- {
+ {
color = color/(color + vec3(1.0));
color = pow(color, vec3(1.0/2.2));
}
diff --git a/examples/others/resources/shaders/glsl100/point_particle.vs b/examples/others/resources/shaders/glsl100/point_particle.vs
index 890834c4..f3b70074 100644
--- a/examples/others/resources/shaders/glsl100/point_particle.vs
+++ b/examples/others/resources/shaders/glsl100/point_particle.vs
@@ -7,18 +7,18 @@ attribute vec3 vertexPosition;
uniform mat4 mvp;
uniform float currentTime;
-// NOTE: Add here your custom variables
+// NOTE: Add here your custom variables
void main()
{
// Unpack data from vertexPosition
vec2 pos = vertexPosition.xy;
float period = vertexPosition.z;
-
+
// Calculate final vertex position (jiggle it around a bit horizontally)
pos += vec2(100.0, 0.0) * sin(period * currentTime);
gl_Position = mvp * vec4(pos.x, pos.y, 0.0, 1.0);
-
+
// Calculate the screen space size of this particle (also vary it over time)
gl_PointSize = 10.0 - 5.0 * abs(sin(period * currentTime));
} \ No newline at end of file
diff --git a/examples/others/resources/shaders/glsl330/point_particle.vs b/examples/others/resources/shaders/glsl330/point_particle.vs
index e43b91de..e38c8b5a 100644
--- a/examples/others/resources/shaders/glsl330/point_particle.vs
+++ b/examples/others/resources/shaders/glsl330/point_particle.vs
@@ -7,18 +7,18 @@ in vec3 vertexPosition;
uniform mat4 mvp;
uniform float currentTime;
-// NOTE: Add here your custom variables
+// NOTE: Add here your custom variables
void main()
{
// Unpack data from vertexPosition
vec2 pos = vertexPosition.xy;
float period = vertexPosition.z;
-
+
// Calculate final vertex position (jiggle it around a bit horizontally)
pos += vec2(100, 0) * sin(period * currentTime);
gl_Position = mvp * vec4(pos, 0.0, 1.0);
-
+
// Calculate the screen space size of this particle (also vary it over time)
gl_PointSize = 10 - 5 * abs(sin(period * currentTime));
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl100/base.fs b/examples/shaders/resources/shaders/glsl100/base.fs
index c1126423..6a8d44e6 100644
--- a/examples/shaders/resources/shaders/glsl100/base.fs
+++ b/examples/shaders/resources/shaders/glsl100/base.fs
@@ -16,8 +16,8 @@ void main()
{
// Texel color fetching from texture sampler
vec4 texelColor = texture2D(texture0, fragTexCoord);
-
+
// NOTE: Implement here your fragment shader code
-
+
gl_FragColor = texelColor*colDiffuse;
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl100/base.vs b/examples/shaders/resources/shaders/glsl100/base.vs
index 4be76b9e..32e83999 100644
--- a/examples/shaders/resources/shaders/glsl100/base.vs
+++ b/examples/shaders/resources/shaders/glsl100/base.vs
@@ -13,14 +13,14 @@ uniform mat4 mvp;
varying vec2 fragTexCoord;
varying vec4 fragColor;
-// NOTE: Add here your custom variables
+// NOTE: Add here your custom variables
void main()
{
// Send vertex attributes to fragment shader
fragTexCoord = vertexTexCoord;
fragColor = vertexColor;
-
+
// Calculate final vertex position
gl_Position = mvp*vec4(vertexPosition, 1.0);
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl100/blur.fs b/examples/shaders/resources/shaders/glsl100/blur.fs
index 96f780e1..2fef5716 100644
--- a/examples/shaders/resources/shaders/glsl100/blur.fs
+++ b/examples/shaders/resources/shaders/glsl100/blur.fs
@@ -19,14 +19,14 @@ const float renderHeight = 450.0;
vec3 offset = vec3(0.0, 1.3846153846, 3.2307692308);
vec3 weight = vec3(0.2270270270, 0.3162162162, 0.0702702703);
-void main()
-{
+void main()
+{
// Texel color fetching from texture sampler
vec3 tc = texture2D(texture0, fragTexCoord).rgb*weight.x;
-
+
tc += texture2D(texture0, fragTexCoord + vec2(offset.y)/renderWidth, 0.0).rgb*weight.y;
tc += texture2D(texture0, fragTexCoord - vec2(offset.y)/renderWidth, 0.0).rgb*weight.y;
-
+
tc += texture2D(texture0, fragTexCoord + vec2(offset.z)/renderWidth, 0.0).rgb*weight.z;
tc += texture2D(texture0, fragTexCoord - vec2(offset.z)/renderWidth, 0.0).rgb*weight.z;
diff --git a/examples/shaders/resources/shaders/glsl100/color_mix.fs b/examples/shaders/resources/shaders/glsl100/color_mix.fs
index c5c0cb70..a163a8a0 100644
--- a/examples/shaders/resources/shaders/glsl100/color_mix.fs
+++ b/examples/shaders/resources/shaders/glsl100/color_mix.fs
@@ -18,9 +18,9 @@ void main()
// Texel color fetching from texture sampler
vec4 texelColor0 = texture2D(texture0, fragTexCoord);
vec4 texelColor1 = texture2D(texture1, fragTexCoord);
-
+
float x = fract(fragTexCoord.s);
float final = smoothstep(divider - 0.1, divider + 0.1, x);
-
+
gl_FragColor = mix(texelColor0, texelColor1, final);
}
diff --git a/examples/shaders/resources/shaders/glsl100/cross_hatching.fs b/examples/shaders/resources/shaders/glsl100/cross_hatching.fs
index 7d63b0a5..d978de85 100644
--- a/examples/shaders/resources/shaders/glsl100/cross_hatching.fs
+++ b/examples/shaders/resources/shaders/glsl100/cross_hatching.fs
@@ -18,27 +18,27 @@ float lumThreshold02 = 0.7;
float lumThreshold03 = 0.5;
float lumThreshold04 = 0.3;
-void main()
+void main()
{
vec3 tc = vec3(1.0, 1.0, 1.0);
float lum = length(texture2D(texture0, fragTexCoord).rgb);
- if (lum < lumThreshold01)
+ if (lum < lumThreshold01)
{
if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) tc = vec3(0.0, 0.0, 0.0);
- }
+ }
- if (lum < lumThreshold02)
+ if (lum < lumThreshold02)
{
if (mod(gl_FragCoord .x - gl_FragCoord .y, 10.0) == 0.0) tc = vec3(0.0, 0.0, 0.0);
- }
+ }
- if (lum < lumThreshold03)
+ if (lum < lumThreshold03)
{
if (mod(gl_FragCoord .x + gl_FragCoord .y - hatchOffsetY, 10.0) == 0.0) tc = vec3(0.0, 0.0, 0.0);
- }
+ }
- if (lum < lumThreshold04)
+ if (lum < lumThreshold04)
{
if (mod(gl_FragCoord .x - gl_FragCoord .y - hatchOffsetY, 10.0) == 0.0) tc = vec3(0.0, 0.0, 0.0);
}
diff --git a/examples/shaders/resources/shaders/glsl100/cross_stitching.fs b/examples/shaders/resources/shaders/glsl100/cross_stitching.fs
index de6d4f40..a7a348d7 100644
--- a/examples/shaders/resources/shaders/glsl100/cross_stitching.fs
+++ b/examples/shaders/resources/shaders/glsl100/cross_stitching.fs
@@ -29,12 +29,12 @@ vec4 PostFX(sampler2D tex, vec2 uv)
int remX = int(mod(cPos.x, size));
int remY = int(mod(cPos.y, size));
-
+
if (remX == 0 && remY == 0) tlPos = cPos;
-
+
vec2 blPos = tlPos;
blPos.y += (size - 1.0);
-
+
if ((remX == remY) || (((int(cPos.x) - int(blPos.x)) == (int(blPos.y) - int(cPos.y)))))
{
if (invert == 1) c = vec4(0.2, 0.15, 0.05, 1.0);
@@ -45,7 +45,7 @@ vec4 PostFX(sampler2D tex, vec2 uv)
if (invert == 1) c = texture2D(tex, tlPos * vec2(1.0/renderWidth, 1.0/renderHeight)) * 1.4;
else c = vec4(0.0, 0.0, 0.0, 1.0);
}
-
+
return c;
}
diff --git a/examples/shaders/resources/shaders/glsl100/cubes_panning.fs b/examples/shaders/resources/shaders/glsl100/cubes_panning.fs
index 108f0579..9e5eab0f 100644
--- a/examples/shaders/resources/shaders/glsl100/cubes_panning.fs
+++ b/examples/shaders/resources/shaders/glsl100/cubes_panning.fs
@@ -17,21 +17,21 @@ vec2 VectorRotateTime(vec2 v, float speed)
{
float time = uTime*speed;
float localTime = fract(time); // The time domain this works on is 1 sec.
-
+
if ((localTime >= 0.0) && (localTime < 0.25)) angle = 0.0;
else if ((localTime >= 0.25) && (localTime < 0.50)) angle = PI/4.0*sin(2.0*PI*localTime - PI/2.0);
else if ((localTime >= 0.50) && (localTime < 0.75)) angle = PI*0.25;
else if ((localTime >= 0.75) && (localTime < 1.00)) angle = PI/4.0*sin(2.0*PI*localTime);
-
+
// Rotate vector by angle
v -= 0.5;
v = mat2(cos(angle), -sin(angle), sin(angle), cos(angle))*v;
v += 0.5;
-
+
return v;
}
-float Rectangle(in vec2 st, in float size, in float fill)
+float Rectangle(in vec2 st, in float size, in float fill)
{
float roundSize = 0.5 - size/2.0;
float left = step(roundSize, st.x);
@@ -43,7 +43,7 @@ float Rectangle(in vec2 st, in float size, in float fill)
}
void main()
-{
+{
vec2 fragPos = fragTexCoord;
fragPos.xy += uTime/9.0;
@@ -52,7 +52,7 @@ void main()
vec2 fpos = fract(fragPos); // Get the fractional coords
fpos = VectorRotateTime(fpos, 0.2);
-
+
float alpha = Rectangle(fpos, 0.216, 1.0);
vec3 color = vec3(0.3, 0.3, 0.3);
diff --git a/examples/shaders/resources/shaders/glsl100/depth.fs b/examples/shaders/resources/shaders/glsl100/depth.fs
index f6a14eb2..78099278 100644
--- a/examples/shaders/resources/shaders/glsl100/depth.fs
+++ b/examples/shaders/resources/shaders/glsl100/depth.fs
@@ -20,7 +20,7 @@ void main()
// Linearize depth value
float depth = (2.0*zNear)/(zFar + zNear - z*(zFar - zNear));
-
+
// Calculate final fragment color
gl_FragColor = vec4(depth, depth, depth, 1.0f);
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl100/distortion.fs b/examples/shaders/resources/shaders/glsl100/distortion.fs
index 50116ce0..c232be2c 100644
--- a/examples/shaders/resources/shaders/glsl100/distortion.fs
+++ b/examples/shaders/resources/shaders/glsl100/distortion.fs
@@ -23,13 +23,13 @@ void main()
// The following two variables need to be set per eye
vec2 LensCenter = fragTexCoord.x < 0.5 ? LeftLensCenter : RightLensCenter;
vec2 ScreenCenter = fragTexCoord.x < 0.5 ? LeftScreenCenter : RightScreenCenter;
-
+
// Scales input texture coordinates for distortion: vec2 HmdWarp(vec2 fragTexCoord, vec2 LensCenter)
vec2 theta = (fragTexCoord - LensCenter)*ScaleIn; // Scales to [-1, 1]
float rSq = theta.x*theta.x + theta.y*theta.y;
vec2 theta1 = theta*(HmdWarpParam.x + HmdWarpParam.y*rSq + HmdWarpParam.z*rSq*rSq + HmdWarpParam.w*rSq*rSq*rSq);
//vec2 tc = LensCenter + Scale*theta1;
-
+
// Detect whether blue texture coordinates are out of range since these will scaled out the furthest
vec2 thetaBlue = theta1*(ChromaAbParam.z + ChromaAbParam.w*rSq);
vec2 tcBlue = LensCenter + Scale*thetaBlue;
diff --git a/examples/shaders/resources/shaders/glsl100/eratosthenes.fs b/examples/shaders/resources/shaders/glsl100/eratosthenes.fs
index ba6de891..0d5fcc5a 100644
--- a/examples/shaders/resources/shaders/glsl100/eratosthenes.fs
+++ b/examples/shaders/resources/shaders/glsl100/eratosthenes.fs
@@ -11,7 +11,7 @@ precision mediump float;
Each integer is tested to see if it is a prime number. Primes are colored white.
Non-primes are colored with a color that indicates the smallest factor which evenly divdes our integer.
- You can change the scale variable to make a larger or smaller grid.
+ You can change the scale variable to make a larger or smaller grid.
Total number of integers displayed = scale squared, so scale = 100 tests the first 10,000 integers.
WARNING: If you make scale too large, your GPU may bog down!
@@ -27,11 +27,11 @@ vec4 Colorizer(float counter, float maxSize)
{
float red = 0.0, green = 0.0, blue = 0.0;
float normsize = counter/maxSize;
-
+
red = smoothstep(0.3, 0.7, normsize);
green = sin(3.14159*normsize);
blue = 1.0 - smoothstep(0.0, 0.4, normsize);
-
+
return vec4(0.8*red, 0.8*green, 0.8*blue, 1.0);
}
@@ -41,7 +41,7 @@ void main()
float scale = 1000.0; // Makes 100x100 square grid. Change this variable to make a smaller or larger grid.
float value = scale*floor(fragTexCoord.y*scale) + floor(fragTexCoord.x*scale); // Group pixels into boxes representing integer values
int valuei = int(value);
-
+
//if ((valuei == 0) || (valuei == 1) || (valuei == 2)) gl_FragColor = vec4(1.0);
//else
{
diff --git a/examples/shaders/resources/shaders/glsl100/fisheye.fs b/examples/shaders/resources/shaders/glsl100/fisheye.fs
index 8beb3d4a..c8ca0bb0 100644
--- a/examples/shaders/resources/shaders/glsl100/fisheye.fs
+++ b/examples/shaders/resources/shaders/glsl100/fisheye.fs
@@ -23,7 +23,7 @@ void main()
vec2 uv = vec2(0.0);
vec2 xy = 2.0 * fragTexCoord.xy - 1.0;
float d = length(xy);
-
+
if (d < (2.0 - maxFactor))
{
d = length(xy * maxFactor);
diff --git a/examples/shaders/resources/shaders/glsl100/fog.fs b/examples/shaders/resources/shaders/glsl100/fog.fs
index eeb2150f..c3d0e176 100644
--- a/examples/shaders/resources/shaders/glsl100/fog.fs
+++ b/examples/shaders/resources/shaders/glsl100/fog.fs
@@ -54,7 +54,7 @@ void main()
if (lights[i].enabled == 1)
{
vec3 light = vec3(0.0);
-
+
if (lights[i].type == LIGHT_DIRECTIONAL) light = -normalize(lights[i].target - lights[i].position);
if (lights[i].type == LIGHT_POINT) light = normalize(lights[i].position - fragPosition);
@@ -69,10 +69,10 @@ void main()
vec4 finalColor = (texelColor*((colDiffuse + vec4(specular,1))*vec4(lightDot, 1.0)));
finalColor += texelColor*(ambient/10.0);
-
+
// Gamma correction
finalColor = pow(finalColor, vec4(1.0/2.2));
-
+
// Fog calculation
float dist = length(viewPos - fragPosition);
diff --git a/examples/shaders/resources/shaders/glsl100/grayscale.fs b/examples/shaders/resources/shaders/glsl100/grayscale.fs
index 15174ea5..0c01fc5f 100644
--- a/examples/shaders/resources/shaders/glsl100/grayscale.fs
+++ b/examples/shaders/resources/shaders/glsl100/grayscale.fs
@@ -16,10 +16,10 @@ void main()
{
// Texel color fetching from texture sampler
vec4 texelColor = texture2D(texture0, fragTexCoord)*colDiffuse*fragColor;
-
+
// Convert texel color to grayscale using NTSC conversion weights
float gray = dot(texelColor.rgb, vec3(0.299, 0.587, 0.114));
-
+
// Calculate final fragment color
gl_FragColor = vec4(gray, gray, gray, texelColor.a);
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl100/julia_set.fs b/examples/shaders/resources/shaders/glsl100/julia_set.fs
index bce25db1..44d08345 100644
--- a/examples/shaders/resources/shaders/glsl100/julia_set.fs
+++ b/examples/shaders/resources/shaders/glsl100/julia_set.fs
@@ -52,7 +52,7 @@ void main()
We use dot product (z.x * z.x + z.y * z.y) to determine the magnitude (length) squared.
And once the magnitude squared is > 4, then magnitude > 2 is also true (saves computational power).
*************************************************************************************************/
-
+
// The pixel coordinates are scaled so they are on the mandelbrot scale
// NOTE: fragTexCoord already comes as normalized screen coordinates but offset must be normalized before scaling and zoom
vec2 z = vec2((fragTexCoord.x + offset.x/screenDims.x)*2.5/zoom, (fragTexCoord.y + offset.y/screenDims.y)*1.5/zoom);
@@ -70,10 +70,10 @@ void main()
// See http://linas.org/art-gallery/escape/escape.html for more information.
z = ComplexSquare(z) + c;
z = ComplexSquare(z) + c;
-
+
// This last part smooths the color (again see link above).
float smoothVal = float(iter) + 1.0 - (log(log(length(z)))/log(2.0));
-
+
// Normalize the value so it is between 0 and 1.
float norm = smoothVal/float(MAX_ITERATIONS);
diff --git a/examples/shaders/resources/shaders/glsl100/lighting.fs b/examples/shaders/resources/shaders/glsl100/lighting.fs
index 5e4ff64c..73671619 100644
--- a/examples/shaders/resources/shaders/glsl100/lighting.fs
+++ b/examples/shaders/resources/shaders/glsl100/lighting.fs
@@ -53,17 +53,17 @@ void main()
if (lights[i].enabled == 1)
{
vec3 light = vec3(0.0);
-
- if (lights[i].type == LIGHT_DIRECTIONAL)
+
+ if (lights[i].type == LIGHT_DIRECTIONAL)
{
light = -normalize(lights[i].target - lights[i].position);
}
-
- if (lights[i].type == LIGHT_POINT)
+
+ if (lights[i].type == LIGHT_POINT)
{
light = normalize(lights[i].position - fragPosition);
}
-
+
float NdotL = max(dot(normal, light), 0.0);
lightDot += lights[i].color.rgb*NdotL;
@@ -75,7 +75,7 @@ void main()
vec4 finalColor = (texelColor*((colDiffuse + vec4(specular, 1.0))*vec4(lightDot, 1.0)));
finalColor += texelColor*(ambient/10.0);
-
+
// Gamma correction
gl_FragColor = pow(finalColor, vec4(1.0/2.2));
}
diff --git a/examples/shaders/resources/shaders/glsl100/outline.fs b/examples/shaders/resources/shaders/glsl100/outline.fs
index 51b1f322..c64409e9 100644
--- a/examples/shaders/resources/shaders/glsl100/outline.fs
+++ b/examples/shaders/resources/shaders/glsl100/outline.fs
@@ -14,24 +14,21 @@ uniform vec2 textureSize;
uniform float outlineSize;
uniform vec4 outlineColor;
-// Output fragment color
-out vec4 finalColor;
-
void main()
{
- vec4 texel = texture2D(texture0, fragTexCoord); // Get texel color
- vec2 texelScale = vec2(0.0);
+ vec4 texel = texture2D(texture0, fragTexCoord); // Get texel color
+ vec2 texelScale = vec2(0.0);
texelScale.x = outlineSize/textureSize.x;
texelScale.y = outlineSize/textureSize.y;
- // We sample four corner texels, but only for the alpha channel (this is for the outline)
- vec4 corners = vec4(0.0);
- corners.x = texture2D(texture0, fragTexCoord + vec2(texelScale.x, texelScale.y)).a;
- corners.y = texture2D(texture0, fragTexCoord + vec2(texelScale.x, -texelScale.y)).a;
- corners.z = texture2D(texture0, fragTexCoord + vec2(-texelScale.x, texelScale.y)).a;
- corners.w = texture2D(texture0, fragTexCoord + vec2(-texelScale.x, -texelScale.y)).a;
-
- float outline = min(dot(corners, vec4(1.0)), 1.0);
- vec4 color = mix(vec4(0.0), outlineColor, outline);
- gl_FragColor = mix(color, texel, texel.a);
+ // We sample four corner texels, but only for the alpha channel (this is for the outline)
+ vec4 corners = vec4(0.0);
+ corners.x = texture2D(texture0, fragTexCoord + vec2(texelScale.x, texelScale.y)).a;
+ corners.y = texture2D(texture0, fragTexCoord + vec2(texelScale.x, -texelScale.y)).a;
+ corners.z = texture2D(texture0, fragTexCoord + vec2(-texelScale.x, texelScale.y)).a;
+ corners.w = texture2D(texture0, fragTexCoord + vec2(-texelScale.x, -texelScale.y)).a;
+
+ float outline = min(dot(corners, vec4(1.0)), 1.0);
+ vec4 color = mix(vec4(0.0), outlineColor, outline);
+ gl_FragColor = mix(color, texel, texel.a);
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl100/palette_switch.fs b/examples/shaders/resources/shaders/glsl100/palette_switch.fs
index e5b038d6..25b49632 100644
--- a/examples/shaders/resources/shaders/glsl100/palette_switch.fs
+++ b/examples/shaders/resources/shaders/glsl100/palette_switch.fs
@@ -20,9 +20,9 @@ void main()
// Convert the (normalized) texel color RED component (GB would work, too)
// to the palette index by scaling up from [0, 1] to [0, 255].
int index = int(texelColor.r*255.0);
-
+
ivec3 color = ivec3(0);
-
+
// NOTE: On GLSL 100 we are not allowed to index a uniform array by a variable value,
// a constantmust be used, so this logic...
if (index == 0) color = palette[0];
diff --git a/examples/shaders/resources/shaders/glsl100/pixelizer.fs b/examples/shaders/resources/shaders/glsl100/pixelizer.fs
index 44fb0ca2..dae63df2 100644
--- a/examples/shaders/resources/shaders/glsl100/pixelizer.fs
+++ b/examples/shaders/resources/shaders/glsl100/pixelizer.fs
@@ -10,7 +10,7 @@ varying vec4 fragColor;
uniform sampler2D texture0;
uniform vec4 colDiffuse;
-// NOTE: Add here your custom variables
+// NOTE: Add here your custom variables
// NOTE: Render size values must be passed from code
const float renderWidth = 800.0;
@@ -19,13 +19,13 @@ const float renderHeight = 450.0;
float pixelWidth = 5.0;
float pixelHeight = 5.0;
-void main()
-{
+void main()
+{
float dx = pixelWidth*(1.0/renderWidth);
float dy = pixelHeight*(1.0/renderHeight);
-
+
vec2 coord = vec2(dx*floor(fragTexCoord.x/dx), dy*floor(fragTexCoord.y/dy));
-
+
vec3 tc = texture2D(texture0, coord).rgb;
gl_FragColor = vec4(tc, 1.0);
diff --git a/examples/shaders/resources/shaders/glsl100/posterization.fs b/examples/shaders/resources/shaders/glsl100/posterization.fs
index a7942c82..f7060e54 100644
--- a/examples/shaders/resources/shaders/glsl100/posterization.fs
+++ b/examples/shaders/resources/shaders/glsl100/posterization.fs
@@ -15,15 +15,15 @@ uniform vec4 colDiffuse;
float gamma = 0.6;
float numColors = 8.0;
-void main()
-{
+void main()
+{
vec3 color = texture2D(texture0, fragTexCoord.xy).rgb;
-
+
color = pow(color, vec3(gamma, gamma, gamma));
color = color*numColors;
color = floor(color);
color = color/numColors;
color = pow(color, vec3(1.0/gamma));
-
+
gl_FragColor = vec4(color, 1.0);
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl100/predator.fs b/examples/shaders/resources/shaders/glsl100/predator.fs
index 37dc0bdf..e0c0a9d2 100644
--- a/examples/shaders/resources/shaders/glsl100/predator.fs
+++ b/examples/shaders/resources/shaders/glsl100/predator.fs
@@ -12,18 +12,18 @@ uniform vec4 colDiffuse;
// NOTE: Add here your custom variables
-void main()
+void main()
{
vec3 color = texture2D(texture0, fragTexCoord).rgb;
vec3 colors[3];
colors[0] = vec3(0.0, 0.0, 1.0);
colors[1] = vec3(1.0, 1.0, 0.0);
colors[2] = vec3(1.0, 0.0, 0.0);
-
+
float lum = (color.r + color.g + color.b)/3.0;
vec3 tc = vec3(0.0, 0.0, 0.0);
-
+
if (lum < 0.5) tc = mix(colors[0], colors[1], lum/0.5);
else tc = mix(colors[1], colors[2], (lum - 0.5)/0.5);
diff --git a/examples/shaders/resources/shaders/glsl100/raymarching.fs b/examples/shaders/resources/shaders/glsl100/raymarching.fs
index 7535086b..d58d9d33 100644
--- a/examples/shaders/resources/shaders/glsl100/raymarching.fs
+++ b/examples/shaders/resources/shaders/glsl100/raymarching.fs
@@ -2,12 +2,14 @@
precision mediump float;
+#extension GL_OES_standard_derivatives : enable
+
// Input vertex attributes (from vertex shader)
varying vec2 fragTexCoord;
varying vec4 fragColor;
uniform vec3 viewEye;
-uniform vec3 viewCenter;
+uniform vec3 viewCenter;
uniform float runTime;
uniform vec2 resolution;
@@ -31,7 +33,7 @@ uniform vec2 resolution;
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
-// A list of useful distance function to simple primitives, and an example on how to
+// A list of useful distance function to simple primitives, and an example on how to
// do some interesting boolean operations, repetition and displacement.
//
// More info here: http://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm
@@ -142,7 +144,7 @@ float sdPryamid4(vec3 p, vec3 h ) // h = { cos a, sin a, height }
{
// Tetrahedron = Octahedron - Cube
float box = sdBox( p - vec3(0,-2.0*h.z,0), vec3(2.0*h.z) );
-
+
float d = 0.0;
d = max( d, abs( dot(p, vec3( -h.x, h.y, 0 )) ));
d = max( d, abs( dot(p, vec3( h.x, h.y, 0 )) ));
@@ -237,7 +239,7 @@ vec2 map( in vec3 pos )
res = opU( res, vec2( 0.5*sdTorus( opTwist(pos-vec3(-2.0,0.25, 2.0)),vec2(0.20,0.05)), 46.7 ) );
res = opU( res, vec2( sdConeSection( pos-vec3( 0.0,0.35,-2.0), 0.15, 0.2, 0.1 ), 13.67 ) );
res = opU( res, vec2( sdEllipsoid( pos-vec3( 1.0,0.35,-2.0), vec3(0.15, 0.2, 0.05) ), 43.17 ) );
-
+
return res;
}
@@ -245,14 +247,14 @@ vec2 castRay( in vec3 ro, in vec3 rd )
{
float tmin = 0.2;
float tmax = 30.0;
-
+
#if 1
// bounding volume
float tp1 = (0.0-ro.y)/rd.y; if( tp1>0.0 ) tmax = min( tmax, tp1 );
float tp2 = (1.6-ro.y)/rd.y; if( tp2>0.0 ) { if( ro.y>1.6 ) tmin = max( tmin, tp2 );
else tmax = min( tmax, tp2 ); }
#endif
-
+
float t = tmin;
float m = -1.0;
for( int i=0; i<64; i++ )
@@ -286,9 +288,9 @@ float calcSoftshadow( in vec3 ro, in vec3 rd, in float mint, in float tmax )
vec3 calcNormal( in vec3 pos )
{
vec2 e = vec2(1.0,-1.0)*0.5773*0.0005;
- return normalize( e.xyy*map( pos + e.xyy ).x +
- e.yyx*map( pos + e.yyx ).x +
- e.yxy*map( pos + e.yxy ).x +
+ return normalize( e.xyy*map( pos + e.xyy ).x +
+ e.yyx*map( pos + e.yyx ).x +
+ e.yxy*map( pos + e.yxy ).x +
e.xxx*map( pos + e.xxx ).x );
/*
vec3 eps = vec3( 0.0005, 0.0, 0.0 );
@@ -312,7 +314,7 @@ float calcAO( in vec3 pos, in vec3 nor )
occ += -(dd-hr)*sca;
sca *= 0.95;
}
- return clamp( 1.0 - 3.0*occ, 0.0, 1.0 );
+ return clamp( 1.0 - 3.0*occ, 0.0, 1.0 );
}
// http://iquilezles.org/www/articles/checkerfiltering/checkerfiltering.htm
@@ -323,11 +325,11 @@ float checkersGradBox( in vec2 p )
// analytical integral (box filter)
vec2 i = 2.0*(abs(fract((p-0.5*w)*0.5)-0.5)-abs(fract((p+0.5*w)*0.5)-0.5))/w;
// xor pattern
- return 0.5 - 0.5*i.x*i.y;
+ return 0.5 - 0.5*i.x*i.y;
}
vec3 render( in vec3 ro, in vec3 rd )
-{
+{
vec3 col = vec3(0.7, 0.9, 1.0) +rd.y*0.8;
vec2 res = castRay(ro,rd);
float t = res.x;
@@ -337,17 +339,17 @@ vec3 render( in vec3 ro, in vec3 rd )
vec3 pos = ro + t*rd;
vec3 nor = calcNormal( pos );
vec3 ref = reflect( rd, nor );
-
- // material
+
+ // material
col = 0.45 + 0.35*sin( vec3(0.05,0.08,0.10)*(m-1.0) );
if( m<1.5 )
{
-
+
float f = checkersGradBox( 5.0*pos.xz );
col = 0.3 + f*vec3(0.1);
}
- // lighting
+ // lighting
float occ = calcAO( pos, nor );
vec3 lig = normalize( vec3(cos(-0.4 * runTime), sin(0.7 * runTime), -0.6) );
vec3 hal = normalize( lig-rd );
@@ -356,7 +358,7 @@ vec3 render( in vec3 ro, in vec3 rd )
float bac = clamp( dot( nor, normalize(vec3(-lig.x,0.0,-lig.z))), 0.0, 1.0 )*clamp( 1.0-pos.y,0.0,1.0);
float dom = smoothstep( -0.1, 0.1, ref.y );
float fre = pow( clamp(1.0+dot(nor,rd),0.0,1.0), 2.0 );
-
+
dif *= calcSoftshadow( pos, lig, 0.02, 2.5 );
dom *= calcSoftshadow( pos, ref, 0.02, 2.5 );
@@ -398,22 +400,22 @@ void main()
// pixel coordinates
vec2 o = vec2(float(m),float(n)) / float(AA) - 0.5;
vec2 p = (-resolution.xy + 2.0*(gl_FragCoord.xy+o))/resolution.y;
-#else
+#else
vec2 p = (-resolution.xy + 2.0*gl_FragCoord.xy)/resolution.y;
#endif
// RAY: Camera is provided from raylib
//vec3 ro = vec3( -0.5+3.5*cos(0.1*time + 6.0*mo.x), 1.0 + 2.0*mo.y, 0.5 + 4.0*sin(0.1*time + 6.0*mo.x) );
-
+
vec3 ro = viewEye;
vec3 ta = viewCenter;
-
+
// camera-to-world transformation
mat3 ca = setCamera( ro, ta, 0.0 );
// ray direction
vec3 rd = ca * normalize( vec3(p.xy,2.0) );
- // render
+ // render
vec3 col = render( ro, rd );
// gamma
diff --git a/examples/shaders/resources/shaders/glsl100/reload.fs b/examples/shaders/resources/shaders/glsl100/reload.fs
index eda00ae3..d8e44160 100644
--- a/examples/shaders/resources/shaders/glsl100/reload.fs
+++ b/examples/shaders/resources/shaders/glsl100/reload.fs
@@ -14,26 +14,26 @@ uniform float time; // Total run time (in secods)
// Draw circle
vec4 DrawCircle(vec2 fragCoord, vec2 position, float radius, vec3 color)
{
- float d = length(position - fragCoord) - radius;
- float t = clamp(d, 0.0, 1.0);
- return vec4(color, 1.0 - t);
+ float d = length(position - fragCoord) - radius;
+ float t = clamp(d, 0.0, 1.0);
+ return vec4(color, 1.0 - t);
}
void main()
{
- vec2 fragCoord = gl_FragCoord.xy;
- vec2 position = vec2(mouse.x, resolution.y - mouse.y);
- float radius = 40.0;
+ vec2 fragCoord = gl_FragCoord.xy;
+ vec2 position = vec2(mouse.x, resolution.y - mouse.y);
+ float radius = 40.0;
// Draw background layer
vec4 colorA = vec4(0.2,0.2,0.8, 1.0);
vec4 colorB = vec4(1.0,0.7,0.2, 1.0);
- vec4 layer1 = mix(colorA, colorB, abs(sin(time*0.1)));
-
- // Draw circle layer
- vec3 color = vec3(0.9, 0.16, 0.21);
- vec4 layer2 = DrawCircle(fragCoord, position, radius, color);
-
- // Blend the two layers
- gl_FragColor = mix(layer1, layer2, layer2.a);
+ vec4 layer1 = mix(colorA, colorB, abs(sin(time*0.1)));
+
+ // Draw circle layer
+ vec3 color = vec3(0.9, 0.16, 0.21);
+ vec4 layer2 = DrawCircle(fragCoord, position, radius, color);
+
+ // Blend the two layers
+ gl_FragColor = mix(layer1, layer2, layer2.a);
}
diff --git a/examples/shaders/resources/shaders/glsl100/scanlines.fs b/examples/shaders/resources/shaders/glsl100/scanlines.fs
index ce649e1a..74c9c312 100644
--- a/examples/shaders/resources/shaders/glsl100/scanlines.fs
+++ b/examples/shaders/resources/shaders/glsl100/scanlines.fs
@@ -37,7 +37,7 @@ void main()
// Scanlines method 2
float globalPos = (fragTexCoord.y + offset) * frequency;
float wavePos = cos((fract(globalPos) - 0.5)*3.14);
-
+
vec4 color = texture2D(texture0, fragTexCoord);
gl_FragColor = mix(vec4(0.0, 0.3, 0.0, 0.0), color, wavePos);
diff --git a/examples/shaders/resources/shaders/glsl100/sobel.fs b/examples/shaders/resources/shaders/glsl100/sobel.fs
index 3e5c22dd..6468b097 100644
--- a/examples/shaders/resources/shaders/glsl100/sobel.fs
+++ b/examples/shaders/resources/shaders/glsl100/sobel.fs
@@ -13,11 +13,11 @@ uniform vec4 colDiffuse;
// NOTE: Add here your custom variables
vec2 resolution = vec2(800.0, 450.0);
-void main()
+void main()
{
float x = 1.0/resolution.x;
float y = 1.0/resolution.y;
-
+
vec4 horizEdge = vec4(0.0);
horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0;
horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y ))*2.0;
@@ -25,7 +25,7 @@ void main()
horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0;
horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y ))*2.0;
horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0;
-
+
vec4 vertEdge = vec4(0.0);
vertEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0;
vertEdge -= texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y - y))*2.0;
@@ -33,8 +33,8 @@ void main()
vertEdge += texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0;
vertEdge += texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y + y))*2.0;
vertEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0;
-
+
vec3 edge = sqrt((horizEdge.rgb*horizEdge.rgb) + (vertEdge.rgb*vertEdge.rgb));
-
+
gl_FragColor = vec4(edge, texture2D(texture0, fragTexCoord).a);
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl100/spotlight.fs b/examples/shaders/resources/shaders/glsl100/spotlight.fs
index c8d83038..a563421a 100644
--- a/examples/shaders/resources/shaders/glsl100/spotlight.fs
+++ b/examples/shaders/resources/shaders/glsl100/spotlight.fs
@@ -16,10 +16,10 @@ uniform float screenWidth; // Width of the screen
void main()
{
float alpha = 1.0;
-
+
// Get the position of the current fragment (screen coordinates!)
vec2 pos = vec2(gl_FragCoord.x, gl_FragCoord.y);
-
+
// Find out which spotlight is nearest
float d = 65000.0; // some high value
int fi = -1; // found index
@@ -29,18 +29,18 @@ void main()
for (int j = 0; j < MAX_SPOTS; j++)
{
float dj = distance(pos, spots[j].pos) - spots[j].radius + spots[i].radius;
-
- if (d > dj)
+
+ if (d > dj)
{
d = dj;
fi = i;
}
}
}
-
+
// d now equals distance to nearest spot...
// allowing for the different radii of all spotlights
- if (fi == 0)
+ if (fi == 0)
{
if (d > spots[0].radius) alpha = 1.0;
else
@@ -49,7 +49,7 @@ void main()
else alpha = (d - spots[0].inner)/(spots[0].radius - spots[0].inner);
}
}
- else if (fi == 1)
+ else if (fi == 1)
{
if (d > spots[1].radius) alpha = 1.0;
else
@@ -58,7 +58,7 @@ void main()
else alpha = (d - spots[1].inner)/(spots[1].radius - spots[1].inner);
}
}
- else if (fi == 2)
+ else if (fi == 2)
{
if (d > spots[2].radius) alpha = 1.0;
else
@@ -67,8 +67,8 @@ void main()
else alpha = (d - spots[2].inner)/(spots[2].radius - spots[2].inner);
}
}
-
- // Right hand side of screen is dimly lit,
+
+ // Right hand side of screen is dimly lit,
// could make the threshold value user definable
if ((pos.x > screenWidth/2.0) && (alpha > 0.9)) alpha = 0.9;
diff --git a/examples/shaders/resources/shaders/glsl100/swirl.fs b/examples/shaders/resources/shaders/glsl100/swirl.fs
index 7807b807..ec6c6648 100644
--- a/examples/shaders/resources/shaders/glsl100/swirl.fs
+++ b/examples/shaders/resources/shaders/glsl100/swirl.fs
@@ -26,16 +26,16 @@ void main()
vec2 texSize = vec2(renderWidth, renderHeight);
vec2 tc = fragTexCoord*texSize;
tc -= center;
-
+
float dist = length(tc);
- if (dist < radius)
+ if (dist < radius)
{
float percent = (radius - dist)/radius;
float theta = percent*percent*angle*8.0;
float s = sin(theta);
float c = cos(theta);
-
+
tc = vec2(dot(tc, vec2(c, -s)), dot(tc, vec2(s, c)));
}
diff --git a/examples/shaders/resources/shaders/glsl120/base.fs b/examples/shaders/resources/shaders/glsl120/base.fs
index 18799f95..50781ad1 100644
--- a/examples/shaders/resources/shaders/glsl120/base.fs
+++ b/examples/shaders/resources/shaders/glsl120/base.fs
@@ -15,8 +15,8 @@ void main()
{
// Texel color fetching from texture sampler
vec4 texelColor = texture2D(texture0, fragTexCoord);
-
+
// NOTE: Implement here your fragment shader code
-
+
gl_FragColor = texelColor*colDiffuse;
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl120/base.vs b/examples/shaders/resources/shaders/glsl120/base.vs
index 674153d8..08a61e38 100644
--- a/examples/shaders/resources/shaders/glsl120/base.vs
+++ b/examples/shaders/resources/shaders/glsl120/base.vs
@@ -13,14 +13,14 @@ uniform mat4 mvp;
varying vec2 fragTexCoord;
varying vec4 fragColor;
-// NOTE: Add here your custom variables
+// NOTE: Add here your custom variables
void main()
{
// Send vertex attributes to fragment shader
fragTexCoord = vertexTexCoord;
fragColor = vertexColor;
-
+
// Calculate final vertex position
gl_Position = mvp*vec4(vertexPosition, 1.0);
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl120/base_lighting.vs b/examples/shaders/resources/shaders/glsl120/base_lighting.vs
index 678c60e9..b1140939 100644
--- a/examples/shaders/resources/shaders/glsl120/base_lighting.vs
+++ b/examples/shaders/resources/shaders/glsl120/base_lighting.vs
@@ -50,7 +50,7 @@ void main()
fragPosition = vec3(matModel*vec4(vertexPosition, 1.0));
fragTexCoord = vertexTexCoord;
fragColor = vertexColor;
-
+
mat3 normalMatrix = transpose(inverse(mat3(matModel)));
fragNormal = normalize(normalMatrix*vertexNormal);
diff --git a/examples/shaders/resources/shaders/glsl120/bloom.fs b/examples/shaders/resources/shaders/glsl120/bloom.fs
index f97c18ed..b8c44959 100644
--- a/examples/shaders/resources/shaders/glsl120/bloom.fs
+++ b/examples/shaders/resources/shaders/glsl120/bloom.fs
@@ -10,9 +10,9 @@ uniform vec4 colDiffuse;
// NOTE: Add here your custom variables
-const vec2 size = vec2(800, 450); // render size
-const float samples = 5.0; // pixels per axis; higher = bigger glow, worse performance
-const float quality = 2.5; // lower = smaller glow, better quality
+const vec2 size = vec2(800, 450); // Framebuffer size
+const float samples = 5.0; // Pixels per axis; higher = bigger glow, worse performance
+const float quality = 2.5; // Defines size factor: Lower = smaller glow, better quality
void main()
{
diff --git a/examples/shaders/resources/shaders/glsl120/blur.fs b/examples/shaders/resources/shaders/glsl120/blur.fs
index 99cddfc9..cf66d877 100644
--- a/examples/shaders/resources/shaders/glsl120/blur.fs
+++ b/examples/shaders/resources/shaders/glsl120/blur.fs
@@ -17,14 +17,14 @@ const float renderHeight = 450.0;
vec3 offset = vec3(0.0, 1.3846153846, 3.2307692308);
vec3 weight = vec3(0.2270270270, 0.3162162162, 0.0702702703);
-void main()
-{
+void main()
+{
// Texel color fetching from texture sampler
vec3 tc = texture2D(texture0, fragTexCoord).rgb*weight.x;
-
+
tc += texture2D(texture0, fragTexCoord + vec2(offset.y)/renderWidth, 0.0).rgb*weight.y;
tc += texture2D(texture0, fragTexCoord - vec2(offset.y)/renderWidth, 0.0).rgb*weight.y;
-
+
tc += texture2D(texture0, fragTexCoord + vec2(offset.z)/renderWidth, 0.0).rgb*weight.z;
tc += texture2D(texture0, fragTexCoord - vec2(offset.z)/renderWidth, 0.0).rgb*weight.z;
diff --git a/examples/shaders/resources/shaders/glsl120/cross_hatching.fs b/examples/shaders/resources/shaders/glsl120/cross_hatching.fs
index 46514120..14b7e2e1 100644
--- a/examples/shaders/resources/shaders/glsl120/cross_hatching.fs
+++ b/examples/shaders/resources/shaders/glsl120/cross_hatching.fs
@@ -16,27 +16,27 @@ float lumThreshold02 = 0.7;
float lumThreshold03 = 0.5;
float lumThreshold04 = 0.3;
-void main()
+void main()
{
vec3 tc = vec3(1.0, 1.0, 1.0);
float lum = length(texture2D(texture0, fragTexCoord).rgb);
- if (lum < lumThreshold01)
+ if (lum < lumThreshold01)
{
if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) tc = vec3(0.0, 0.0, 0.0);
- }
+ }
- if (lum < lumThreshold02)
+ if (lum < lumThreshold02)
{
if (mod(gl_FragCoord .x - gl_FragCoord .y, 10.0) == 0.0) tc = vec3(0.0, 0.0, 0.0);
- }
+ }
- if (lum < lumThreshold03)
+ if (lum < lumThreshold03)
{
if (mod(gl_FragCoord .x + gl_FragCoord .y - hatchOffsetY, 10.0) == 0.0) tc = vec3(0.0, 0.0, 0.0);
- }
+ }
- if (lum < lumThreshold04)
+ if (lum < lumThreshold04)
{
if (mod(gl_FragCoord .x - gl_FragCoord .y - hatchOffsetY, 10.0) == 0.0) tc = vec3(0.0, 0.0, 0.0);
}
diff --git a/examples/shaders/resources/shaders/glsl120/cross_stitching.fs b/examples/shaders/resources/shaders/glsl120/cross_stitching.fs
index dee4617e..0e0cb7cb 100644
--- a/examples/shaders/resources/shaders/glsl120/cross_stitching.fs
+++ b/examples/shaders/resources/shaders/glsl120/cross_stitching.fs
@@ -27,12 +27,12 @@ vec4 PostFX(sampler2D tex, vec2 uv)
int remX = int(mod(cPos.x, size));
int remY = int(mod(cPos.y, size));
-
+
if (remX == 0 && remY == 0) tlPos = cPos;
-
+
vec2 blPos = tlPos;
blPos.y += (size - 1.0);
-
+
if ((remX == remY) || (((int(cPos.x) - int(blPos.x)) == (int(blPos.y) - int(cPos.y)))))
{
if (invert == 1) c = vec4(0.2, 0.15, 0.05, 1.0);
@@ -43,7 +43,7 @@ vec4 PostFX(sampler2D tex, vec2 uv)
if (invert == 1) c = texture2D(tex, tlPos * vec2(1.0/renderWidth, 1.0/renderHeight)) * 1.4;
else c = vec4(0.0, 0.0, 0.0, 1.0);
}
-
+
return c;
}
diff --git a/examples/shaders/resources/shaders/glsl120/distortion.fs b/examples/shaders/resources/shaders/glsl120/distortion.fs
index f9d7f1e5..cf739814 100644
--- a/examples/shaders/resources/shaders/glsl120/distortion.fs
+++ b/examples/shaders/resources/shaders/glsl120/distortion.fs
@@ -21,13 +21,13 @@ void main()
// The following two variables need to be set per eye
vec2 LensCenter = fragTexCoord.x < 0.5 ? LeftLensCenter : RightLensCenter;
vec2 ScreenCenter = fragTexCoord.x < 0.5 ? LeftScreenCenter : RightScreenCenter;
-
+
// Scales input texture coordinates for distortion: vec2 HmdWarp(vec2 fragTexCoord, vec2 LensCenter)
vec2 theta = (fragTexCoord - LensCenter)*ScaleIn; // Scales to [-1, 1]
float rSq = theta.x*theta.x + theta.y*theta.y;
vec2 theta1 = theta*(HmdWarpParam.x + HmdWarpParam.y*rSq + HmdWarpParam.z*rSq*rSq + HmdWarpParam.w*rSq*rSq*rSq);
//vec2 tc = LensCenter + Scale*theta1;
-
+
// Detect whether blue texture coordinates are out of range since these will scaled out the furthest
vec2 thetaBlue = theta1*(ChromaAbParam.z + ChromaAbParam.w*rSq);
vec2 tcBlue = LensCenter + Scale*thetaBlue;
diff --git a/examples/shaders/resources/shaders/glsl120/fisheye.fs b/examples/shaders/resources/shaders/glsl120/fisheye.fs
index 6f376ba3..5cc57f0e 100644
--- a/examples/shaders/resources/shaders/glsl120/fisheye.fs
+++ b/examples/shaders/resources/shaders/glsl120/fisheye.fs
@@ -21,7 +21,7 @@ void main()
vec2 uv = vec2(0.0);
vec2 xy = 2.0 * fragTexCoord.xy - 1.0;
float d = length(xy);
-
+
if (d < (2.0 - maxFactor))
{
d = length(xy * maxFactor);
diff --git a/examples/shaders/resources/shaders/glsl120/fog.fs b/examples/shaders/resources/shaders/glsl120/fog.fs
index fcd6ef95..63af6c49 100644
--- a/examples/shaders/resources/shaders/glsl120/fog.fs
+++ b/examples/shaders/resources/shaders/glsl120/fog.fs
@@ -52,7 +52,7 @@ void main()
if (lights[i].enabled == 1)
{
vec3 light = vec3(0.0);
-
+
if (lights[i].type == LIGHT_DIRECTIONAL) light = -normalize(lights[i].target - lights[i].position);
if (lights[i].type == LIGHT_POINT) light = normalize(lights[i].position - fragPosition);
@@ -67,10 +67,10 @@ void main()
vec4 finalColor = (texelColor*((colDiffuse + vec4(specular,1))*vec4(lightDot, 1.0)));
finalColor += texelColor*(ambient/10.0);
-
+
// Gamma correction
finalColor = pow(finalColor, vec4(1.0/2.2));
-
+
// Fog calculation
float dist = length(viewPos - fragPosition);
diff --git a/examples/shaders/resources/shaders/glsl120/grayscale.fs b/examples/shaders/resources/shaders/glsl120/grayscale.fs
index 4de60d22..de48f6bb 100644
--- a/examples/shaders/resources/shaders/glsl120/grayscale.fs
+++ b/examples/shaders/resources/shaders/glsl120/grayscale.fs
@@ -14,10 +14,10 @@ void main()
{
// Texel color fetching from texture sampler
vec4 texelColor = texture2D(texture0, fragTexCoord)*colDiffuse*fragColor;
-
+
// Convert texel color to grayscale using NTSC conversion weights
float gray = dot(texelColor.rgb, vec3(0.299, 0.587, 0.114));
-
+
// Calculate final fragment color
gl_FragColor = vec4(gray, gray, gray, texelColor.a);
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl120/pixelizer.fs b/examples/shaders/resources/shaders/glsl120/pixelizer.fs
index 6f741faf..8f5e4f1a 100644
--- a/examples/shaders/resources/shaders/glsl120/pixelizer.fs
+++ b/examples/shaders/resources/shaders/glsl120/pixelizer.fs
@@ -8,7 +8,7 @@ varying vec4 fragColor;
uniform sampler2D texture0;
uniform vec4 colDiffuse;
-// NOTE: Add here your custom variables
+// NOTE: Add here your custom variables
// NOTE: Render size values must be passed from code
const float renderWidth = 800.0;
@@ -17,13 +17,13 @@ const float renderHeight = 450.0;
float pixelWidth = 5.0;
float pixelHeight = 5.0;
-void main()
-{
+void main()
+{
float dx = pixelWidth*(1.0/renderWidth);
float dy = pixelHeight*(1.0/renderHeight);
-
+
vec2 coord = vec2(dx*floor(fragTexCoord.x/dx), dy*floor(fragTexCoord.y/dy));
-
+
vec3 tc = texture2D(texture0, coord).rgb;
gl_FragColor = vec4(tc, 1.0);
diff --git a/examples/shaders/resources/shaders/glsl120/posterization.fs b/examples/shaders/resources/shaders/glsl120/posterization.fs
index 475b93a1..445c925f 100644
--- a/examples/shaders/resources/shaders/glsl120/posterization.fs
+++ b/examples/shaders/resources/shaders/glsl120/posterization.fs
@@ -13,15 +13,15 @@ uniform vec4 colDiffuse;
float gamma = 0.6;
float numColors = 8.0;
-void main()
-{
+void main()
+{
vec3 color = texture2D(texture0, fragTexCoord.xy).rgb;
-
+
color = pow(color, vec3(gamma, gamma, gamma));
color = color*numColors;
color = floor(color);
color = color/numColors;
color = pow(color, vec3(1.0/gamma));
-
+
gl_FragColor = vec4(color, 1.0);
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl120/predator.fs b/examples/shaders/resources/shaders/glsl120/predator.fs
index 2999cc8d..21986965 100644
--- a/examples/shaders/resources/shaders/glsl120/predator.fs
+++ b/examples/shaders/resources/shaders/glsl120/predator.fs
@@ -10,18 +10,18 @@ uniform vec4 colDiffuse;
// NOTE: Add here your custom variables
-void main()
+void main()
{
vec3 color = texture2D(texture0, fragTexCoord).rgb;
vec3 colors[3];
colors[0] = vec3(0.0, 0.0, 1.0);
colors[1] = vec3(1.0, 1.0, 0.0);
colors[2] = vec3(1.0, 0.0, 0.0);
-
+
float lum = (color.r + color.g + color.b)/3.0;
vec3 tc = vec3(0.0, 0.0, 0.0);
-
+
if (lum < 0.5) tc = mix(colors[0], colors[1], lum/0.5);
else tc = mix(colors[1], colors[2], (lum - 0.5)/0.5);
diff --git a/examples/shaders/resources/shaders/glsl120/scanlines.fs b/examples/shaders/resources/shaders/glsl120/scanlines.fs
index 929c79eb..520daa58 100644
--- a/examples/shaders/resources/shaders/glsl120/scanlines.fs
+++ b/examples/shaders/resources/shaders/glsl120/scanlines.fs
@@ -35,7 +35,7 @@ void main()
// Scanlines method 2
float globalPos = (fragTexCoord.y + offset) * frequency;
float wavePos = cos((fract(globalPos) - 0.5)*3.14);
-
+
vec4 color = texture2D(texture0, fragTexCoord);
gl_FragColor = mix(vec4(0.0, 0.3, 0.0, 0.0), color, wavePos);
diff --git a/examples/shaders/resources/shaders/glsl120/sobel.fs b/examples/shaders/resources/shaders/glsl120/sobel.fs
index 73e72703..8c74a6ad 100644
--- a/examples/shaders/resources/shaders/glsl120/sobel.fs
+++ b/examples/shaders/resources/shaders/glsl120/sobel.fs
@@ -11,11 +11,11 @@ uniform vec4 colDiffuse;
// NOTE: Add here your custom variables
vec2 resolution = vec2(800.0, 450.0);
-void main()
+void main()
{
float x = 1.0/resolution.x;
float y = 1.0/resolution.y;
-
+
vec4 horizEdge = vec4(0.0);
horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0;
horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y ))*2.0;
@@ -23,7 +23,7 @@ void main()
horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0;
horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y ))*2.0;
horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0;
-
+
vec4 vertEdge = vec4(0.0);
vertEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0;
vertEdge -= texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y - y))*2.0;
@@ -31,8 +31,8 @@ void main()
vertEdge += texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0;
vertEdge += texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y + y))*2.0;
vertEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0;
-
+
vec3 edge = sqrt((horizEdge.rgb*horizEdge.rgb) + (vertEdge.rgb*vertEdge.rgb));
-
+
gl_FragColor = vec4(edge, texture2D(texture0, fragTexCoord).a);
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl120/swirl.fs b/examples/shaders/resources/shaders/glsl120/swirl.fs
index 0618e013..7b3dd2f9 100644
--- a/examples/shaders/resources/shaders/glsl120/swirl.fs
+++ b/examples/shaders/resources/shaders/glsl120/swirl.fs
@@ -24,16 +24,16 @@ void main()
vec2 texSize = vec2(renderWidth, renderHeight);
vec2 tc = fragTexCoord*texSize;
tc -= center;
-
+
float dist = length(tc);
- if (dist < radius)
+ if (dist < radius)
{
float percent = (radius - dist)/radius;
float theta = percent*percent*angle*8.0;
float s = sin(theta);
float c = cos(theta);
-
+
tc = vec2(dot(tc, vec2(c, -s)), dot(tc, vec2(s, c)));
}
diff --git a/examples/shaders/resources/shaders/glsl330/base.fs b/examples/shaders/resources/shaders/glsl330/base.fs
index f1418df1..6b500622 100644
--- a/examples/shaders/resources/shaders/glsl330/base.fs
+++ b/examples/shaders/resources/shaders/glsl330/base.fs
@@ -17,9 +17,9 @@ void main()
{
// Texel color fetching from texture sampler
vec4 texelColor = texture(texture0, fragTexCoord);
-
+
// NOTE: Implement here your fragment shader code
-
+
finalColor = texelColor*colDiffuse;
}
diff --git a/examples/shaders/resources/shaders/glsl330/base.vs b/examples/shaders/resources/shaders/glsl330/base.vs
index f3099e82..8cc2abb2 100644
--- a/examples/shaders/resources/shaders/glsl330/base.vs
+++ b/examples/shaders/resources/shaders/glsl330/base.vs
@@ -13,14 +13,14 @@ uniform mat4 mvp;
out vec2 fragTexCoord;
out vec4 fragColor;
-// NOTE: Add here your custom variables
+// NOTE: Add here your custom variables
void main()
{
// Send vertex attributes to fragment shader
fragTexCoord = vertexTexCoord;
fragColor = vertexColor;
-
+
// Calculate final vertex position
gl_Position = mvp*vec4(vertexPosition, 1.0);
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl330/base_lighting_instanced.vs b/examples/shaders/resources/shaders/glsl330/base_lighting_instanced.vs
index d198efe1..7f16dc62 100644
--- a/examples/shaders/resources/shaders/glsl330/base_lighting_instanced.vs
+++ b/examples/shaders/resources/shaders/glsl330/base_lighting_instanced.vs
@@ -24,7 +24,7 @@ void main()
{
// Compute MVP for current instance
mat4 mvpi = mvp*instanceTransform;
-
+
// Send vertex attributes to fragment shader
fragPosition = vec3(mvpi*vec4(vertexPosition, 1.0));
fragTexCoord = vertexTexCoord;
diff --git a/examples/shaders/resources/shaders/glsl330/bloom.fs b/examples/shaders/resources/shaders/glsl330/bloom.fs
index 549cde8f..56eadb50 100644
--- a/examples/shaders/resources/shaders/glsl330/bloom.fs
+++ b/examples/shaders/resources/shaders/glsl330/bloom.fs
@@ -13,9 +13,9 @@ out vec4 finalColor;
// NOTE: Add here your custom variables
-const vec2 size = vec2(800, 450); // render size
-const float samples = 5.0; // pixels per axis; higher = bigger glow, worse performance
-const float quality = 2.5; // lower = smaller glow, better quality
+const vec2 size = vec2(800, 450); // Framebuffer size
+const float samples = 5.0; // Pixels per axis; higher = bigger glow, worse performance
+const float quality = 2.5; // Defines size factor: Lower = smaller glow, better quality
void main()
{
diff --git a/examples/shaders/resources/shaders/glsl330/blur.fs b/examples/shaders/resources/shaders/glsl330/blur.fs
index e4df406d..8809f711 100644
--- a/examples/shaders/resources/shaders/glsl330/blur.fs
+++ b/examples/shaders/resources/shaders/glsl330/blur.fs
@@ -24,8 +24,8 @@ void main()
{
// Texel color fetching from texture sampler
vec3 texelColor = texture(texture0, fragTexCoord).rgb*weight[0];
-
- for (int i = 1; i < 3; i++)
+
+ for (int i = 1; i < 3; i++)
{
texelColor += texture(texture0, fragTexCoord + vec2(offset[i])/renderWidth, 0.0).rgb*weight[i];
texelColor += texture(texture0, fragTexCoord - vec2(offset[i])/renderWidth, 0.0).rgb*weight[i];
diff --git a/examples/shaders/resources/shaders/glsl330/color_mix.fs b/examples/shaders/resources/shaders/glsl330/color_mix.fs
index 761b3464..e794d32f 100644
--- a/examples/shaders/resources/shaders/glsl330/color_mix.fs
+++ b/examples/shaders/resources/shaders/glsl330/color_mix.fs
@@ -22,6 +22,6 @@ void main()
float x = fract(fragTexCoord.s);
float final = smoothstep(divider - 0.1, divider + 0.1, x);
-
+
finalColor = mix(texelColor0, texelColor1, final);
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl330/cross_hatching.fs b/examples/shaders/resources/shaders/glsl330/cross_hatching.fs
index f95ad075..276eabd8 100644
--- a/examples/shaders/resources/shaders/glsl330/cross_hatching.fs
+++ b/examples/shaders/resources/shaders/glsl330/cross_hatching.fs
@@ -24,22 +24,22 @@ void main()
vec3 tc = vec3(1.0, 1.0, 1.0);
float lum = length(texture(texture0, fragTexCoord).rgb);
- if (lum < lumThreshold01)
+ if (lum < lumThreshold01)
{
if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) tc = vec3(0.0, 0.0, 0.0);
}
- if (lum < lumThreshold02)
+ if (lum < lumThreshold02)
{
if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) tc = vec3(0.0, 0.0, 0.0);
}
- if (lum < lumThreshold03)
+ if (lum < lumThreshold03)
{
if (mod(gl_FragCoord.x + gl_FragCoord.y - hatchOffsetY, 10.0) == 0.0) tc = vec3(0.0, 0.0, 0.0);
}
- if (lum < lumThreshold04)
+ if (lum < lumThreshold04)
{
if (mod(gl_FragCoord.x - gl_FragCoord.y - hatchOffsetY, 10.0) == 0.0) tc = vec3(0.0, 0.0, 0.0);
}
diff --git a/examples/shaders/resources/shaders/glsl330/cross_stitching.fs b/examples/shaders/resources/shaders/glsl330/cross_stitching.fs
index 9cdd36ca..02be8618 100644
--- a/examples/shaders/resources/shaders/glsl330/cross_stitching.fs
+++ b/examples/shaders/resources/shaders/glsl330/cross_stitching.fs
@@ -47,7 +47,7 @@ vec4 PostFX(sampler2D tex, vec2 uv)
if (invert == 1) c = texture(tex, tlPos * vec2(1.0/renderWidth, 1.0/renderHeight)) * 1.4;
else c = vec4(0.0, 0.0, 0.0, 1.0);
}
-
+
return c;
}
diff --git a/examples/shaders/resources/shaders/glsl330/cubes_panning.fs b/examples/shaders/resources/shaders/glsl330/cubes_panning.fs
index c92418a4..1d75e4e8 100644
--- a/examples/shaders/resources/shaders/glsl330/cubes_panning.fs
+++ b/examples/shaders/resources/shaders/glsl330/cubes_panning.fs
@@ -18,21 +18,21 @@ vec2 VectorRotateTime(vec2 v, float speed)
{
float time = uTime*speed;
float localTime = fract(time); // The time domain this works on is 1 sec.
-
+
if ((localTime >= 0.0) && (localTime < 0.25)) angle = 0.0;
else if ((localTime >= 0.25) && (localTime < 0.50)) angle = PI/4*sin(2*PI*localTime - PI/2);
else if ((localTime >= 0.50) && (localTime < 0.75)) angle = PI*0.25;
else if ((localTime >= 0.75) && (localTime < 1.00)) angle = PI/4*sin(2*PI*localTime);
-
+
// Rotate vector by angle
v -= 0.5;
v = mat2(cos(angle), -sin(angle), sin(angle), cos(angle))*v;
v += 0.5;
-
+
return v;
}
-float Rectangle(in vec2 st, in float size, in float fill)
+float Rectangle(in vec2 st, in float size, in float fill)
{
float roundSize = 0.5 - size/2.0;
float left = step(roundSize, st.x);
@@ -44,7 +44,7 @@ float Rectangle(in vec2 st, in float size, in float fill)
}
void main()
-{
+{
vec2 fragPos = fragTexCoord;
fragPos.xy += uTime/9.0;
@@ -53,7 +53,7 @@ void main()
vec2 fpos = fract(fragPos); // Get the fractional coords
fpos = VectorRotateTime(fpos, 0.2);
-
+
float alpha = Rectangle(fpos, 0.216, 1.0);
vec3 color = vec3(0.3, 0.3, 0.3);
diff --git a/examples/shaders/resources/shaders/glsl330/depth.fs b/examples/shaders/resources/shaders/glsl330/depth.fs
index 2422f390..f7546bbb 100644
--- a/examples/shaders/resources/shaders/glsl330/depth.fs
+++ b/examples/shaders/resources/shaders/glsl330/depth.fs
@@ -21,7 +21,7 @@ void main()
// Linearize depth value
float depth = (2.0*zNear)/(zFar + zNear - z*(zFar - zNear));
-
+
// Calculate final fragment color
finalColor = vec4(depth, depth, depth, 1.0f);
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl330/distortion.fs b/examples/shaders/resources/shaders/glsl330/distortion.fs
index cb4be8fc..43d540db 100644
--- a/examples/shaders/resources/shaders/glsl330/distortion.fs
+++ b/examples/shaders/resources/shaders/glsl330/distortion.fs
@@ -24,13 +24,13 @@ void main()
// The following two variables need to be set per eye
vec2 LensCenter = fragTexCoord.x < 0.5 ? LeftLensCenter : RightLensCenter;
vec2 ScreenCenter = fragTexCoord.x < 0.5 ? LeftScreenCenter : RightScreenCenter;
-
+
// Scales input texture coordinates for distortion: vec2 HmdWarp(vec2 fragTexCoord, vec2 LensCenter)
vec2 theta = (fragTexCoord - LensCenter)*ScaleIn; // Scales to [-1, 1]
float rSq = theta.x*theta.x + theta.y*theta.y;
vec2 theta1 = theta*(HmdWarpParam.x + HmdWarpParam.y*rSq + HmdWarpParam.z*rSq*rSq + HmdWarpParam.w*rSq*rSq*rSq);
//vec2 tc = LensCenter + Scale*theta1;
-
+
// Detect whether blue texture coordinates are out of range since these will scaled out the furthest
vec2 thetaBlue = theta1*(ChromaAbParam.z + ChromaAbParam.w*rSq);
vec2 tcBlue = LensCenter + Scale*thetaBlue;
diff --git a/examples/shaders/resources/shaders/glsl330/eratosthenes.fs b/examples/shaders/resources/shaders/glsl330/eratosthenes.fs
index 14711222..644e38d8 100644
--- a/examples/shaders/resources/shaders/glsl330/eratosthenes.fs
+++ b/examples/shaders/resources/shaders/glsl330/eratosthenes.fs
@@ -9,7 +9,7 @@
Each integer is tested to see if it is a prime number. Primes are colored white.
Non-primes are colored with a color that indicates the smallest factor which evenly divdes our integer.
- You can change the scale variable to make a larger or smaller grid.
+ You can change the scale variable to make a larger or smaller grid.
Total number of integers displayed = scale squared, so scale = 100 tests the first 10,000 integers.
WARNING: If you make scale too large, your GPU may bog down!
@@ -28,11 +28,11 @@ vec4 Colorizer(float counter, float maxSize)
{
float red = 0.0, green = 0.0, blue = 0.0;
float normsize = counter/maxSize;
-
+
red = smoothstep(0.3, 0.7, normsize);
green = sin(3.14159*normsize);
blue = 1.0 - smoothstep(0.0, 0.4, normsize);
-
+
return vec4(0.8*red, 0.8*green, 0.8*blue, 1.0);
}
@@ -45,7 +45,7 @@ void main()
if ((value == 0) || (value == 1) || (value == 2)) finalColor = vec4(1.0);
else
{
- for (int i = 2; (i < max(2, sqrt(value) + 1)); i++)
+ for (int i = 2; (i < max(2, sqrt(value) + 1)); i++)
{
if ((value - i*floor(float(value)/float(i))) == 0)
{
diff --git a/examples/shaders/resources/shaders/glsl330/fisheye.fs b/examples/shaders/resources/shaders/glsl330/fisheye.fs
index e85d7c9d..bb03a615 100644
--- a/examples/shaders/resources/shaders/glsl330/fisheye.fs
+++ b/examples/shaders/resources/shaders/glsl330/fisheye.fs
@@ -7,7 +7,7 @@ out vec4 fragColor;
uniform sampler2D texture0;
uniform vec4 colDiffuse;
-// NOTE: Add here your custom variables
+// NOTE: Add here your custom variables
const float PI = 3.1415926535;
diff --git a/examples/shaders/resources/shaders/glsl330/fog.fs b/examples/shaders/resources/shaders/glsl330/fog.fs
index 2160f31b..445cca31 100644
--- a/examples/shaders/resources/shaders/glsl330/fog.fs
+++ b/examples/shaders/resources/shaders/glsl330/fog.fs
@@ -55,7 +55,7 @@ void main()
if (lights[i].enabled == 1)
{
vec3 light = vec3(0.0);
-
+
if (lights[i].type == LIGHT_DIRECTIONAL) light = -normalize(lights[i].target - lights[i].position);
if (lights[i].type == LIGHT_POINT) light = normalize(lights[i].position - fragPosition);
@@ -70,10 +70,10 @@ void main()
finalColor = (texelColor*((colDiffuse + vec4(specular,1))*vec4(lightDot, 1.0)));
finalColor += texelColor*(ambient/10.0);
-
+
// Gamma correction
finalColor = pow(finalColor, vec4(1.0/2.2));
-
+
// Fog calculation
float dist = length(viewPos - fragPosition);
diff --git a/examples/shaders/resources/shaders/glsl330/grayscale.fs b/examples/shaders/resources/shaders/glsl330/grayscale.fs
index 5b3e11be..dead6ec5 100644
--- a/examples/shaders/resources/shaders/glsl330/grayscale.fs
+++ b/examples/shaders/resources/shaders/glsl330/grayscale.fs
@@ -17,10 +17,10 @@ void main()
{
// Texel color fetching from texture sampler
vec4 texelColor = texture(texture0, fragTexCoord)*colDiffuse*fragColor;
-
+
// Convert texel color to grayscale using NTSC conversion weights
float gray = dot(texelColor.rgb, vec3(0.299, 0.587, 0.114));
-
+
// Calculate final fragment color
finalColor = vec4(gray, gray, gray, texelColor.a);
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl330/julia_set.fs b/examples/shaders/resources/shaders/glsl330/julia_set.fs
index f68367ea..c5ee0da6 100644
--- a/examples/shaders/resources/shaders/glsl330/julia_set.fs
+++ b/examples/shaders/resources/shaders/glsl330/julia_set.fs
@@ -51,7 +51,7 @@ void main()
We use dot product (z.x * z.x + z.y * z.y) to determine the magnitude (length) squared.
And once the magnitude squared is > 4, then magnitude > 2 is also true (saves computational power).
*************************************************************************************************/
-
+
// The pixel coordinates are scaled so they are on the mandelbrot scale
// NOTE: fragTexCoord already comes as normalized screen coordinates but offset must be normalized before scaling and zoom
vec2 z = vec2((fragTexCoord.x + offset.x/screenDims.x)*2.5/zoom, (fragTexCoord.y + offset.y/screenDims.y)*1.5/zoom);
@@ -60,18 +60,18 @@ void main()
for (iterations = 0; iterations < MAX_ITERATIONS; iterations++)
{
z = ComplexSquare(z) + c; // Iterate function
-
+
if (dot(z, z) > 4.0) break;
}
-
+
// Another few iterations decreases errors in the smoothing calculation.
// See http://linas.org/art-gallery/escape/escape.html for more information.
z = ComplexSquare(z) + c;
z = ComplexSquare(z) + c;
-
+
// This last part smooths the color (again see link above).
float smoothVal = float(iterations) + 1.0 - (log(log(length(z)))/log(2.0));
-
+
// Normalize the value so it is between 0 and 1.
float norm = smoothVal/float(MAX_ITERATIONS);
diff --git a/examples/shaders/resources/shaders/glsl330/lighting.fs b/examples/shaders/resources/shaders/glsl330/lighting.fs
index 6877c1c7..93be20ed 100644
--- a/examples/shaders/resources/shaders/glsl330/lighting.fs
+++ b/examples/shaders/resources/shaders/glsl330/lighting.fs
@@ -54,17 +54,17 @@ void main()
if (lights[i].enabled == 1)
{
vec3 light = vec3(0.0);
-
- if (lights[i].type == LIGHT_DIRECTIONAL)
+
+ if (lights[i].type == LIGHT_DIRECTIONAL)
{
light = -normalize(lights[i].target - lights[i].position);
}
-
- if (lights[i].type == LIGHT_POINT)
+
+ if (lights[i].type == LIGHT_POINT)
{
light = normalize(lights[i].position - fragPosition);
}
-
+
float NdotL = max(dot(normal, light), 0.0);
lightDot += lights[i].color.rgb*NdotL;
@@ -76,7 +76,7 @@ void main()
finalColor = (texelColor*((colDiffuse + vec4(specular, 1.0))*vec4(lightDot, 1.0)));
finalColor += texelColor*(ambient/10.0)*colDiffuse;
-
+
// Gamma correction
finalColor = pow(finalColor, vec4(1.0/2.2));
}
diff --git a/examples/shaders/resources/shaders/glsl330/outline.fs b/examples/shaders/resources/shaders/glsl330/outline.fs
index 804a1a59..2584a21c 100644
--- a/examples/shaders/resources/shaders/glsl330/outline.fs
+++ b/examples/shaders/resources/shaders/glsl330/outline.fs
@@ -17,19 +17,19 @@ out vec4 finalColor;
void main()
{
- vec4 texel = texture(texture0, fragTexCoord); // Get texel color
- vec2 texelScale = vec2(0.0);
+ vec4 texel = texture(texture0, fragTexCoord); // Get texel color
+ vec2 texelScale = vec2(0.0);
texelScale.x = outlineSize/textureSize.x;
texelScale.y = outlineSize/textureSize.y;
- // We sample four corner texels, but only for the alpha channel (this is for the outline)
- vec4 corners = vec4(0.0);
- corners.x = texture(texture0, fragTexCoord + vec2(texelScale.x, texelScale.y)).a;
- corners.y = texture(texture0, fragTexCoord + vec2(texelScale.x, -texelScale.y)).a;
- corners.z = texture(texture0, fragTexCoord + vec2(-texelScale.x, texelScale.y)).a;
- corners.w = texture(texture0, fragTexCoord + vec2(-texelScale.x, -texelScale.y)).a;
-
- float outline = min(dot(corners, vec4(1.0)), 1.0);
- vec4 color = mix(vec4(0.0), outlineColor, outline);
- finalColor = mix(color, texel, texel.a);
+ // We sample four corner texels, but only for the alpha channel (this is for the outline)
+ vec4 corners = vec4(0.0);
+ corners.x = texture(texture0, fragTexCoord + vec2(texelScale.x, texelScale.y)).a;
+ corners.y = texture(texture0, fragTexCoord + vec2(texelScale.x, -texelScale.y)).a;
+ corners.z = texture(texture0, fragTexCoord + vec2(-texelScale.x, texelScale.y)).a;
+ corners.w = texture(texture0, fragTexCoord + vec2(-texelScale.x, -texelScale.y)).a;
+
+ float outline = min(dot(corners, vec4(1.0)), 1.0);
+ vec4 color = mix(vec4(0.0), outlineColor, outline);
+ finalColor = mix(color, texel, texel.a);
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl330/overdraw.fs b/examples/shaders/resources/shaders/glsl330/overdraw.fs
index 435217c3..d1a4b6aa 100644
--- a/examples/shaders/resources/shaders/glsl330/overdraw.fs
+++ b/examples/shaders/resources/shaders/glsl330/overdraw.fs
@@ -15,12 +15,12 @@ out vec4 finalColor;
void main()
{
- // To show overdraw, we just render all the fragments
+ // To show overdraw, we just render all the fragments
// with a solid color and some transparency
-
- // NOTE: This is not a postpro render,
+
+ // NOTE: This is not a postpro render,
// it will only render all screen texture in a plain color
-
+
finalColor = vec4(1.0, 0.0, 0.0, 0.2);
}
diff --git a/examples/shaders/resources/shaders/glsl330/posterization.fs b/examples/shaders/resources/shaders/glsl330/posterization.fs
index be2b5dd6..cf845852 100644
--- a/examples/shaders/resources/shaders/glsl330/posterization.fs
+++ b/examples/shaders/resources/shaders/glsl330/posterization.fs
@@ -20,12 +20,12 @@ void main()
{
// Texel color fetching from texture sampler
vec3 texelColor = texture(texture0, fragTexCoord.xy).rgb;
-
+
texelColor = pow(texelColor, vec3(gamma, gamma, gamma));
texelColor = texelColor*numColors;
texelColor = floor(texelColor);
texelColor = texelColor/numColors;
texelColor = pow(texelColor, vec3(1.0/gamma));
-
+
finalColor = vec4(texelColor, 1.0);
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl330/predator.fs b/examples/shaders/resources/shaders/glsl330/predator.fs
index 6a55c762..c0db7b37 100644
--- a/examples/shaders/resources/shaders/glsl330/predator.fs
+++ b/examples/shaders/resources/shaders/glsl330/predator.fs
@@ -21,12 +21,12 @@ void main()
colors[0] = vec3(0.0, 0.0, 1.0);
colors[1] = vec3(1.0, 1.0, 0.0);
colors[2] = vec3(1.0, 0.0, 0.0);
-
+
float lum = (texelColor.r + texelColor.g + texelColor.b)/3.0;
-
+
int ix = (lum < 0.5)? 0:1;
-
+
vec3 tc = mix(colors[ix], colors[ix + 1], (lum - float(ix)*0.5)/0.5);
-
+
finalColor = vec4(tc, 1.0);
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl330/raymarching.fs b/examples/shaders/resources/shaders/glsl330/raymarching.fs
index 5b0caa65..6a9eb451 100644
--- a/examples/shaders/resources/shaders/glsl330/raymarching.fs
+++ b/examples/shaders/resources/shaders/glsl330/raymarching.fs
@@ -8,7 +8,7 @@ in vec4 fragColor;
out vec4 finalColor;
uniform vec3 viewEye;
-uniform vec3 viewCenter;
+uniform vec3 viewCenter;
uniform float runTime;
uniform vec2 resolution;
@@ -32,7 +32,7 @@ uniform vec2 resolution;
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
-// A list of useful distance function to simple primitives, and an example on how to
+// A list of useful distance function to simple primitives, and an example on how to
// do some interesting boolean operations, repetition and displacement.
//
// More info here: http://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm
@@ -143,7 +143,7 @@ float sdPryamid4(vec3 p, vec3 h ) // h = { cos a, sin a, height }
{
// Tetrahedron = Octahedron - Cube
float box = sdBox( p - vec3(0,-2.0*h.z,0), vec3(2.0*h.z) );
-
+
float d = 0.0;
d = max( d, abs( dot(p, vec3( -h.x, h.y, 0 )) ));
d = max( d, abs( dot(p, vec3( h.x, h.y, 0 )) ));
@@ -238,7 +238,7 @@ vec2 map( in vec3 pos )
res = opU( res, vec2( 0.5*sdTorus( opTwist(pos-vec3(-2.0,0.25, 2.0)),vec2(0.20,0.05)), 46.7 ) );
res = opU( res, vec2( sdConeSection( pos-vec3( 0.0,0.35,-2.0), 0.15, 0.2, 0.1 ), 13.67 ) );
res = opU( res, vec2( sdEllipsoid( pos-vec3( 1.0,0.35,-2.0), vec3(0.15, 0.2, 0.05) ), 43.17 ) );
-
+
return res;
}
@@ -246,14 +246,14 @@ vec2 castRay( in vec3 ro, in vec3 rd )
{
float tmin = 0.2;
float tmax = 30.0;
-
+
#if 1
// bounding volume
float tp1 = (0.0-ro.y)/rd.y; if( tp1>0.0 ) tmax = min( tmax, tp1 );
float tp2 = (1.6-ro.y)/rd.y; if( tp2>0.0 ) { if( ro.y>1.6 ) tmin = max( tmin, tp2 );
else tmax = min( tmax, tp2 ); }
#endif
-
+
float t = tmin;
float m = -1.0;
for( int i=0; i<64; i++ )
@@ -287,9 +287,9 @@ float calcSoftshadow( in vec3 ro, in vec3 rd, in float mint, in float tmax )
vec3 calcNormal( in vec3 pos )
{
vec2 e = vec2(1.0,-1.0)*0.5773*0.0005;
- return normalize( e.xyy*map( pos + e.xyy ).x +
- e.yyx*map( pos + e.yyx ).x +
- e.yxy*map( pos + e.yxy ).x +
+ return normalize( e.xyy*map( pos + e.xyy ).x +
+ e.yyx*map( pos + e.yyx ).x +
+ e.yxy*map( pos + e.yxy ).x +
e.xxx*map( pos + e.xxx ).x );
/*
vec3 eps = vec3( 0.0005, 0.0, 0.0 );
@@ -313,7 +313,7 @@ float calcAO( in vec3 pos, in vec3 nor )
occ += -(dd-hr)*sca;
sca *= 0.95;
}
- return clamp( 1.0 - 3.0*occ, 0.0, 1.0 );
+ return clamp( 1.0 - 3.0*occ, 0.0, 1.0 );
}
// http://iquilezles.org/www/articles/checkerfiltering/checkerfiltering.htm
@@ -324,11 +324,11 @@ float checkersGradBox( in vec2 p )
// analytical integral (box filter)
vec2 i = 2.0*(abs(fract((p-0.5*w)*0.5)-0.5)-abs(fract((p+0.5*w)*0.5)-0.5))/w;
// xor pattern
- return 0.5 - 0.5*i.x*i.y;
+ return 0.5 - 0.5*i.x*i.y;
}
vec3 render( in vec3 ro, in vec3 rd )
-{
+{
vec3 col = vec3(0.7, 0.9, 1.0) +rd.y*0.8;
vec2 res = castRay(ro,rd);
float t = res.x;
@@ -338,17 +338,17 @@ vec3 render( in vec3 ro, in vec3 rd )
vec3 pos = ro + t*rd;
vec3 nor = calcNormal( pos );
vec3 ref = reflect( rd, nor );
-
- // material
+
+ // material
col = 0.45 + 0.35*sin( vec3(0.05,0.08,0.10)*(m-1.0) );
if( m<1.5 )
{
-
+
float f = checkersGradBox( 5.0*pos.xz );
col = 0.3 + f*vec3(0.1);
}
- // lighting
+ // lighting
float occ = calcAO( pos, nor );
vec3 lig = normalize( vec3(cos(-0.4 * runTime), sin(0.7 * runTime), -0.6) );
vec3 hal = normalize( lig-rd );
@@ -357,7 +357,7 @@ vec3 render( in vec3 ro, in vec3 rd )
float bac = clamp( dot( nor, normalize(vec3(-lig.x,0.0,-lig.z))), 0.0, 1.0 )*clamp( 1.0-pos.y,0.0,1.0);
float dom = smoothstep( -0.1, 0.1, ref.y );
float fre = pow( clamp(1.0+dot(nor,rd),0.0,1.0), 2.0 );
-
+
dif *= calcSoftshadow( pos, lig, 0.02, 2.5 );
dom *= calcSoftshadow( pos, ref, 0.02, 2.5 );
@@ -399,22 +399,22 @@ void main()
// pixel coordinates
vec2 o = vec2(float(m),float(n)) / float(AA) - 0.5;
vec2 p = (-resolution.xy + 2.0*(gl_FragCoord.xy+o))/resolution.y;
-#else
+#else
vec2 p = (-resolution.xy + 2.0*gl_FragCoord.xy)/resolution.y;
#endif
// RAY: Camera is provided from raylib
//vec3 ro = vec3( -0.5+3.5*cos(0.1*time + 6.0*mo.x), 1.0 + 2.0*mo.y, 0.5 + 4.0*sin(0.1*time + 6.0*mo.x) );
-
+
vec3 ro = viewEye;
vec3 ta = viewCenter;
-
+
// camera-to-world transformation
mat3 ca = setCamera( ro, ta, 0.0 );
// ray direction
vec3 rd = ca * normalize( vec3(p.xy,2.0) );
- // render
+ // render
vec3 col = render( ro, rd );
// gamma
diff --git a/examples/shaders/resources/shaders/glsl330/reload.fs b/examples/shaders/resources/shaders/glsl330/reload.fs
index 21ce18e0..59fdcbae 100644
--- a/examples/shaders/resources/shaders/glsl330/reload.fs
+++ b/examples/shaders/resources/shaders/glsl330/reload.fs
@@ -34,7 +34,7 @@ void main()
// Draw circle layer
vec3 color = vec3(0.9, 0.16, 0.21);
vec4 layer2 = DrawCircle(fragCoord, position, radius, color);
-
+
// Blend the two layers
finalColor = mix(layer1, layer2, layer2.a);
}
diff --git a/examples/shaders/resources/shaders/glsl330/scanlines.fs b/examples/shaders/resources/shaders/glsl330/scanlines.fs
index 22dc9cd5..2c4c6fdf 100644
--- a/examples/shaders/resources/shaders/glsl330/scanlines.fs
+++ b/examples/shaders/resources/shaders/glsl330/scanlines.fs
@@ -41,7 +41,7 @@ void main()
// Scanlines method 2
float globalPos = (fragTexCoord.y + offset) * frequency;
float wavePos = cos((fract(globalPos) - 0.5)*3.14);
-
+
// Texel color fetching from texture sampler
vec4 texelColor = texture(texture0, fragTexCoord);
diff --git a/examples/shaders/resources/shaders/glsl330/sobel.fs b/examples/shaders/resources/shaders/glsl330/sobel.fs
index f317ae32..f76e9cab 100644
--- a/examples/shaders/resources/shaders/glsl330/sobel.fs
+++ b/examples/shaders/resources/shaders/glsl330/sobel.fs
@@ -14,11 +14,11 @@ out vec4 finalColor;
// NOTE: Add here your custom variables
uniform vec2 resolution = vec2(800, 450);
-void main()
+void main()
{
float x = 1.0/resolution.x;
float y = 1.0/resolution.y;
-
+
vec4 horizEdge = vec4(0.0);
horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0;
horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y ))*2.0;
@@ -26,7 +26,7 @@ void main()
horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0;
horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y ))*2.0;
horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0;
-
+
vec4 vertEdge = vec4(0.0);
vertEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0;
vertEdge -= texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y - y))*2.0;
@@ -34,8 +34,8 @@ void main()
vertEdge += texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0;
vertEdge += texture2D(texture0, vec2(fragTexCoord.x , fragTexCoord.y + y))*2.0;
vertEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0;
-
+
vec3 edge = sqrt((horizEdge.rgb*horizEdge.rgb) + (vertEdge.rgb*vertEdge.rgb));
-
+
finalColor = vec4(edge, texture2D(texture0, fragTexCoord).a);
} \ No newline at end of file
diff --git a/examples/shaders/resources/shaders/glsl330/spotlight.fs b/examples/shaders/resources/shaders/glsl330/spotlight.fs
index c573be8f..02cddf42 100644
--- a/examples/shaders/resources/shaders/glsl330/spotlight.fs
+++ b/examples/shaders/resources/shaders/glsl330/spotlight.fs
@@ -23,10 +23,10 @@ uniform float screenWidth; // Width of the screen
void main()
{
float alpha = 1.0;
-
+
// Get the position of the current fragment (screen coordinates!)
vec2 pos = vec2(gl_FragCoord.x, gl_FragCoord.y);
-
+
// Find out which spotlight is nearest
float d = 65000; // some high value
int fi = -1; // found index
@@ -36,15 +36,15 @@ void main()
for (int j = 0; j < MAX_SPOTS; j++)
{
float dj = distance(pos, spots[j].pos) - spots[j].radius + spots[i].radius;
-
- if (d > dj)
+
+ if (d > dj)
{
d = dj;
fi = i;
}
}
}
-
+
// d now equals distance to nearest spot...
// allowing for the different radii of all spotlights
if (fi != -1)
@@ -56,8 +56,8 @@ void main()
else alpha = (d - spots[fi].inner) / (spots[fi].radius - spots[fi].inner);
}
}
-
- // Right hand side of screen is dimly lit,
+
+ // Right hand side of screen is dimly lit,
// could make the threshold value user definable
if ((pos.x > screenWidth/2.0) && (alpha > 0.9)) alpha = 0.9;
diff --git a/examples/shaders/resources/shaders/glsl330/swirl.fs b/examples/shaders/resources/shaders/glsl330/swirl.fs
index 4741e597..bb0732c5 100644
--- a/examples/shaders/resources/shaders/glsl330/swirl.fs
+++ b/examples/shaders/resources/shaders/glsl330/swirl.fs
@@ -27,16 +27,16 @@ void main()
vec2 texSize = vec2(renderWidth, renderHeight);
vec2 tc = fragTexCoord*texSize;
tc -= center;
-
+
float dist = length(tc);
- if (dist < radius)
+ if (dist < radius)
{
float percent = (radius - dist)/radius;
float theta = percent*percent*angle*8.0;
float s = sin(theta);
float c = cos(theta);
-
+
tc = vec2(dot(tc, vec2(c, -s)), dot(tc, vec2(s, c)));
}
diff --git a/examples/text/resources/shaders/glsl100/alpha_discard.fs b/examples/text/resources/shaders/glsl100/alpha_discard.fs
index a6b1e20c..15aacf5f 100644
--- a/examples/text/resources/shaders/glsl100/alpha_discard.fs
+++ b/examples/text/resources/shaders/glsl100/alpha_discard.fs
@@ -13,8 +13,8 @@ uniform vec4 colDiffuse;
void main()
{
vec4 texelColor = texture2D(texture0, fragTexCoord);
-
+
if (texelColor.a == 0.0) discard;
-
+
gl_FragColor = texelColor*fragColor*colDiffuse;
}
diff --git a/examples/text/resources/shaders/glsl100/sdf.fs b/examples/text/resources/shaders/glsl100/sdf.fs
index 31323d96..d4878cf4 100644
--- a/examples/text/resources/shaders/glsl100/sdf.fs
+++ b/examples/text/resources/shaders/glsl100/sdf.fs
@@ -19,7 +19,7 @@ void main()
// NOTE: Calculate alpha using signed distance field (SDF)
float distance = texture2D(texture0, fragTexCoord).a;
float alpha = smoothstep(0.5 - smoothing, 0.5 + smoothing, distance);
-
+
// Calculate final fragment color
gl_FragColor = vec4(fragColor.rgb, fragColor.a*alpha);
}
diff --git a/examples/text/resources/shaders/glsl330/sdf.fs b/examples/text/resources/shaders/glsl330/sdf.fs
index 45e1cabe..545f4507 100644
--- a/examples/text/resources/shaders/glsl330/sdf.fs
+++ b/examples/text/resources/shaders/glsl330/sdf.fs
@@ -20,7 +20,7 @@ void main()
float distanceFromOutline = texture(texture0, fragTexCoord).a - 0.5;
float distanceChangePerFragment = length(vec2(dFdx(distanceFromOutline), dFdy(distanceFromOutline)));
float alpha = smoothstep(-distanceChangePerFragment, distanceChangePerFragment, distanceFromOutline);
-
+
// Calculate final fragment color
finalColor = vec4(fragColor.rgb, fragColor.a*alpha);
}
diff --git a/src/rlgl.h b/src/rlgl.h
index cd486a26..0d8258c1 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -1808,10 +1808,10 @@ static void GLAPIENTRY rlDebugMessageCallback(GLenum source, GLenum type, GLuint
// Ignore non-significant error/warning codes (NVidia drivers)
// NOTE: Here there are the details with a sample output:
// - #131169 - Framebuffer detailed info: The driver allocated storage for renderbuffer 2. (severity: low)
- // - #131185 - Buffer detailed info: Buffer object 1 (bound to GL_ELEMENT_ARRAY_BUFFER_ARB, usage hint is GL_ENUM_88e4)
+ // - #131185 - Buffer detailed info: Buffer object 1 (bound to GL_ELEMENT_ARRAY_BUFFER_ARB, usage hint is GL_ENUM_88e4)
// will use VIDEO memory as the source for buffer object operations. (severity: low)
// - #131218 - Program/shader state performance warning: Vertex shader in program 7 is being recompiled based on GL state. (severity: medium)
- // - #131204 - Texture state usage warning: The texture object (0) bound to texture image unit 0 does not have
+ // - #131204 - Texture state usage warning: The texture object (0) bound to texture image unit 0 does not have
// a defined base level and cannot be used for texture mapping. (severity: low)
if ((id == 131169) || (id == 131185) || (id == 131218) || (id == 131204)) return;
@@ -2404,7 +2404,7 @@ void rlUnloadRenderBatch(rlRenderBatch batch)
for (int i = 0; i < batch.bufferCount; i++)
{
// Unbind VAO attribs data
- if (RLGL.ExtSupported.vao)
+ if (RLGL.ExtSupported.vao)
{
glBindVertexArray(batch.vertexBuffer[i].vaoId);
glDisableVertexAttribArray(0);
@@ -2413,7 +2413,7 @@ void rlUnloadRenderBatch(rlRenderBatch batch)
glDisableVertexAttribArray(3);
glBindVertexArray(0);
}
-
+
// Delete VBOs from GPU (VRAM)
glDeleteBuffers(1, &batch.vertexBuffer[i].vboId[0]);
glDeleteBuffers(1, &batch.vertexBuffer[i].vboId[1]);