R_EntityMatrix(&rsurface.matrix);
Matrix4x4_Transform(&rsurface.inversematrix, r_refdef.view.origin, rsurface.localvieworigin);
Matrix4x4_TransformStandardPlane(&rsurface.inversematrix, r_refdef.fogplane[0], r_refdef.fogplane[1], r_refdef.fogplane[2], r_refdef.fogplane[3], rsurface.fogplane);
- rsurface.fogplaneviewdist *= rsurface.inversematrixscale;
+ rsurface.fogplaneviewdist = r_refdef.fogplaneviewdist * rsurface.inversematrixscale;
rsurface.fograngerecip = r_refdef.fograngerecip * rsurface.matrixscale;
rsurface.fogheightfade = r_refdef.fogheightfade * rsurface.matrixscale;
rsurface.fogmasktabledistmultiplier = FOGMASKTABLEWIDTH * rsurface.fograngerecip;