projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
audio&island
[carveJwlIkooP6JGAAIwe30JlM.git]
/
water.h
diff --git
a/water.h
b/water.h
index bcd0c6847d44ca840d66b8694840bbe6fbad2351..c2a7122c2244c1774e9f49f428803ad6afb85ec1 100644
(file)
--- a/
water.h
+++ b/
water.h
@@
-32,8
+32,8
@@
static struct
}
wrender =
{
}
wrender =
{
- .fbreflect = { .format = GL_RGB, .div =
2
},
- .fbdepth = { .format = GL_RGBA, .div =
2
}
+ .fbreflect = { .format = GL_RGB, .div =
4
},
+ .fbdepth = { .format = GL_RGBA, .div =
4
}
};
static float water_height(void)
};
static float water_height(void)
@@
-86,7
+86,7
@@
static void water_compute_depth( boxf bounds )
{
for( int x=0; x<kres; x++ )
{
{
for( int x=0; x<kres; x++ )
{
- v3f pos = { x, 0, y };
+ v3f pos = { x, 0
.0f
, y };
v3_divs( pos, kres, pos );
v3_muladd( bounds[0], pos, volume, pos );
pos[1] = wrender.height;
v3_divs( pos, kres, pos );
v3_muladd( bounds[0], pos, volume, pos );
pos[1] = wrender.height;
@@
-98,7
+98,7
@@
static void water_compute_depth( boxf bounds )
if( ray_world( pos, (v3f){0.0f,-1.0f,0.0f}, &hit ))
{
float h = wrender.height - hit.pos[1];
if( ray_world( pos, (v3f){0.0f,-1.0f,0.0f}, &hit ))
{
float h = wrender.height - hit.pos[1];
- h *= 1.0f/
1
5.0f;
+ h *= 1.0f/
2
5.0f;
h = vg_clampf( h, 0.0f, 1.0f );
*dst = (u8)(h*255.0f);
}
h = vg_clampf( h, 0.0f, 1.0f );
*dst = (u8)(h*255.0f);
}
@@
-187,8
+187,6
@@
static void render_water_texture( m4x3f camera )
v4f clippb = { 0.0f, -1.0f, 0.0f, -(wrender.height) };
m4x3_mulp( inverse, clippb, clippb );
clippb[3] *= -1.0f;
v4f clippb = { 0.0f, -1.0f, 0.0f, -(wrender.height) };
m4x3_mulp( inverse, clippb, clippb );
clippb[3] *= -1.0f;
-
- float depth_loss = camera[3][1]-wrender.height;
m4x4_projection( projection,
gpipeline.fov,
m4x4_projection( projection,
gpipeline.fov,