diff options
author | jjesswan <jessica_wan@brown.edu> | 2024-05-06 04:30:32 -0400 |
---|---|---|
committer | jjesswan <jessica_wan@brown.edu> | 2024-05-06 04:30:32 -0400 |
commit | d87077e403f5070ad5419a6c4ec7fd9ff0890788 (patch) | |
tree | 11f69507478f0664adfa6d563375ce784fa39a05 /resources/shaders/foam.frag | |
parent | 7a6ceadedc20f58b7be76654eb8357e3ca0b026d (diff) |
saving with good res
Diffstat (limited to 'resources/shaders/foam.frag')
-rw-r--r-- | resources/shaders/foam.frag | 12 |
1 files changed, 6 insertions, 6 deletions
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); } |