havoc [Tue, 24 Dec 2002 23:00:59 +0000 (23:00 +0000)]
loadimagepixels is a little cleaner now (yes made cleaner by goto...) and dprints info about loaded images
critical bug in image_loadskin fixed (s->basepixels_width and height were not being set)
havoc [Sun, 22 Dec 2002 22:56:09 +0000 (22:56 +0000)]
unified model skinframe loaders used for mdl, md2, md3, and bsp textures (both external and internal where applicable)
imageskin_t and image_loadskin/image_freeskin functions added to image.[ch] for use by the unified skinframe loaders
added palette_nocolormap
split r_shadow_bumpscale cvar into r_shadow_bumpscale_bumpmap (for _bump textures) and r_shadow_bumpscale_basetexture (self explanatory)
now loads _norm normalmap textures (tenebrae compatibility)
_nmap normalmap texture support removed (it was broken in the previous release and I don't need to bog down the texture loader with even more unnecessary names)
r_shadow_lightattenuationpower added (default 2, to leave it looking identical to previous versions, this controls the falloff curve of light)
renamed detailtextures array to mod_shared_detailtextures and moved it and related code to model_shared.[ch]
removed progs/missile.mdl shadow casting check (in r_shadow_realtime mode) I had forgotten to remove before committing last time
molivier [Wed, 11 Dec 2002 17:51:31 +0000 (17:51 +0000)]
Some stupid Linux machines (i.e. Mandrake) seem to ignore their own network properties; in this case, we use the loopback address as the default one. Also, fixed an inoffensive bug when binding the UDP control socket.
havoc [Mon, 2 Dec 2002 01:52:13 +0000 (01:52 +0000)]
changed master server list around a bit (added rick.cube-sol.net and my master server as well)
master server list can now have gaps
ipaddr is now parsed from the getserversResponse properly (thanks Rick)
now reports port number in developer print for sending messages to master servers
havoc [Mon, 2 Dec 2002 01:43:50 +0000 (01:43 +0000)]
reverted to fast version of trianglefacinglight code, as it was found to be a speed gain in benchmarks compared to the light radius checking version
fixed an unitialized variable warning
havoc [Mon, 2 Dec 2002 00:42:25 +0000 (00:42 +0000)]
renamed and altered SZ_HexDumpToConsole to be Com_HexDumpToConsole which takes a qbyte * and a size, instead of a sizebuf_t
added SZ_HexDumptoConsole which just calls Com_HexDumpToConsole
havoc [Sat, 30 Nov 2002 09:44:26 +0000 (09:44 +0000)]
decals added back due to popular demand, currently not at all optimized (they're just particles) and not clipped to surfaces
cl_decals 1 to enable (this is saved to config), cl_decals_time and cl_decals_fadetime change settings for them (these are also saved to config)
redesigned particle additive flag to be a blend mode number (PBLEND_ALPHA, PBLEND_ADD, or PBLEND_MOD - for decals), lots of special hacks for the nifty new PBLEND_MOD mode
havoc [Wed, 27 Nov 2002 00:22:15 +0000 (00:22 +0000)]
changed format of aliasvertex_t to use floats (hopefully this is a speedup, it sure bloats memory use - 36 bytes each, compared to 4 bytes in mdl/md2)
corrected scale for md3 vertices mentioned in header (md3 is still not supported yet)
added some unfinished mesh structures to begin support for md3
havoc [Tue, 26 Nov 2002 20:49:13 +0000 (20:49 +0000)]
mdl and md2 vertices are now stored in a different structure called aliasvertex_t, it has all the features of mdl, md2 and md3 formats and simplifies interpolation, it also has precomputed texture vectors for faster realtime lighting.
normals are no longer interpolated if not needed (fake shadows and shadow volumes do not need them)
added VectorM, VectorMAM, VectorMAMAM and VectorMAMAMAM macros to make aliasvertex_t interpolation code more readable
havoc [Fri, 22 Nov 2002 12:43:30 +0000 (12:43 +0000)]
r_shadows is now ignored when in r_shadow_realtime mode
r_shadow_realtime 3 added (no depth test on visible shadow volumes)
visible shadow volumes now have backface culling disabled, to better demonstrate the overdraw
havoc [Wed, 20 Nov 2002 12:54:15 +0000 (12:54 +0000)]
CalcSurfaceExtents now uses surf->poly_verts instead of edges
brush model bounding box calculations are now based on meshes instead of edges
CalcSurfaceExtents has been merged into Mod_GenerateSurfacePolygon
msurface_t firstedge and numedges have been removed (they were only used for generating the polygon during loading)
shuffled around msurface_t fields in order of most common access at the top, to least common at the bottom, this is in an attempt to reduce wasted memory traffic
havoc [Wed, 20 Nov 2002 11:18:50 +0000 (11:18 +0000)]
removed all 3x4 matrix support (wasn't used, and isn't likely to ever be used)
moved Matrix4x4_Print to mathlib.[ch] because it really doesn't belong in the entirely quake-independent matrixlib.[ch]
havoc [Sat, 16 Nov 2002 12:49:34 +0000 (12:49 +0000)]
lightmap update checking is now handled very differently; each brush model has a set of lightmap chains for each light style, and they are marked if the light style's value changes, similarly dlights mark surfaces they touch as well... both use surf->cached_dlight... this doesn't seem to be a speed gain (or loss) at present, but allows further restructuring which should be a speed gain
havoc [Sat, 16 Nov 2002 01:24:03 +0000 (01:24 +0000)]
rewrote how texture chains are handled, they are now stored outside the surfaces, and are rebuilt as the player moves through the world (bmodel texture chains are just left untouched)
good efficiency improvement I think
havoc [Sun, 10 Nov 2002 05:03:42 +0000 (05:03 +0000)]
added Nexiuz TE_ effects (prefixed TE_TEI_) and Nexiuz plasma trail (an override for EF_BRIGHTFIELD)
Nexiuz mode disables fullbrights
reshaped some of the particle structure (flags is gone, broken apart into separate fields again)
added tex_beam (which uses a separate texture instead of the particle font because it needs to repeat)
simplified some of the texture font generation (tex_ variables now indicate where to put the images in the texture)
now resets trail positions if entity was not active in previous frame
now gives packet dump when Host_Error is called during client message parsing code
now frees the model(s) being loaded when Host_Error is called during model loading code
removed modelflush command because it crashes the realtime lighting code (which points to leafs and surfaces in the world model, a problem which does not exist with r_restart and vid_restart)
R_Stain and R_CalcBeamVerts now use const where appropriate
havoc [Fri, 8 Nov 2002 23:26:54 +0000 (23:26 +0000)]
Elric's changes:
JPEG texture loading using libjpeg (entirely optional at runtime - if not present, it won't load it)
gl_extensionfunctionlist_t is now renamed dllfunction_t and part of a shared system for library opening/function retrieval (functions Sys_LoadLibrary, Sys_GetProcAddress, Sys_UnloadLibrary - for this the library handles are considered void *'s)
LordHavoc's changes:
fixed libjpeg support in non-win32 by using jpeglib.h - honors jpeglib.h's idea of boolean - Linux libjpeg is compiled with boolean as int, unlike windows where it is apparently byte - unfortunately this also means you need libjpeg-devel installed to compile it in non-win32, not sure what can be done about this (but most people seem to have that anyway...)
looks for libjpeg.so.62 instead of libjpeg.so
havoc [Thu, 7 Nov 2002 20:50:05 +0000 (20:50 +0000)]
glossmap textures are now brighter (no change to forced gloss brightness)
now clears lights when reloading lights
r_editlights_quakelightsizescale cvar added, default 0.8, controls size of lights imported from maps, gets a major speed gain but makes the map a little darker
R_Shadow_NewWorldLight now checks if radius or color is too dim and won't spawn such lights
in editing mode the centers of lights are visible now (as crosshair images)
light selection is now done a bit differently - the more precisely you point at a light, the higher it's rating gets, sometimes surpassing the closer lights in the area
havoc [Mon, 4 Nov 2002 01:09:33 +0000 (01:09 +0000)]
now clears stencil to 128 instead of 0, this avoids problems with arbitrary incr/decr orders
stencil shadows are now always erased by glClear, never by drawing again, removes r_shadow_erasebydrawing cvar
shadow volumes now have a nudge away from the surface that cast them, this is controlled by the r_shadow_shadownudge cvar (default 1 unit), avoids rare z fighting issues
shadow volume projection distance is now not infinite for alias model volumes, because they are more well-behaved than the world shadows...
msurface_t poly_radius and poly_radius2 removed
now validates elements in more parts of loading (hoped this would reveal a model shadow bug, but it didn't)
Mod_ShadowMesh_AddVertex now uses a hash table search to speed up static shadow volume building (unfortunately this doesn't seem to be the real speed problem)
removed ALLOCMESHINPIECES option from Mod_ShadowMesh code
removed non-PRECOMPUTEDSHADOWVOLUMES option from static shadow volume creation
removed some unused variables
havoc [Tue, 29 Oct 2002 18:31:12 +0000 (18:31 +0000)]
bumpscale is now adjustable (r_shadow_bumpscale) for experimenting (it's not saved to config)
.lights loading now has the correct light intensity
torchs now spawn lights above their location so the shadow is cast down, not up
havoc [Tue, 29 Oct 2002 15:36:49 +0000 (15:36 +0000)]
changed how QC interpreter handles edict field access - the entvars struct is now a pointer - yes this changed that many files...
discovered gcc 2.95.3 is the sole cause of map change crashs in the QC interpreter - it does not compile pr_exec.c correctly somehow (I think OP_ADDRESS is the only place it has a problem), makefile now refers to gcc-3.1 (maybe this should be changed, but oh well for now)
havoc [Sun, 27 Oct 2002 13:15:43 +0000 (13:15 +0000)]
gloss now works correctly
major speedups to realtime lighting mode (it's now actually playable on my machine)
world lights are now handled by r_shadow.c instead of the lights list in the world model
world lights can be ingame edited/loaded/saved (the file name ends in .rtlights), this is all controlled by r_editlights* commands/cvars
realtime lighting cvars renamed from r_light_* to r_shadow_*
r_shadow_realtime takes the place of r_shadows modes 2 and 3, mode 1 is realtime lighting, mode 2 is realtime lighting plus visible shadow volumes overlaid
r_shadow_lightingmode variable added (updated each frame) indicating whether or not realtime lighting is active
changed how player model and chase_active is handled (player model is now considered a forced RENDER_EXTERIORMODEL), so player now casts shadows
R_Shadow_Volume no longer takes a vertex parameter, it is implied that it is in varray_vertex (since all the code relied on this fact anyway)
R_Shadow_Volume's code has been split out into reusable functions (R_Shadow_ProjectVertices, R_Shadow_MakeTriangleShadowFlags, R_Shadow_BuildShadowVolumeTriangles)
R_Shadow_RenderLighting split into R_Shadow_DiffuseLighting and R_Shadow_SpecularLighting since sometimes it's usable to use more than one call to diffuse lighting (colormapped models)
R_Model_Alias_DrawLight now handles colormapping
added Light_CullBox and LightAndVis_CullBox functions for culling shadow volumes
R_DrawWorldLightShadowVolume has been moved to r_shadow.c
Mod_ShadowMesh_Begin now takes an initial number of triangles to hold, number of triangles in each additional shadowmesh is now based on previous mesh
R_Model_Brush_DrawLightForSurfaceList added to greatly reduce wasted lighting
rewrote visibility logic in R_Model_Brush_DrawLight, now uses different approachs for bmodels and world
lights are now pvs culled (according to what leafs are visible to the viewer, and what leafs are visible to the light)
R_Shadow_Stage_EraseShadowVolumes now returns an int, indicating whether or not to draw the shadow volumes again to erase
rewrote how texture info based on entity and time is updated (it is now a function called R_UpdateTextureInfo)
fixed a ton of bugs relating to animated textures and transparency of bmodels (also changed texture_t currentframe to no longer be an array)
disabled building of surface neighbors (oh sure I made it a lot faster and stuff, but it's still not practical, and is no longer necessary)
changed parameters of model_t DrawLight function to no longer take distbias and subtract
Mod_ProcessLightList is no longer called
mlight_t fields relating to shadow volumes have been commented out
Mod_ValidateElements function added
notes on enormous cost added to Mod_BuildTextureVectorsAndNormals (188 float operations per triangle, and 39 float operations per vertex)
added (disabled) code for allocating and freeing shadowmeshs in pieces, just for obsessive memory corruption detection (none was found)
Mod_ShadowMesh_AddTriangle and Mod_ShadowMesh_AddMesh functions added, and Mod_ShadowMesh_AddPolygon now uses AddTriangle (this is a slowdown but I'm not sure it matters that it is, it fills out meshs more completely)
added (disabled) code for Mod_ShadowMesh_Finish to work without reallocating meshs
R_Shadow_ResizeTriangleFacingLight and R_Shadow_ResizeShadowElements added
R_Shadow_RenderShadowMeshVolume added (properly renders shadowmesh_t chains, fixing all the bugs with static shadow volume rendering)
r_shadow_blankbumptexture is now 1x1
r_shadow_blankglosstexture and r_shadow_blankwhitetexture added (both 1x1)
added a 4 texture path for r_shadowtexture3d 0 mode
when static shadow volumes are constructed for world lights, it is now done by constructing a combined mesh of all lit geometry, and then casting shadows from that (this reduces shadow volume edges greatly, since separate polygons become a continuous mesh during the mesh creation)
havoc [Tue, 22 Oct 2002 07:13:13 +0000 (07:13 +0000)]
reworked visibility a bit (added VIS_CullBox and VIS_CullSphere) so it can be pretty accurate
made pvs surface/leaf lists to make R_SurfaceWorldNode as fast as possible
world geometry now casts shadows from frontfaces instead of backfaces
fixed most shadowing bugs
static shadow volumes now work (other than one bug I'm trying to find) and are on by default