diff options
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); } |