Remove trailing spaces

This commit is contained in:
raysan5 2021-10-19 14:57:12 +02:00
parent 719c1551cc
commit fec0ce34c5
80 changed files with 309 additions and 310 deletions

View file

@ -20,7 +20,7 @@ void main()
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));

View file

@ -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;
// 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);
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);
}

View file

@ -2,6 +2,8 @@
precision mediump float;
#extension GL_OES_standard_derivatives : enable
// Input vertex attributes (from vertex shader)
varying vec2 fragTexCoord;
varying vec4 fragColor;

View file

@ -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)));
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);
// 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);
// Blend the two layers
gl_FragColor = mix(layer1, layer2, layer2.a);
}

View file

@ -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()
{

View file

@ -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()
{

View file

@ -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;
// 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);
float outline = min(dot(corners, vec4(1.0)), 1.0);
vec4 color = mix(vec4(0.0), outlineColor, outline);
finalColor = mix(color, texel, texel.a);
}