mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-25 05:51:01 +00:00
Try to fix gun fov calculations in the softrenderer.
Until now the softrenderer calculated the fov relative to a hard coded aspect of 4/3. That's wrong, because we're supporting arbitrary aspects and we aren't calculating a fov but just a scaling factor to the global fov which takes the aspect into the account. Fix this by not taking any aspect calculations into account. BUT: While this renders the gun with a correct perspective it's positioned much nearer to the camera / player then in the GL renderers. The GL renderers work around that problem by enforcing a minimal Z distance of 4 units, which can't do because we're just calculating a scaling factor...
This commit is contained in:
parent
9c549f1cd2
commit
e4665547a8
1 changed files with 2 additions and 2 deletions
|
@ -719,8 +719,8 @@ R_AliasDrawModel(entity_t *currententity, const model_t *currentmodel)
|
|||
return;
|
||||
}
|
||||
|
||||
float fov = 2.0*tan(r_gunfov->value*((4.0/3.0)*M_PI/360.0));
|
||||
aliasxscale = ((float)r_refdef.vrect.width / fov) * r_aliasuvscale;
|
||||
float gunfov = 2 * tan((float)r_gunfov->value / 360 * M_PI);
|
||||
aliasxscale = ((float)r_refdef.vrect.width / gunfov) * r_aliasuvscale;
|
||||
aliasyscale = aliasxscale;
|
||||
|
||||
if ( r_lefthand->value == 1.0F )
|
||||
|
|
Loading…
Reference in a new issue