5 #include <msp/gl/objectinstance.h>
6 #include <msp/gl/texture2d.h>
8 class Water: public Msp::GL::ObjectInstance
13 const Msp::GL::Mesh &terrain;
23 Msp::GL::Texture2D surface;
24 Msp::GL::Texture2D velocity;
33 float stepsize = 0.001f;
35 Msp::GL::Texture2D bottom;
36 Msp::GL::Texture2D normals;
37 Msp::GL::Texture2D variance_x;
38 Msp::GL::Texture2D variance_y;
39 const Msp::GL::Sampler &sampler;
40 const Msp::GL::Program &sim_integrate;
41 const Msp::GL::Program &sim_velocity;
42 const Msp::GL::Program &normals_shader;
43 const Msp::GL::Program &variance_x_shader;
44 const Msp::GL::Program &variance_y_shader;
45 Msp::GL::ProgramData sim_shdata;
46 Msp::GL::ProgramData shdata;
47 bool simulated = false;
50 Water(const Msp::GL::Object &, Msp::DataFile::Collection &, const Region &);
53 void setup_frame(Msp::GL::Renderer &) override;
54 void finish_frame() override;
56 void setup_render(Msp::GL::Renderer &, Msp::GL::Tag) const override;