summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjjesswan <jessica_wan@brown.edu>2024-05-06 17:33:46 -0400
committerjjesswan <jessica_wan@brown.edu>2024-05-06 17:33:46 -0400
commit8d6fd1befd53948cfb4f44ba84bfdb54ac97cf81 (patch)
tree0290bba33cefeb6e0fca6296f7a59b14eea7f7d3
parentd87077e403f5070ad5419a6c4ec7fd9ff0890788 (diff)
saving
-rw-r--r--resources/shaders/foam.frag12
-rw-r--r--src/arap.h2
-rw-r--r--src/ocean/ocean_alt.h6
3 files changed, 10 insertions, 10 deletions
diff --git a/resources/shaders/foam.frag b/resources/shaders/foam.frag
index 9e86011..30fe241 100644
--- a/resources/shaders/foam.frag
+++ b/resources/shaders/foam.frag
@@ -21,8 +21,8 @@ float getSaturation(vec2 k, vec2 xzPos, float adjWaveLength, float phaseC){
//k = normalize(k);
float result = dot(k, xzPos) * 3.14f / adjWaveLength;
result = result + phaseC*time*.5f;
- result = -tan(result + 1.57f);
- result = exp(result) / 100.f;
+ result = -tan(result) + 1.57f;
+ result = exp(result) / 20.f;
return result;
@@ -32,7 +32,7 @@ float getSaturation(vec2 k, vec2 xzPos, float adjWaveLength, float phaseC){
void main() {
float height = pos.y;
- float saturation = getSaturation(dir, vec2(pos.x,pos.z), 100.f, constants[0]);
+ float saturation = getSaturation(dir, vec2(pos.x,pos.z), 100.f, 1.f);
vec4 m_uv = texture(halftone_texture, tex);
float m_threshold = m_uv.r * m_uv.g * m_uv.b;
@@ -45,9 +45,9 @@ void main() {
// apply foam texture
vec4 foam = texture(foam_texture, tex*.3);
- vec4 j = vec4(vec3(g*foam), 1);
- //if (saturation > m_threshold) j = vec4(vec3(g*foam), 1);
+ vec4 j = vec4(22, 33, 54, 100)/255;
+ if (saturation > m_threshold) j = vec4(vec3(g*foam), 1);
- fragColor = vec4(j);
+ // fragColor = vec4(vec3(saturation), 1);
}
diff --git a/src/arap.h b/src/arap.h
index df31dc0..e5529d9 100644
--- a/src/arap.h
+++ b/src/arap.h
@@ -96,7 +96,7 @@ public:
ocean_alt m_ocean;
double m_time = 0.00;
- double m_timestep = 0.03;
+ double m_timestep = 0.3;
Eigen::Vector3f minCorner, maxCorner;
};
diff --git a/src/ocean/ocean_alt.h b/src/ocean/ocean_alt.h
index 31f53ca..0673bbf 100644
--- a/src/ocean/ocean_alt.h
+++ b/src/ocean/ocean_alt.h
@@ -81,11 +81,11 @@ private:
const int num_rows = 256;
const int num_cols = 256;
const int N = num_rows*num_cols; // total number of grid points
- const double lambda = 0.8; // how much displacement matters
+ const double lambda = 2.5; // how much displacement matters
const double spacing = 75.0; // spacing between grid points
- const double A = 100; // numeric constant for the Phillips spectrum
- const double V = 50; // wind speed
+ const double A = 200; // numeric constant for the Phillips spectrum
+ const double V = 200; // wind speed
const double gravity = 9.81;
const double L = V*V/gravity;
const Eigen::Vector2d omega_wind = Eigen::Vector2d(1.0, 0.0); // wind direction, used in Phillips equation