Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Water simulation in Three.js

Tags:

three.js

webgl

I am working on a simulation project and I need to port this Webgl example with Three.js. I already know some shaders and have worked with Three.js. Any help will be appreciated.

Webgl Water

Thanks.

like image 597
Ahmed Hussein Avatar asked Dec 06 '25 04:12

Ahmed Hussein


2 Answers

I figured out the best way for water simulation in plan geometry - check the answer in

Three.js Water Shaders migration from r48 to r52

texture uniform changes: texture units are now assigned automatically, texture object goes to value property instead of texture one { type: "t", value: 0, texture: map } => { type: "t", value: map }

like image 137
Ahmed Hussein Avatar answered Dec 10 '25 02:12

Ahmed Hussein


Check the sourcecode of his project (I used firebug for firefox). His javascripts is not minified, so they are pretty readable. So assuming you know your water simulation theory, it should not be that hard to get a grasp on :)

like image 25
JonR Avatar answered Dec 10 '25 02:12

JonR



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!