diff --git a/engine/client/r_surf.c b/engine/client/r_surf.c index 3467c3139..3a99f164d 100644 --- a/engine/client/r_surf.c +++ b/engine/client/r_surf.c @@ -3312,7 +3312,14 @@ void R_GenWorldEBO(void *ctx, void *data, size_t a, size_t b) } //maybe we should just use fatpvs instead, and wait for completion when outside? - if (es->cluster[1] != -1 && es->cluster[0] != es->cluster[1]) + if (r_novis.ival) + { + if (es->pvs.buffersize < es->wmodel->pvsbytes) + es->pvs.buffer = BZ_Realloc(es->pvs.buffer, es->pvs.buffersize=es->wmodel->pvsbytes); + memset(es->pvs.buffer, 0xff, es->pvs.buffersize); + pvs = es->pvs.buffer; + } + else if (es->cluster[1] != -1 && es->cluster[0] != es->cluster[1]) { //view is near to a water boundary. this implies the water crosses the near clip plane. we need both leafs. pvs = es->wmodel->funcs.ClusterPVS(es->wmodel, es->cluster[0], &es->pvs, PVM_REPLACE); pvs = es->wmodel->funcs.ClusterPVS(es->wmodel, es->cluster[1], &es->pvs, PVM_MERGE); diff --git a/engine/gl/gl_shader.c b/engine/gl/gl_shader.c index b8707c9ae..e45c346bc 100644 --- a/engine/gl/gl_shader.c +++ b/engine/gl/gl_shader.c @@ -5550,7 +5550,11 @@ done:; if (!s->sort) { - s->sort = SHADER_SORT_OPAQUE; + extern cvar_t r_refract_fbo; + if ((s->flags & SHADER_HASREFRACT) && !r_refract_fbo.ival) + s->sort = SHADER_SORT_UNDERWATER; + else + s->sort = SHADER_SORT_OPAQUE; } if ((s->flags & SHADER_SKY) && (s->flags & SHADER_DEPTHWRITE))