From d87077e403f5070ad5419a6c4ec7fd9ff0890788 Mon Sep 17 00:00:00 2001 From: jjesswan Date: Mon, 6 May 2024 04:30:32 -0400 Subject: saving with good res --- resources/shaders/foam.frag | 12 ++++++------ resources/shaders/foam.vert | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'resources/shaders') diff --git a/resources/shaders/foam.frag b/resources/shaders/foam.frag index 91ce3b9..9e86011 100644 --- a/resources/shaders/foam.frag +++ b/resources/shaders/foam.frag @@ -22,7 +22,7 @@ float getSaturation(vec2 k, vec2 xzPos, float adjWaveLength, float phaseC){ float result = dot(k, xzPos) * 3.14f / adjWaveLength; result = result + phaseC*time*.5f; result = -tan(result + 1.57f); - result = exp(result) / 4.f; + result = exp(result) / 100.f; return result; @@ -38,16 +38,16 @@ void main() { // final rgba color at x,z pos vec4 h = vec4(0,0,1,1); - if (saturation > m_threshold) h = vec4(vec3(m_threshold), 1); + if (saturation > m_threshold) h = vec4(1,1,1, 1); // add fading effect to bubble popping vec4 g = clamp(.5*saturation - m_threshold, 0, 1) * h; // apply foam texture - vec4 foam = texture(foam_texture, tex); - vec4 j = vec4(0,0,0,1); - if (saturation > m_threshold) j = vec4(vec3(g*foam), 1); + vec4 foam = texture(foam_texture, tex*.3); + vec4 j = vec4(vec3(g*foam), 1); + //if (saturation > m_threshold) j = vec4(vec3(g*foam), 1); - fragColor = vec4(vec3(saturation), 1); + fragColor = vec4(j); } diff --git a/resources/shaders/foam.vert b/resources/shaders/foam.vert index 261eeea..76f2af7 100644 --- a/resources/shaders/foam.vert +++ b/resources/shaders/foam.vert @@ -38,7 +38,7 @@ vec2 calculateTexCoord(vec3 pos){ float offset = .5f; - return 6*vec2(u_coord + offset, v_coord + offset); + return 2*vec2(u_coord + offset, v_coord + offset); } -- cgit v1.2.3-70-g09d2