Reply To: Modification of the current software

Home Forums AR Sandbox Forum Modification of the current software Reply To: Modification of the current software

#101081
Oliver Kreylos
Keymaster

This is trickier than it appears because water data only lives on the graphics card, not in CPU-accessible main memory where you would need it to run simulations. You can download the current water state grid after it’s being updated in the display method, which is line 934 in Sandbox.cpp. Use WaterTable2::bindQuantityTexture to bind the water texture to the active texture unit, and then use glGetTexImage with a texture target of GL_TEXTURE_RECTANGLE_ARB, an RGB format, and a floating-point data type. The first texture component will be water surface level (not water height above ground), and the second and third are horizontal and vertical flux.

Comments are closed.