From 2820f2a620340feff973dfea26c1eb1172140ada Mon Sep 17 00:00:00 2001 From: sotech117 Date: Fri, 10 May 2024 14:31:04 -0400 Subject: demo daygit add . --- resources/images/foam3.png | Bin 25418241 -> 7877956 bytes resources/shaders/foam.frag | 4 ++-- src/ocean/ocean_alt.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/images/foam3.png b/resources/images/foam3.png index b25b73f..3646425 100644 Binary files a/resources/images/foam3.png and b/resources/images/foam3.png differ diff --git a/resources/shaders/foam.frag b/resources/shaders/foam.frag index d534ccd..d6d1cab 100644 --- a/resources/shaders/foam.frag +++ b/resources/shaders/foam.frag @@ -33,7 +33,7 @@ float getSaturation(vec2 k, vec2 xzPos, float adjWaveLength, float phaseC){ void main() { float height = pos.y; float saturation = constants[0];//getSaturation(dir, vec2(pos.x, pos.z), 200.f, constants[0]); - vec4 m_uv = texture(halftone_texture, tex*1); + vec4 m_uv = texture(halftone_texture, tex*.6); float m_threshold = (m_uv.r + m_uv.g + m_uv.b) / 3; // final rgba color at x,z pos @@ -46,7 +46,7 @@ void main() { // apply foam texture vec4 foam = texture(foam_texture, tex + time*.0003); vec4 j = vec4(0,0,0,0); - if (saturation > m_threshold) j = g*foam*1.8; + if (saturation > m_threshold) j = g*foam; fragColor = j; diff --git a/src/ocean/ocean_alt.cpp b/src/ocean/ocean_alt.cpp index c9cee3d..0660a14 100644 --- a/src/ocean/ocean_alt.cpp +++ b/src/ocean/ocean_alt.cpp @@ -138,7 +138,7 @@ void ocean_alt::fft_prime(double t){ std::vector tmp7 = fast_fft(neg_ik_hat_h_z); for (int i = 0; i < N; i++) { - m_current_h[i] = -tmp[i]; + m_current_h[i] = tmp[i]; // m_slopes[i] = tmp2[i]; // m_displacements[i] = tmp3[i]; m_slopes_x[i] = tmp4[i]; @@ -373,7 +373,7 @@ void ocean_alt::update_ocean() // float waveheight = (height - h_0 ) / (h_max - h_0); // m_foam_constants.wavelengths[i] = waveheight; float h_0 = 0; // min*.2f; - float h_max = max*.35f; // the smaller the constant, the more foam there is + float h_max = max*.25f; // the smaller the constant, the more foam there is m_foam_constants.wavelengths[i] = (height - h_0 ) / (h_max - h_0); // if (i < 5){ -- cgit v1.2.3-70-g09d2