diff --git a/shaders/gl330/bloom.fs b/shaders/gl330/bloom.fs index 2833ce330..34b6295c6 100644 --- a/shaders/gl330/bloom.fs +++ b/shaders/gl330/bloom.fs @@ -18,23 +18,23 @@ void main() { for (int j = -3; j < 3; j++) { - sum += texture2D(texture0, fragTexCoord + vec2(j, i)*0.004) * 0.25; + sum += texture(texture0, fragTexCoord + vec2(j, i)*0.004) * 0.25; } } - if (texture2D(texture0, fragTexCoord).r < 0.3) + if (texture(texture0, fragTexCoord).r < 0.3) { - tc = sum*sum*0.012 + texture2D(texture0, fragTexCoord); + tc = sum*sum*0.012 + texture(texture0, fragTexCoord); } else { - if (texture2D(texture0, fragTexCoord).r < 0.5) + if (texture(texture0, fragTexCoord).r < 0.5) { - tc = sum*sum*0.009 + texture2D(texture0, fragTexCoord); + tc = sum*sum*0.009 + texture(texture0, fragTexCoord); } else { - tc = sum*sum*0.0075 + texture2D(texture0, fragTexCoord); + tc = sum*sum*0.0075 + texture(texture0, fragTexCoord); } } diff --git a/shaders/gl330/blur.fs b/shaders/gl330/blur.fs index bd2b521f8..44ea42b14 100644 --- a/shaders/gl330/blur.fs +++ b/shaders/gl330/blur.fs @@ -9,20 +9,20 @@ uniform vec4 fragTintColor; // NOTE: Add here your custom variables -const float renderWidth = 1280; -const float renderHeight = 720; +const float renderWidth = 1280.0; +const float renderHeight = 720.0; float offset[3] = float[](0.0, 1.3846153846, 3.2307692308); float weight[3] = float[](0.2270270270, 0.3162162162, 0.0702702703); void main() { - vec3 tc = texture2D(texture0, fragTexCoord).rgb*weight[0]; + vec3 tc = texture(texture0, fragTexCoord).rgb*weight[0]; for (int i = 1; i < 3; i++) { - tc += texture2D(texture0, fragTexCoord + vec2(offset[i])/renderWidth, 0.0).rgb*weight[i]; - tc += texture2D(texture0, fragTexCoord - vec2(offset[i])/renderWidth, 0.0).rgb*weight[i]; + tc += texture(texture0, fragTexCoord + vec2(offset[i])/renderWidth, 0.0).rgb*weight[i]; + tc += texture(texture0, fragTexCoord - vec2(offset[i])/renderWidth, 0.0).rgb*weight[i]; } fragColor = vec4(tc, 1.0); diff --git a/shaders/gl330/cross_hatching.fs b/shaders/gl330/cross_hatching.fs index 7e25b25be..6f5df9647 100644 --- a/shaders/gl330/cross_hatching.fs +++ b/shaders/gl330/cross_hatching.fs @@ -9,16 +9,16 @@ uniform vec4 fragTintColor; // NOTE: Add here your custom variables -float hatchOffsetY = 5.0f; -float lumThreshold01 = 0.9f; -float lumThreshold02 = 0.7f; -float lumThreshold03 = 0.5f; -float lumThreshold04 = 0.3f; +float hatchOffsetY = 5.0; +float lumThreshold01 = 0.9; +float lumThreshold02 = 0.7; +float lumThreshold03 = 0.5; +float lumThreshold04 = 0.3; void main() { vec3 tc = vec3(1.0, 1.0, 1.0); - float lum = length(texture2D(texture0, fragTexCoord).rgb); + float lum = length(texture(texture0, fragTexCoord).rgb); if (lum < lumThreshold01) { diff --git a/shaders/gl330/cross_stitching.fs b/shaders/gl330/cross_stitching.fs index 73f867b60..dcb26e79b 100644 --- a/shaders/gl330/cross_stitching.fs +++ b/shaders/gl330/cross_stitching.fs @@ -9,10 +9,10 @@ uniform vec4 fragTintColor; // NOTE: Add here your custom variables -const float renderWidth = 1280; -const float renderHeight = 720; +const float renderWidth = 1280.0; +const float renderHeight = 720.0; -float stitchingSize = 6.0f; +float stitchingSize = 6.0; uniform int invert = 0; @@ -35,11 +35,11 @@ vec4 PostFX(sampler2D tex, vec2 uv) 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); - else c = texture2D(tex, tlPos * vec2(1.0/renderWidth, 1.0/renderHeight)) * 1.4; + else c = texture(tex, tlPos * vec2(1.0/renderWidth, 1.0/renderHeight)) * 1.4; } else { - if (invert == 1) c = texture2D(tex, tlPos * vec2(1.0/renderWidth, 1.0/renderHeight)) * 1.4; + 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); } diff --git a/shaders/gl330/dream_vision.fs b/shaders/gl330/dream_vision.fs index f93163420..0ea4ce200 100644 --- a/shaders/gl330/dream_vision.fs +++ b/shaders/gl330/dream_vision.fs @@ -11,21 +11,21 @@ uniform vec4 fragTintColor; void main() { - vec4 color = texture2D(texture0, fragTexCoord); + vec4 color = texture(texture0, fragTexCoord); - color += texture2D(texture0, fragTexCoord + 0.001); - color += texture2D(texture0, fragTexCoord + 0.003); - color += texture2D(texture0, fragTexCoord + 0.005); - color += texture2D(texture0, fragTexCoord + 0.007); - color += texture2D(texture0, fragTexCoord + 0.009); - color += texture2D(texture0, fragTexCoord + 0.011); + color += texture(texture0, fragTexCoord + 0.001); + color += texture(texture0, fragTexCoord + 0.003); + color += texture(texture0, fragTexCoord + 0.005); + color += texture(texture0, fragTexCoord + 0.007); + color += texture(texture0, fragTexCoord + 0.009); + color += texture(texture0, fragTexCoord + 0.011); - color += texture2D(texture0, fragTexCoord - 0.001); - color += texture2D(texture0, fragTexCoord - 0.003); - color += texture2D(texture0, fragTexCoord - 0.005); - color += texture2D(texture0, fragTexCoord - 0.007); - color += texture2D(texture0, fragTexCoord - 0.009); - color += texture2D(texture0, fragTexCoord - 0.011); + color += texture(texture0, fragTexCoord - 0.001); + color += texture(texture0, fragTexCoord - 0.003); + color += texture(texture0, fragTexCoord - 0.005); + color += texture(texture0, fragTexCoord - 0.007); + color += texture(texture0, fragTexCoord - 0.009); + color += texture(texture0, fragTexCoord - 0.011); color.rgb = vec3((color.r + color.g + color.b)/3.0); color = color/9.5; diff --git a/shaders/gl330/fisheye.fs b/shaders/gl330/fisheye.fs index bbbff65cf..5bd9abf4b 100644 --- a/shaders/gl330/fisheye.fs +++ b/shaders/gl330/fisheye.fs @@ -13,7 +13,7 @@ const float PI = 3.1415926535; void main() { - float aperture = 178.0f; + float aperture = 178.0; float apertureHalf = 0.5 * aperture * (PI / 180.0); float maxFactor = sin(apertureHalf); @@ -36,5 +36,5 @@ void main() uv = fragTexCoord.xy; } - fragColor = texture2D(texture0, uv); + fragColor = texture(texture0, uv); } \ No newline at end of file diff --git a/shaders/gl330/grayscale.fs b/shaders/gl330/grayscale.fs index af50b8c1b..b3a695bfb 100644 --- a/shaders/gl330/grayscale.fs +++ b/shaders/gl330/grayscale.fs @@ -11,7 +11,7 @@ uniform vec4 fragTintColor; void main() { - vec4 base = texture2D(texture0, fragTexCoord)*fragTintColor; + vec4 base = texture(texture0, fragTexCoord)*fragTintColor; // Convert to grayscale using NTSC conversion weights float gray = dot(base.rgb, vec3(0.299, 0.587, 0.114)); diff --git a/shaders/gl330/pixel.fs b/shaders/gl330/pixel.fs index feee14232..aa5a22fe1 100644 --- a/shaders/gl330/pixel.fs +++ b/shaders/gl330/pixel.fs @@ -9,11 +9,11 @@ uniform vec4 fragTintColor; // NOTE: Add here your custom variables -const float renderWidth = 1280; -const float renderHeight = 720; +const float renderWidth = 1280.0; +const float renderHeight = 720.0; -uniform float pixelWidth = 5.0f; -uniform float pixelHeight = 5.0f; +uniform float pixelWidth = 5.0; +uniform float pixelHeight = 5.0; void main() { @@ -22,7 +22,7 @@ void main() vec2 coord = vec2(dx*floor(fragTexCoord.x/dx), dy*floor(fragTexCoord.y/dy)); - vec3 tc = texture2D(texture0, coord).rgb; + vec3 tc = texture(texture0, coord).rgb; fragColor = vec4(tc, 1.0); } \ No newline at end of file diff --git a/shaders/gl330/posterization.fs b/shaders/gl330/posterization.fs index a4e49466e..5215bd8bc 100644 --- a/shaders/gl330/posterization.fs +++ b/shaders/gl330/posterization.fs @@ -9,12 +9,12 @@ uniform vec4 fragTintColor; // NOTE: Add here your custom variables -float gamma = 0.6f; -float numColors = 8.0f; +float gamma = 0.6; +float numColors = 8.0; void main() { - vec3 color = texture2D(texture0, fragTexCoord.xy).rgb; + vec3 color = texture(texture0, fragTexCoord.xy).rgb; color = pow(color, vec3(gamma, gamma, gamma)); color = color*numColors; diff --git a/shaders/gl330/predator.fs b/shaders/gl330/predator.fs index 2295d01b8..85c93d0cd 100644 --- a/shaders/gl330/predator.fs +++ b/shaders/gl330/predator.fs @@ -11,7 +11,7 @@ uniform vec4 fragTintColor; void main() { - vec3 color = texture2D(texture0, fragTexCoord).rgb; + vec3 color = texture(texture0, fragTexCoord).rgb; vec3 colors[3]; colors[0] = vec3(0.0, 0.0, 1.0); colors[1] = vec3(1.0, 1.0, 0.0); diff --git a/shaders/gl330/scanlines.fs b/shaders/gl330/scanlines.fs index 572972997..0c89e6107 100644 --- a/shaders/gl330/scanlines.fs +++ b/shaders/gl330/scanlines.fs @@ -9,8 +9,8 @@ uniform vec4 fragTintColor; // NOTE: Add here your custom variables -float offset = 0; -float frequency = 720/3.0; +float offset = 0.0; +float frequency = 720.0/3.0; uniform float time; @@ -21,7 +21,7 @@ void main (void) float tval = 0; //time vec2 uv = 0.5 + (fragTexCoord - 0.5)*(0.9 + 0.01*sin(0.5*tval)); - vec4 color = texture2D(texture0, fragTexCoord); + vec4 color = texture(texture0, fragTexCoord); color = clamp(color*0.5 + 0.5*color*color*1.2, 0.0, 1.0); color *= 0.5 + 0.5*16.0*uv.x*uv.y*(1.0 - uv.x)*(1.0 - uv.y); @@ -35,7 +35,7 @@ void main (void) float globalPos = (fragTexCoord.y + offset) * frequency; float wavePos = cos((fract(globalPos) - 0.5)*3.14); - vec4 color = texture2D(texture0, fragTexCoord); + vec4 color = texture(texture0, fragTexCoord); - fragColor = mix(vec4(0, 0.3, 0, 0), color, wavePos); + fragColor = mix(vec4(0.0, 0.3, 0.0, 0.0), color, wavePos); } \ No newline at end of file diff --git a/shaders/gl330/swirl.fs b/shaders/gl330/swirl.fs index e88b59c9f..19d7468b1 100644 --- a/shaders/gl330/swirl.fs +++ b/shaders/gl330/swirl.fs @@ -9,13 +9,13 @@ uniform vec4 fragTintColor; // NOTE: Add here your custom variables -const float renderWidth = 1280; -const float renderHeight = 720; +const float renderWidth = 1280.0; +const float renderHeight = 720.0; float radius = 250.0; float angle = 0.8; -uniform vec2 center = vec2(200, 200); +uniform vec2 center = vec2(200.0, 200.0); void main (void) { @@ -35,7 +35,7 @@ void main (void) } tc += center; - vec3 color = texture2D(texture0, tc/texSize).rgb; + vec3 color = texture(texture0, tc/texSize).rgb; fragColor = vec4(color, 1.0);; } \ No newline at end of file diff --git a/shaders/gl330/template.fs b/shaders/gl330/template.fs index 660e84846..ad7210a4c 100644 --- a/shaders/gl330/template.fs +++ b/shaders/gl330/template.fs @@ -11,7 +11,7 @@ uniform vec4 fragTintColor; void main() { - vec4 texelColor = texture2D(texture0, fragTexCoord); + vec4 texelColor = texture(texture0, fragTexCoord); // NOTE: Implement here your fragment shader code