summaryrefslogtreecommitdiffstats
path: root/src/shader.frag
diff options
context:
space:
mode:
authorgrm <grm@eyesin.space>2024-12-16 11:16:24 +0200
committergrm <grm@eyesin.space>2024-12-16 11:16:24 +0200
commitaf57524fb3d6914ab413023af4b197d2eb8e6894 (patch)
treec6644070d8269a96650f6081dc185560b1a415bc /src/shader.frag
parenta9ae85a6fee72446d1fe8e6147248adeb39a3649 (diff)
downloadcgame-af57524fb3d6914ab413023af4b197d2eb8e6894.tar.gz
cgame-af57524fb3d6914ab413023af4b197d2eb8e6894.tar.bz2
cgame-af57524fb3d6914ab413023af4b197d2eb8e6894.zip
smol progress
Diffstat (limited to 'src/shader.frag')
-rw-r--r--src/shader.frag52
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() {