diff options
Diffstat (limited to 'src/shader.frag')
-rw-r--r-- | src/shader.frag | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/shader.frag b/src/shader.frag index ca895d2..88015c4 100644 --- a/src/shader.frag +++ b/src/shader.frag @@ -16,20 +16,20 @@ layout(binding = 0) uniform UniformBufferObject { float dt; } ubo; -// void main() { -// // float pulse = sin(ubo.time * .2) * .5 + .5; -// // outColor = vec4(fragColor * texture(texSampler, fragTexCoord).rgb * pulse, 1.0); -// //outColor = texture(texSampler, fragTexCoord); -// outColor = vec4(fragColor, 1); -// // float repeat = 10; -// // float f = mod(ubo.time, repeat); -// // if (f < repeat / 2) { -// // outColor = vec4(fragColor * radians(f) ,1); -// // } else { -// // outColor = vec4(fragColor * radians(1 - f) ,1); -// // } -// // //outColor = (vec4(1) * ubo.model + vec4(1)) * vec4(texture(texSampler, fragTexCoord).rgb * fragColor, 1.0); -// } +void main() { + // float pulse = sin(ubo.time * .2) * .5 + .5; + // outColor = vec4(fragColor * texture(texSampler, fragTexCoord).rgb * pulse, 1.0); + outColor = texture(texSampler, fragTexCoord); + //outColor = vec4(fragColor, 1); +// float repeat = 10; +// float f = zmod(ubo.time, repeat); +// if (f < repeat / 2) { +// outColor = vec4(fragColor * radians(f) ,1); +// } else { +// outColor = vec4(fragColor * radians(1 - f) ,1); +// } +// //outColor = (vec4(1) * ubo.model + vec4(1)) * vec4(texture(texSampler, fragTexCoord).rgb * fragColor, 1.0); +} float noise(vec2 p) { return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453); @@ -54,18 +54,18 @@ float fbm(vec2 p) { return value; } -void main() { - vec2 uv = gl_FragCoord.xy / ubo.resolution.xy; - vec2 p = uv * 2.0 - vec2(1.0); - float n = fbm(p * 5.0 - vec2(0.0, ubo.time * 2.0)); - // outColor = vec4(n, n * 0.5, 0.0, 1.0) * vec4(texture(texSampler, fragTexCoord).rgb, 1.0); - if (mod(gl_FragCoord.x, 20) > 19 || mod(gl_FragCoord.y, 20) > 19) { - outColor = vec4(0,0,0, 1); - } else { - float x = clamp(sin(ubo.time * 0.1), 0.0, 1.0); - outColor = vec4(x, n * .2, n * 0.5, 1.0); - } -} +// void main() { +// vec2 uv = gl_FragCoord.xy / ubo.resolution.xy; +// vec2 p = uv * 2.0 - vec2(1.0); +// float n = fbm(p * 5.0 - vec2(0.0, ubo.time * 2.0)); +// // outColor = vec4(n, n * 0.5, 0.0, 1.0) * vec4(texture(texSampler, fragTexCoord).rgb, 1.0); +// // if (mod(gl_FragCoord.x, 20) > 19 || mod(gl_FragCoord.y, 20) > 19) { +// // outColor = vec4(0,0,0, 1); +// // } else { +// float x = clamp(sin(ubo.time * 0.1), 0.0, 1.0); +// outColor = vec4(x, n * .2, n * 0.5, 1.0); +// // } +// } // void main() { |