[quake2] Quake2 skydistance patch

Nick Warne nick at linicks.net
Sat Aug 27 07:17:27 EDT 2005


On Friday 26 August 2005 12:42, Nick Warne wrote:

> Therefore, all it needs is to select the farz from the skydistance.  I use
> the breakpoints here to select the farz value.
>
>         if (skydistance->modified)
>         {
>                 skydistance->modified = false;
>                 if (skydistance->value > 4852) {
>                 farz = 16384.00; // This value goes right up to a
> skydistance of 9452 - cap it!
>                 } else if (skydistance->value > 2552) { // Break point of
> change from 4096 - 8192
>                 farz = 8192.00;
>                 } else {
>                 farz = 4096.00; // This covers the default quake2
> skydistance of 2300
>                 }
>                 ri.Con_Printf(PRINT_DEVELOPER, "farz now set to %g\n",
> farz); }
>
>
> No calculations required!

You know, the more I think about it, the more I am convinced we don't need any 
of this at all.  Eight years ago, when this was all coded, graphics cards 
were most probably 10 times less powerful than todays level entry cards.  
Therefore, all that is really needed is to up the sky box size permanently 
(this is what I have done at home).

Quake2 maximum map size is 4096 (this is the upper limit - it is bound in 
network code and all sorts, so will never be upped on normal quake2).

In gl_rmain.c, up the value from 4096 to 8192:

       MYgluPerspective (r_newrefdef.fov_y,  screenaspect,  4.00,  8192.00);

and in gl_warp increase the sky box size from default 2300 to 4096:

        b[0] = s * 4096.00;
        b[1] = t * 4096.00;
        b[2] = 4096.00;

thats it.  All hardcoded (no CVARS and such), and will now forever work on big 
maps.

Attached are the diffs against quake2-r0.16.1  /ref_gl/

Nick
-- 
"When you're chewing on life's gristle,
Don't grumble, Give a whistle..."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gl_rmain.c.diff
Type: text/x-diff
Size: 549 bytes
Desc: not available
URL: <http://icculus.org/pipermail/quake2/attachments/20050827/53c5146f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gl_warp.c.diff
Type: text/x-diff
Size: 399 bytes
Desc: not available
URL: <http://icculus.org/pipermail/quake2/attachments/20050827/53c5146f/attachment-0001.bin>


More information about the quake2 mailing list