X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=water.h;h=ac1db00dbafaf53001728bc6253f70b855a95a49;hb=3bb0287d544a4cb75de9afe2927ac8e946f3a18e;hp=c2a7122c2244c1774e9f49f428803ad6afb85ec1;hpb=cb16ccb05a796178c879ea8d5091663d215a5217;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/water.h b/water.h index c2a7122..ac1db00 100644 --- a/water.h +++ b/water.h @@ -32,7 +32,7 @@ static struct } wrender = { - .fbreflect = { .format = GL_RGB, .div = 4 }, + .fbreflect = { .format = GL_RGB, .div = 3 }, .fbdepth = { .format = GL_RGBA, .div = 4 } }; @@ -78,18 +78,24 @@ static void water_compute_depth( boxf bounds ) vg_info( "Computing depth map\n" ); u8 *img = malloc( kres*kres ); + boxf interior; + v3_add(bounds[0],(v3f){1.0f,1.0f,1.0f},interior[0]); + v3_sub(bounds[1],(v3f){1.0f,1.0f,1.0f},interior[1]); + v3f volume; - v3_sub( bounds[1], bounds[0], volume ); - box_copy( bounds, wrender.depthbounds ); + v3_sub( interior[1], interior[0], volume ); + box_copy( interior, wrender.depthbounds ); for( int y=0; y