Commit Graph

93 Commits

Author SHA1 Message Date
Bill Currie 52d9269867 Merge brush model with world model rendering.
With this, non-mtex global fog now works properly :).
2011-12-18 08:09:55 +09:00
Bill Currie a8e354536a Implement the instance surface allocation/freeing.
Not actually used yet, so it's harmless at this stage.
2011-12-17 19:42:19 +09:00
Bill Currie 87b78e5533 Move the surface chain links out of the surfaces.
The links are now in "instance surfaces". For non-instanced models (world,
doors, plats etc (ie, world and its sub-models)), there will be one
instance surface per model surface. However, for instanced models (ammo
boxes etc), there will be many, dynamically allocated (not yet
implemented). This commit gets the static instance surfaces working.
2011-12-17 19:14:14 +09:00
Bill Currie e67690a1a9 Restore the missing lightmaps in non-mtex mode.
I forgot to blend in the lightmaps in the fogless non-mtex path.
2011-12-16 09:21:39 +09:00
Bill Currie 962451e2fe Create a list of texture chains.
This moves the texture chains out of the world model and into a separate
list, allowing other brush models to registter their textures.
2011-12-15 17:09:02 +09:00
Bill Currie d6a668d517 Split out chain_surface() from visit_node(). 2011-12-15 17:09:02 +09:00
Bill Currie 3eb859a88f Move the entity transform setup into the clients.
This has several benifits:
  o The silly issue with alias model pitches being backwards is kept out
    of the renderer (it's a quakec thing: entites do their pitch
    backwards, but originally, only alias models were rotated. Hipnotic
    did brush entity rotations in the correct direction).
  o Angle to frame vector conversions are done only when the entity's
    angles vector changes, rather than every frame. This avoids a lot of
    unnecessary trig function calls.
  o Once transformed, an entity's frame vectors are always available.
    However, the vectors are left handed rather than right handed (ie,
    forward/left/up instead of forward/right/up): just a matter of
    watching the sign. This avoids even more trig calls (flag models in
    qw).
  o This paves the way for merging brush entity surface rendering with the
    world model surface rendering (the actual goal of this patch).
  o This also paves the way for using quaternions to represent entity
    orientation, as that would be a protocol change.
2011-12-15 17:09:01 +09:00
Bill Currie 8e531a58c2 Get global fog working for multi-pass rendering.
For the world textures, anyway. Entity multi-pass rendering still needs to
be verified.
2011-12-12 17:08:22 +09:00
Bill Currie 91e65b6c80 Rename mplane_t to plane_t and clean up the mess.
I got rather tired of there being multiple definitions of mostly compatible
plane types (and I need a common type anyway). dplane_t still exists for
now because I want to be careful when messing with the actual bsp format.
2011-11-28 20:54:34 +09:00
Bill Currie 0f7390dd60 Clean up all the "set but not used" warnings.
gcc on my system is failing to treat this specific warning as an error :/
2011-06-19 10:48:02 +09:00
Bill Currie 8919aec663 Get global fog working in mtex mode. 2010-12-10 21:40:36 +09:00
Bill Currie f98b002f9e Make R_StoreEfrags const-correct.
R_StoreEfrags does not need to modify its parameter or anything to which
it directly refers, so make the pointer single-level and constant.
2010-12-03 13:30:49 +09:00
Bill Currie 6884f97694 allow marcher.bsp to work (initially, anyway) 2007-05-23 10:45:33 +00:00
Bill Currie 3fb03fc2be hah, should have been using __attribute__((used)) all that time (rather
than __attribute__((unused))). fixes the missing console in -x11
2005-08-04 15:27:09 +00:00
Ragnvald Maartmann-Moe IV 44c89c1904 Optimize fullbright testing for brushes, assorted other cleanups, test for
functions built into current GL drivers, as well as the old extensions, and
add incorrectly rendering BGRA support.
Whee!
2004-02-24 20:50:55 +00:00
Bill Currie 680c246e22 the inline went wandering by mistake. gives a tiny (< 0.5%) gain, but a
gain none the less
2004-02-23 04:46:55 +00:00
Ragnvald Maartmann-Moe IV 496025473c Remove no-longer needed parameters from function calls. 2004-02-23 04:25:53 +00:00
Ragnvald Maartmann-Moe IV 872498a1f0 Reorder a lot of code, removing tons of ifs. multitexture paths are a bit more
sane now. Also optimize QSG2 color handling, and fix some QSG2 bugs. Not that
anyone cares, nobody uses it anyways.
Should be faster, but isn't here. *grmbl*
2004-02-22 06:00:15 +00:00
Chris Ison e9d57e0401 Grievres' non-mtex FB being brighter than mtex FB fix. Note: it breaks non-RGBA replacement textures 2004-02-21 10:33:43 +00:00
Ragnvald Maartmann-Moe IV 5157f668ad Fix a bunch of state leaks that made multitextured fullbrights smear the world.
Now just have one (known) issue with bmodels with fullbright textures not
rendering their base texture. Floating fullbrights are nifty!

Also a number of optimizations, which need wider performance testing.
2004-02-21 05:36:19 +00:00
Ragnvald Maartmann-Moe IV 79689baa83 Grievre's crash fix. 2004-02-15 19:56:28 +00:00
Bill Currie 2d2173dc4e make R_RecursiveWorldNode non-recursive (needs a new name, now :). 0.4%
speedup in null-renderer gl: unknown for sw and sw32 (could be slightly
slower, left recursive version in but #if 0ed out jic)
2004-02-15 03:46:55 +00:00
Ragnvald Maartmann-Moe IV fef9b30bd7 QF, now complete with underbrights, thanks to Grievre.
Play with gl_overbright and gl_doublebright. That's an order.
2004-02-15 00:02:04 +00:00
Ragnvald Maartmann-Moe IV 0dae958a5a Grievre's fix for texture state leak. 2004-02-14 19:17:51 +00:00
Timothy C. McGrath b5b61d056f Grievre passed a one line patch to me which according to his description:
"Fixes a bug in dynamic lights (lightstyles weren't being rendered correctly
due to bad assumptions about dlightbits)"

It compiles fine, and seems to work, so, here it is.

Hikaru
2004-02-14 08:36:08 +00:00
Bill Currie 85a268c62f Grievre's lightmap/fullbright multitexture patch (fbs not tested due to
lack of drivers supporting 3 tmus)
2004-02-14 05:10:29 +00:00
Bill Currie f7b1196b8d fix the gl stack overflow (and make sure all skybrush surfaces get checked
and queued)
2003-08-28 19:50:28 +00:00
Bill Currie 7ead5a91f8 don't let gcc automaticly inline functions but make gcc inline bigger
functions when told to. also make gcc warn if it can't inline a function.

Explicitly inline several functions (including moving VectorNormalize to
mathlib.h so it /can/ be) resulting in a 5.5% speedup for spam2 (88 to 92
fps)
2003-08-11 06:05:07 +00:00
Bill Currie eb099ae0d3 make qf gcc 3.3 clean 2003-04-17 00:01:48 +00:00
Ragnvald Maartmann-Moe IV 8db859b77c Minor bit of neatening, remove CHAIN_SURF alias, so it's clearer what is being used where. 2003-03-25 07:25:22 +00:00
Ragnvald Maartmann-Moe IV 88c2735d9c Make sprite rendering use vertex arrays, as a test for detection of vertex array support (tests only for OpenGL 1.1 or better, at the moment, no driver blacklist yet). 2003-03-20 19:58:18 +00:00
Bill Currie 761a7546dd re-arrange things so __attribute__ and __builtin_expect are properly
autoconfiscated so rcsid will continue to work with gcc 3.3
2003-01-15 15:31:36 +00:00
Bill Currie ca4b3acd6c big protototype cleanup. Now, except for a few cases, all non-static
prototypes are in headers files.
2002-11-05 19:12:51 +00:00
Ragnvald Maartmann-Moe IV ff03367bc2 Whitespace and comment cleanups. 2002-08-25 05:55:28 +00:00
Ragnvald Maartmann-Moe IV 7bf21e20ed Use R_CullSphere for rotated bsp models. 2002-08-23 21:14:43 +00:00
Ragnvald Maartmann-Moe IV 32a85e7130 Clipping cleanups.
Calculate radius for alias models as well as brush.
Culling is no longer optional on alias models (was only ever disabled for viewmodel, which is a lot of extra effort to avoid clip testing 1 thing out of hundreds).
Clip QSG2 scaled alias models with a scaled bbox.
2002-08-20 00:48:59 +00:00
Bill Currie 4123d74e5e don't segfault when a surface uses the `null' texture (r_notexture_mip) 2002-08-09 06:07:25 +00:00
Bill Currie 3baec9e856 clean out the dead mtex code 2002-08-08 04:27:49 +00:00
Ragnvald Maartmann-Moe IV 85c7e43aef Split lightmaps off from surface drawing. 2002-07-23 19:57:47 +00:00
Ragnvald Maartmann-Moe IV d297c2b3a3 Colormod & alpha for brushmodels, excluding skypoly emittors. 2002-07-07 06:15:36 +00:00
Bill Currie f3132162ae speedup r_lightmap_components 3 by ~4.2% in null-render 2002-05-28 03:49:13 +00:00
Bill Currie acdd37b381 this seems to give ~2.9% speed boost to overkill for null-render 2002-05-28 00:04:01 +00:00
Ragnvald Maartmann-Moe IV 802bcc2762 Another 0.657% speedup for greyscale lighting. Unfortunately, at a price of considerable code duplication. But this is necessary for other planned changes. 2002-05-26 08:56:48 +00:00
Ragnvald Maartmann-Moe IV 6c8e2c24aa *grumbles about old gcc* 2002-05-26 07:07:10 +00:00
Brian Koropoff 75ec7de2f5 This better actually fix the lightmap code. 2002-05-25 21:55:34 +00:00
Brian Koropoff ddd96312b1 Removed useless dereferencing. With any luck I understand what despair's
code is supposed to do this time.
2002-05-25 20:04:42 +00:00
Ragnvald Maartmann-Moe IV b7900a2c43 Undo snax's order of operation breakage, and fix the typo that broke lightmap merging for r_lightmap_components 1.
The real problem with greyscale lighting, is in brush model loading. It'll probably take me a while to sort it out, since taniwha didn't get to it before taking off for the weekend. Sorry...
2002-05-25 15:01:23 +00:00
Brian Koropoff 11a14c077e Small order-of-operations fix. 2002-05-24 23:32:34 +00:00
Ragnvald Maartmann-Moe IV 2fe76b39e7 Smarter lightmap handling code. Still considerable optimization possible, at expense of duplicate code. 2002-05-24 17:12:41 +00:00
Jeff Teunissen 5b069de40c Redo r_wateralpha so that it doesn't force its value based on the watervis
serverinfo. Instead, create a new cl_wateralpha float variable that is set to
r_wateralpha->value in Host_Frame, and use that float during rendering.
2002-04-25 12:51:04 +00:00