Fix floating point precision loss in renderer [part 1]
Patch for https://bugzilla.icculus.org/show_bug.cgi?id=5931 by Eugene C. from 2013 plus recent fix for tcMod rotate. I merged the changes into the OpenGL2 renderer though the fix for tcMod turb doesn't translate.
This commit is contained in:
parent
9c4c363ccc
commit
30fdd88c9f
8 changed files with 63 additions and 47 deletions
|
@ -433,7 +433,7 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
|
|||
int i;
|
||||
drawSurf_t *drawSurf;
|
||||
int oldSort;
|
||||
float originalTime;
|
||||
double originalTime;
|
||||
FBO_t* fbo = NULL;
|
||||
qboolean inQuery = qfalse;
|
||||
|
||||
|
@ -498,7 +498,10 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
|
|||
|
||||
if ( entityNum != REFENTITYNUM_WORLD ) {
|
||||
backEnd.currentEntity = &backEnd.refdef.entities[entityNum];
|
||||
backEnd.refdef.floatTime = originalTime - backEnd.currentEntity->e.shaderTime;
|
||||
|
||||
// FIXME: e.shaderTime must be passed as int to avoid fp-precision loss issues
|
||||
backEnd.refdef.floatTime = originalTime - (double)backEnd.currentEntity->e.shaderTime;
|
||||
|
||||
// we have to reset the shaderTime as well otherwise image animations start
|
||||
// from the wrong frame
|
||||
tess.shaderTime = backEnd.refdef.floatTime - tess.shader->timeOffset;
|
||||
|
@ -658,7 +661,7 @@ void RB_SetGL2D (void) {
|
|||
|
||||
// set time for 2D shaders
|
||||
backEnd.refdef.time = ri.Milliseconds();
|
||||
backEnd.refdef.floatTime = backEnd.refdef.time * 0.001f;
|
||||
backEnd.refdef.floatTime = (double)backEnd.refdef.time * 0.001f;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue