From 78ac85a2018b4d10b6d91d5add1caca93ac9534a Mon Sep 17 00:00:00 2001 From: Bassel Mabsout <7851037+bmabsout@users.noreply.github.com> Date: Thu, 8 Feb 2024 18:54:46 -0500 Subject: [PATCH] Addressed pull request comments smooth_cheese.fsh --- app/src/main/assets/Shaders/smooth_cheese.fsh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/app/src/main/assets/Shaders/smooth_cheese.fsh b/app/src/main/assets/Shaders/smooth_cheese.fsh index 19ed171..d402d9b 100644 --- a/app/src/main/assets/Shaders/smooth_cheese.fsh +++ b/app/src/main/assets/Shaders/smooth_cheese.fsh @@ -1,4 +1,4 @@ - +#version 300 es /* * Title: Smooth Cheese @@ -15,8 +15,6 @@ * with a following link: https://www.shadertoy.com/view/XsX3zB ) */ -#version 300 es - precision highp float; uniform float iTime; @@ -87,16 +85,15 @@ float simplex3d(vec3 p) { return dot(d, vec4(52.0)); } -void mainImage( out vec4 fragColor, in vec2 fragCoord ) +void main() { - vec2 p = fragCoord.xy/iResolution.x; + vec2 p = textureCoord; vec3 p3 = vec3(p, iTime*0.015)+vec3(iTime*0.015,0.0,0.0); float value = pow(abs(simplex3d(p3*2.0)),1.5); - float red = 0.5 + 0.5*simplex3d(p3*2.0 + 38274.9); - float green = abs(0.2+0.5*simplex3d(p3*2.0 + 3824.9)); - float blue = abs(simplex3d(p3*2.0 + 98274.9)); + float red = 0.5 + 0.5*simplex3d(p3*2.0 + 38274.9); + float green = abs(0.2+0.5*simplex3d(p3*2.0 + 3824.9)); + float blue = abs(simplex3d(p3*2.0 + 98274.9)); fragColor = vec4(sqrt(value*vec3(red, green, blue)), 1.0); - return; }