-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tessendorf waves simulation #68
base: master
Are you sure you want to change the base?
Conversation
tessendorf-waves-simulation-2021-03-09-15-59-38_rjP5L7zt.mp4Not a proper heightmap, but much closer to the expected result. |
tessendorf-waves-simulation-2021-03-11-16-06-59_tezBXDah.mp4It still has to be centered, right? |
not really because it gets tiled on a big ocean surface The phase random seeding still looks wrong, it should have no discernible patterns at startup. |
Yeah it still looks symmetrical with respect to the diagonal. Will fix that |
tes_sRWCDHAM.mp4ok this one looks fine for me, |
struct displacement_spectrum | ||
{ | ||
vec2 d[3]; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd much rather see you use a mat2x3/mat3x2
(dont renember which one acts like an array of vec2[3]
|
||
#include <nbl/builtin/glsl/math/complex.glsl> | ||
#include <nbl/builtin/glsl/sampling/box_muller_transform.glsl> | ||
#define PI 3.1415926538 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's an engine constant for that
#include <nbl/builtin/glsl/sampling/box_muller_transform.glsl> | ||
#define PI 3.1415926538 | ||
#define G 9.8 | ||
#define UINT_MAX 4294967295u |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's an engine constant for that
vec3 fresnel(float cosTheta, vec3 f0) | ||
{ | ||
return f0 + (1.0 - f0) * pow(1.0 - cosTheta, 5.0); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's an engine builtin for this
vec4 pos = vec4((world_pos.xyz + displacement) * scale, 1); | ||
gl_Position = u_pc.vp * pos; | ||
|
||
v_normal = texture(normal_map, texture_pos).rgb; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not read the normal texture in the fragment shader!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the normal map stores vertex normals. They must be read in the vertex shader and get interpolated, don't they?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
barycentrically interpolated normals = bad
also usually you'd have less vertices than you have pixels in a normal map
#define G 9.8 | ||
#define UINT_MAX 4294967295u | ||
|
||
struct displacement_spectrum | ||
{ | ||
vec2 d[3]; | ||
mat3x2 d; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the mat3x2 instead of the struct
vec3 light = normalize(light_pos - world_coord); | ||
vec3 view = normalize(u_pc.camera_pos - world_coord); | ||
|
||
vec3 f0 = vec3(0.04); | ||
vec3 f = fresnel(max(dot(normal_normalized, view), 0.0), f0); | ||
vec3 f = nbl_glsl_fresnel_schlick(f0, max(dot(normal, view), 0.0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
abs(dot())
tessendorf-waves-simulation-2021-03-30-23-24-24_7VCPCAfz.mp4Well this is what i've got so far. The task is mostly finished, but i'll try to make the water shading a bit more realistic. |
…g/Nabla # Conflicts: # examples_tests/CMakeLists.txt # include/nbl/ext/FFT/FFT.h
I think i fixed all the stuff you commented about so far @devshgraphicsprogramming |
@@ -0,0 +1 @@ | |||
bin/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kill this whole file
[CI]: Can one of the admins verify this patch? |
a07e79f
to
ffbd843
Compare
Description
Testing
TODO list: