Skip to content
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

slope wrong? #3

Open
i-make-robots opened this issue Mar 5, 2024 · 0 comments
Open

slope wrong? #3

i-make-robots opened this issue Mar 5, 2024 · 0 comments

Comments

@i-make-robots
Copy link

https://github.com/Huw-man/Interactive-Erosion-Simulator-on-GPU/blob/584a210a21b8cf5f1d3b3a98ae96513e44291f42/assets/shaders/pipeline/erosion_deposition.frag#L58C39-L65C55

	float r_b = texture(T1_bds, UV + vec2(1.0 / texture_size.x, 0)).x;
	float l_b = texture(T1_bds, UV - vec2(1.0 / texture_size.x, 0)).x;
	float d_b = texture(T1_bds, UV + vec2(0, 1.0 / texture_size.y)).x;
	float u_b = texture(T1_bds, UV - vec2(0, 1.0 / texture_size.y)).x;

	float dbdx = (r_b-l_b) / (2.0*l_xy.x/texture_size.x);
	float dbdy = (r_b-l_b) / (2.0*l_xy.y/texture_size.y);

shouldn't dbdy be (d_b-u_b) / (2.0*l_xy.y/texture_size.y); ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant