1
0
Fork 0
forked from fte/fteqw

Small tweak to temporalscene cache to adhere to r_novis. Change sort order of water shaders when refract_fbo isn't active, to ensure the refraction scene is actually drawn before its read.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5853 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2021-05-13 10:17:27 +00:00
parent d5fa80a0d4
commit cdbf3614a3
2 changed files with 13 additions and 2 deletions

View file

@ -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? //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. { //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[0], &es->pvs, PVM_REPLACE);
pvs = es->wmodel->funcs.ClusterPVS(es->wmodel, es->cluster[1], &es->pvs, PVM_MERGE); pvs = es->wmodel->funcs.ClusterPVS(es->wmodel, es->cluster[1], &es->pvs, PVM_MERGE);

View file

@ -5550,6 +5550,10 @@ done:;
if (!s->sort) if (!s->sort)
{ {
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; s->sort = SHADER_SORT_OPAQUE;
} }