havoc [Tue, 11 Oct 2016 01:05:53 +0000 (01:05 +0000)]
Added cl_bob_limit cvar which limits the maximum rage of view bobbing in a smooth way (rather than limiting the velocity and cl_bob independently, it limits the strength of the bob before the sinewave is applied). By default this is 7 (inspired by the quake limit of +4 to -7 range).
Added cl_bob_limit_heightcheck cvar (off by default) which uses tracelines to limit the maximum value of cl_bob_limit based on the ceiling and floor height.
Added cl_bob_velocity_limit cvar which replaces the hard-coded 400 in a few places for xyspeed purposes.
Overhauled quake3 shader loading such that it now produces shader passes that could render the material mostly correctly (rendering not yet implemented for the pre/post passes the logic identifies).
Main visible effect of this is that quake3 maps look more correct, but don't have any fancy effects yet.
This changed the loaders for all other formats that produce texture_t as texture->materialshaderpass-> is the new source of truth for several things.
Fix Q2BSP texture loading, Q2BSP contents issues, and add support for SURF_ALPHATEST for any maps that might use it, force fullbright rendering on SURF_TRANS33/SURF_TRANS66/SURF_WARP textures which fixes the rain in 3v3gloom3.bsp and chainlink fence textures on tkse.bsp and glass transparency on gloom1se.bsp among others. Also fix the SURF_FLOWING scroll rate when combined with SURF_WARP.
Also fixed the collision issues caused by stomping over Q1BSP data which caused traceline to break on Q1BSP after loading a Q2BSP map, thanks Supa for that bug report and finding other Q2BSP issues.
Changed naming of glsl/default.glsl and hlsl/default.hlsl to glsl/combined_crc*.glsl and hlsl/combined_crc*.hlsl - these are now effectively versioned by the crc of the builtin shader code, so if customization is applied it must match the current crc of the engine shader.
This should prevent any future shader version compatibility issues (at the cost of customization being harder to maintain).
Refactored shadermodeinfo related code to clean it up and make it more maintainable.
Overhauled shadowmap rendering to use an atlas texture, this is overall a speed loss on default settings (-7.7% fps on timedemo demo1, or -3% with r_shadow_deferred) but a gain on realtime world lighting (+21.1% normal, +1.7% with r_shadow_deferred) on NVIDIA GTX 680.
On video drivers with higher framebuffer switching costs, this should be a framerate gain in all situations.
Feature-wise this brings support (in future) for shadowmapping on transparent lit surfaces, and imposes an upper bound on how many pixels of shadowmaps will be rendered in a frame (shadowmap resolution automatically becomes more coarse on frames where they do not fit).
havoc [Sun, 28 Aug 2016 05:29:09 +0000 (05:29 +0000)]
Added r_shadow_bouncegrid_lightpathsize which is an alternative to blur
- but in practice this is just slower at a value of 3 than 1 is with
blur, so blur remains the default approach.
Implemented r_shadow_bouncegrid_floatcolors cvar which uses fp16 and
fp32 float formats to increase dynamic range.
Overhauled the default values of the bouncegrid cvars to look better.
havoc [Sat, 27 Aug 2016 22:28:59 +0000 (22:28 +0000)]
implemented r_shadow_bouncegrid_blur, this tremendously improves
quality at a cost of processing time, eliminating many rounding error
problems in all levels.
renamed several r_shadow_bouncegrid_* cvars to have a dynamic prefix,
and split spacing so that it can also be different between
static/dynamic modes (static now uses 32).
havoc [Sat, 27 Aug 2016 19:34:06 +0000 (19:34 +0000)]
Refactored r_shadow_bouncegrid light splatting code, it now makes an
array of light paths and then performs their splatting in a separate
step with an optional sort.
Implemented culling of out-of-view light paths in dynamic mode.
havoc [Sat, 27 Aug 2016 18:00:00 +0000 (18:00 +0000)]
Refactored r_shadow_bouncegrid code into several functions, changed
photon distribution math to make the photons more stable from frame to
frame (in dynamic mode), the number of photons fired is now based on
r_shadow_bouncegrid_intensityperphoton rather than always going for
maximum photons (accordingly r_shadow_bouncegrid_photons has been
renamed maxphotons and will still apply the old logic if it must).
havoc [Sat, 27 Aug 2016 03:17:49 +0000 (03:17 +0000)]
Fix a serious bug with r_shadow_bouncegrid_static where it used
R_CullBox and other view-dependent performance optimizations when
compiling the static texture - thanks to Vic for finding this bug!
Added darkplaces-osx-sdl launch script, this has been simplified since
we don't support OSX 10.5 anymore (and thus do not have to worry about
broken x86_64 binary support).
divverent [Mon, 4 Jan 2016 18:20:35 +0000 (18:20 +0000)]
Unbreak Nexuiz weapon animation.
Nexuiz uses h_*.dpm models that are mostly vertex-less (there are 6 dummy ones)
and merely move bones in order to move around the first-person weapon.
This means that these models (or rather, their surface meshes) will be
considered "non-animated" by the rendering code, given their dummy vertices are
never moved by animations.
However, a function to build animation subframes lists from animation group
numbers - which is called by gettaginfo and similar functions that locate
attachment points - falsely looked at the isanimated flag of the surface mesh
to decide whether to really build the list of subframes or not - and this was
wrong, given that statically displayed models that do move tags/bones do exist!
This commit removes this use of the isanimated flag and treats models with
animated and non-animated surface mesh the same for purposes of animation frame
evaluation.
divverent [Tue, 24 Nov 2015 14:57:58 +0000 (14:57 +0000)]
Leaktest: disable support for following target/targetname by default.
Instead, mark any entities created during initialization as non-leaky.
This should solve everything that the targetname support was meant to
solve (namely info_notnull entities), but is more general (e.g. would
also work with Xonotic's killtarget/target2/target3/target4 and
target0/name of Doom 3).
divverent [Tue, 24 Nov 2015 13:39:23 +0000 (13:39 +0000)]
Make the number of frames used for initial settling configurable.
Quake uses two frames, which should normally be good enough anyway. This
is mainly for mods that use more than 2 frames for initialization to
avoid some minor odd effects to clients that connect that early.
havoc [Sun, 9 Aug 2015 20:54:26 +0000 (20:54 +0000)]
Add darkplaces.rc to the vcxproj files for sdl, sdl2 and dedicated targets.
Changed the CompanyName in the darkplaces.rc to "DarkPlaces Contributors", also changed the icon line to better match the standard ICON line in new VS2013 projects in case that matters.
havoc [Sun, 9 Aug 2015 18:30:47 +0000 (18:30 +0000)]
Fixed two compile issues with vid_sdl.c.
Added support for SDL2 compilation in vs2010, vs2012, vs2013.
Changed the build directories for all vs2010, vs2012, vs2013 projects - they are now more consistent (output binaries go into SolutionDir, intermediate files have a fully qualified directory so they don't conflict between builds).
Audited and reduced differences between vs2010, vs2012, vs2013 projects.
divverent [Sat, 21 Mar 2015 22:09:26 +0000 (22:09 +0000)]
Add a cvar: r_shadow_realtime_world_importlightentitiesfrommap
0: Never import lights from the .bsp/.ent file on map load.
1: Import lights from the .bsp/.ent file on map load if no rtlights are present.
2: Always use the .bsp/.ent's light entities, ignore rtlights files.
havoc [Fri, 20 Mar 2015 06:43:08 +0000 (06:43 +0000)]
Fix a crash when playing q2bsp maps where t->currentframe is dereferenced, and it is a dangling pointer that was left corrupt by the loader - fixed that as well.