vk: brush: do not try to invert water height when underwater

Not sure that we need it.
This commit is contained in:
Ivan Avdeev 2023-11-09 10:49:53 -05:00
parent 5c3be09161
commit 4145969198
2 changed files with 16 additions and 23 deletions

View File

@ -1,3 +1,12 @@
# 2023-11-09 E327
- [x] update animated textures is now super slow: some static map surfaces have alternate anims (e.g. light post on c2a5)
- [ ] woditschka
- [ ] height not switching to negative underwater
- not even sure we need it?
- [ ] do not draw water sides when not requested.
- [ ] potentially collinear planes vs ray tracing #264
# 2023-11-07 E326
- [x] list supported arguments for `rt_debug_display_only` cvar
- [x] make vk_debug_log a command
@ -5,12 +14,6 @@
- [x] patch texture coordinates by matrices
- [x] add `_xvk_tex_rotate`
- [x] ASSERT in c2a5 -- skybox sentinel
- [ ] woditschka
- [ ] height not switching to negative underwater
- not even sure we need it?
- [ ] do not draw water sides when not requested.
- [ ] potentially collinear planes vs ray tracing #264
- [ ] update animated textures is now super slow: some static map surfaces have alternate anims (e.g. light post on c2a5)
# 2023-11-06 E325
- [x] fix material asserts and inherit

View File

@ -162,7 +162,7 @@ static void addWarpVertIndCounts(const msurface_t *warp, int *num_vertices, int
typedef struct {
float prev_time;
float scale;
float wave_height;
const msurface_t *warp;
qboolean reverse;
@ -183,13 +183,6 @@ static void brushComputeWaterPolys( compute_water_polys_t args ) {
ASSERT(args.warp->polys);
// set the current waveheight
// FIXME VK if( warp->polys->verts[0][2] >= RI.vieworg[2] )
// waveHeight = -ent->curstate.scale;
// else
// waveHeight = ent->curstate.scale;
const float scale = args.scale;
// reset fog color for nonlightmapped water
// FIXME VK GL_ResetFogColor();
@ -207,15 +200,15 @@ static void brushComputeWaterPolys( compute_water_polys_t args ) {
for( int i = 0; i < p->numverts; i++ )
{
float nv, prev_nv;
if( scale )
if( args.wave_height )
{
nv = r_turbsin[(int)(time * 160.0f + v[1] + v[0]) & 255] + 8.0f;
nv = (r_turbsin[(int)(v[0] * 5.0f + time * 171.0f - v[1]) & 255] + 8.0f ) * 0.8f + nv;
nv = nv * scale + v[2];
nv = nv * args.wave_height + v[2];
prev_nv = r_turbsin[(int)(args.prev_time * 160.0f + v[1] + v[0]) & 255] + 8.0f;
prev_nv = (r_turbsin[(int)(v[0] * 5.0f + args.prev_time * 171.0f - v[1]) & 255] + 8.0f ) * 0.8f + prev_nv;
prev_nv = prev_nv * scale + v[2];
prev_nv = prev_nv * args.wave_height + v[2];
}
else
prev_nv = nv = v[2];
@ -371,6 +364,8 @@ static void brushDrawWaterSurfaces( const cl_entity_t *ent, const vec4_t color,
static void fillWaterSurfaces( const cl_entity_t *ent, vk_brush_model_t *bmodel, vk_render_geometry_t *geometries ) {
ASSERT(bmodel->water.surfaces_count > 0);
const float wave_height = (!ent) ? 0.f : ent->curstate.scale;
const r_geometry_range_lock_t geom_lock = R_GeometryRangeLock(&bmodel->water.geometry);
int vertices_offset = 0;
@ -382,15 +377,10 @@ static void fillWaterSurfaces( const cl_entity_t *ent, vk_brush_model_t *bmodel,
/* if( warp->plane->type != PLANE_Z && !FBitSet( ent->curstate.effects, EF_WATERSIDES )) */
/* continue; */
const float scale = (!ent) ? 0.f :
( warp->polys->verts[0][2] >= g_camera.vieworg[2] )
? -ent->curstate.scale
: ent->curstate.scale;
int vertices = 0, indices = 0;
brushComputeWaterPolys((compute_water_polys_t){
.prev_time = bmodel->prev_time,
.scale = scale,
.wave_height = wave_height,
.reverse = false, // ??? is it ever true?
.warp = warp,