Change default value of r_shadows_shadowmapscale from 1 to 0.25, so that
shadows cover a larger part of the level around the eye.
Change the way r_shadows 2 size is calculated so that it uses 1/4th of
the texture atlas size (at default this would be 2048 of 8192) rather
than 2*r_shadow_shadowmapping_maxsize (at default that was 2*512 = 1024
of 8192).
Refactored R_UpdateEntityLighting to CL_UpdateEntityShading, which sets fields like ent->render_modellight_ambient.
Added texture->render_modellight_ambient and similar fields which concretely define how the material is to be rendered, so all of the various tweaks and modifiers are no longer buried in R_SetupShader_Surface which has now been refactored heavily.
Removed R_LightPoint as it's really not necessary - this change will make lit particles a little bit slower as R_CompleteLightPoint is a slightly more expensive function.
Refactored R_CompleteLightPoint to have more consistent code, changed the final color math so that it passes q1bsp/q2bsp lighting through unmodified.
Changed shading of tag_entity attachments - they now use the root entity's origin for shading, this fixes r_shadows where the shadows could go in different directions on CSQC entities (r_shadows code already contained a hack to work around this problem for network entities).
Renamed r_refdef.lightmapintensity and ambient to r_refdef.scene.lightmapintensity and ambientintensity.
Frank [Sun, 15 Mar 2020 01:43:41 +0000 (21:43 -0400)]
Add a Quake Live-style mouse acceleration mode.
Its cvars are m_accel_power*, and the cvar meanings are as close as possible
to the ezQuake implementation (as its source is available). Names differ though
due to conflicts with the current linear acceleration mode.
Original code by Frank <franparpe@franparpe.org>, cleanups by Rudolf Polzer <divVerent@xonotic.org>.
::stable-branch::merge=67692f92e177d44231df0d59833cee069e71eb9a
divverent [Sat, 22 Feb 2020 03:47:48 +0000 (03:47 +0000)]
Another flag bites the dust. This time: -ffinite-math-only.
Since GCC 5, with this flag set, NaN compares equal to zero in some cases but
not others. Causes e.g. "attempted division by zero" error spam from this QC
code:
float x = nan("");
if (x == 0) {
return 0;
}
return 1.0 / x;
Yes, those NaNs should not be happening in the first place, but suddenly
passing some but not all equality checks to zero seems rather dangerous.
Reference: issue #2412 (not a fix for it; the QC code has a problem too but
this change helps track it down properly).
After migrating to SDL2 interfaces there is noise during startup fix
this by initializng buffer as specification requires.
Per SDL_AudioCallback spec:
The callback must completely initialize the buffer; as of SDL 2.0, this buffer is not initialized before the callback is called. If there is nothing to play, the callback should fill the buffer with silence.
Make the semantics of CL_VM_UpdateView more clear - if CSQC is loaded, it is required to provide the CSQC_UpdateView function, and won't render a view if it does not call that, so we don't need to check its return value.
New alternative to fullbright: r_fullbright_directed.
Set this to 1, and anything EF_FULLBRIGHT or fullbright due to
r_fullbright or unlit map (but specifically not sprites and surfaces
with surfaceparm nolightmap) will have a directional effect applied to
them.
This mode is intended for testing maps in early development, and should
not be used for normal gameplay (although it should be rather harmless
there).
Manage resetting the key event state on video reinitialization centrally.
Fixes:
- No key state clear when SDL gets restarted.
- Key state clear was the wrong action - it allows all keys to get pressed
again, but does not actually release anything in cl_input.c, so e.g. +jump
binds stay pressed on vid_restart.
Only vid_wgl.c retains some vid-specific handling (reset of key state when
alt-tabbing out and back in) - there's a chance that we may need similar logic
in the other vid drivers; if so, it may be possible to do this in a shared
place too by watching for changes to vid_activewindow.
havoc [Sun, 25 Mar 2018 20:04:14 +0000 (20:04 +0000)]
Rewrote most of r_lightning.c, it now uses CL_MeshEntities in MESH_PARTICLES rather than its own rendering code.
Changed the texture generation so it is in the same orientation as the external texture to reduce some code duplication, and changed the look of it to more closely mimic the model-based lightning.
havoc [Sun, 25 Mar 2018 19:58:39 +0000 (19:58 +0000)]
Add CL_MeshEntities_*, every frame in the client all MESH_ entities are added to the frame if they have any surfaces - surfaces can be created with Mod_Mesh_AddSurface and friends. These entities have full material rendering support, which should allow reducing the number of special case renderable objects in the scene in future.
Add Mod_Mesh functions - these allow creation of dynamic mesh models.
Add Mod_LoadCustomMaterial which initializes a texture_t using a skinframe and some parameters, useful with Mod_Mesh and CL_MeshEntities.
havoc [Sat, 24 Mar 2018 21:35:50 +0000 (21:35 +0000)]
Change r_showbboxes to have outlined edges of the box, and the box is now rendered as doublesided which feels more consistent when moving in/out of large trigger boxes and similar.
Added r_showbboxes_client which shows bboxes of clientside qc entities.
havoc [Sat, 24 Mar 2018 21:34:21 +0000 (21:34 +0000)]
Add entity number to showtex overlay.
Add clientside qc entity support to showtex - trace is performed on client and server and the shorter one will be shown.
havoc [Sat, 24 Mar 2018 17:47:32 +0000 (17:47 +0000)]
Add skipmaterialflagsmask feature to TraceLine and friends - this allows more sensible skipping of non-occluders by material (MATERIALFLAGMASK_TRANSLUCENT is now useful).
Recreated TracePoint code from TraceLine code to make it set depth variables properly.
havoc [Sat, 17 Mar 2018 07:35:38 +0000 (07:35 +0000)]
Fix a bug with PRVM_64 where CSQC float stats were sent by aliasing to int64 and returning as int32, now correctly converts to float and then uses a union to get the int32 representation.
havoc [Sun, 11 Mar 2018 19:24:42 +0000 (19:24 +0000)]
Rework R_CanSeeBox a bit to support an eyejitter feature, and make it available throughout the renderer.
Make TraceLineOfSight check if the trace endpos is within a box, not just if fraction is 1 - this makes it much more likely to say an object is visible when the object overlaps walls and other obstacles as the rays only need to reach the box, it doesn't matter much where it goes inside the box.
havoc [Sun, 11 Mar 2018 19:08:41 +0000 (19:08 +0000)]
Change shadowless rtlights so that they are not occluded by anything - no pvs checks or portal culling.
This makes r_shadow_deferred 0 look the same as r_shadow_deferred 1 - lights fill their whole area if there are no shadows to block them.
This also fixes a popping issue with r_shadow_deferred 1 where the eye was not in a leaf the light considered to be visible, and thus the light was not drawn (which made quite a difference when you move back and forth between leafs that were and were not lit), since when it was drawn it lit everything in the area.
havoc [Sun, 11 Mar 2018 19:04:22 +0000 (19:04 +0000)]
Don't set MATERIALFLAG_NOSHADOW on SKY materials. They need to cast shadows to prevent issues in e1m7 and other cases where sky occludes light bleed into other areas.
But when loading Q1BSP, set MATERIALFLAG_NOSHADOW on SKY if it has non-SOLID contents behind it, this supports the e1m5 logo shadow trick.
havoc [Wed, 30 Aug 2017 04:29:14 +0000 (04:29 +0000)]
Fix GLSL shader to only specify invariant gl_Position on the vertex shader, not the fragment shader - woops, this is what I get for not testing that change.
havoc [Sun, 6 Aug 2017 15:33:55 +0000 (15:33 +0000)]
Use the invariant keyword on gl_Position on GLSL 1.20 or higher and GLSL ES
1.00 or higher, this should resolve zfighting between light polygons and
base surfaces.
A long long time ago this was using ftransform() which ensured invariance but use of the invariant keyword was not added when we switched away from that.
Thanks for the bug report:
https://www.reddit.com/r/quake/comments/6rwwm5/need_some_help_getting_quake_running_with/
SDL2: combine SDL_KEYDOWN events directly with following SDL_TEXTINPUT events when possible.
This solves ` keypresses that open/close the console also typing in a character
"once and for all". The ability to type the ` character into the console is not
impaired by this as con_closeontoggleconsole's logic to by default ignore the
toggleconsole key when in the console but not at the beginning of the line
still applies.
rcon server: add an explicit check against empty password, instead of assuming the calling code is correct.
This logic had a bug in the past that had been introduced by r8886 and
accidentally fixed when introducing multi-account support in r9420. The bug was
that rcon_password being empty led to the empty password being accepted in some
cases, as there was never any explicit logic to handle that in rcon - it was
more "accidentally" rejected by a packet formatting check which does not apply
to srcon as the empty password wouldn't be empty over the wire.
In other words: DP builds from [r8886, r9419] had a serious vulnerability and
the only workaround is to always have rcon_password set.
The check added here will complain and reject in case the calling code for some
reason no longer prevents empty passwords from being accepted.
Also adding comments to the new logic explaining how it prevents the empty
password from being accepted.
Fix a bug in collisions between brushes and brushes when the plane is rotating - this case is never used currently but it's definitely a bug worth fixing.
Fix bugs in ModList_RebuildList such that it no longer lists files in the quake directory as gamedirs.
These bugs were previously hidden by a different behavior in FS_CheckNastyPath until 20140716 where directories with a period in their name were skipped, but that was not a complete solution.
havoc [Sat, 14 Jan 2017 19:33:33 +0000 (19:33 +0000)]
added separate cl_nopred cvar to use when playing on qw servers since
players expect prediction in quakeworld, now cl_movement is only used on
dp6/dp7 servers.
havoc [Sat, 14 Jan 2017 19:33:33 +0000 (19:33 +0000)]
added separate cl_nopred cvar to use when playing on qw servers since
players expect prediction in quakeworld, now cl_movement is only used on
dp6/dp7 servers.
divverent [Wed, 11 Jan 2017 21:50:45 +0000 (21:50 +0000)]
Travis changes for Xonotic:
- Do not require root any more.
- Change the i386 build to build on Ubuntu directly, not in a chroot created using debootstrap.
- Remove the -isysroot option for OS X as the path broke after some Travis change.
divverent [Wed, 11 Jan 2017 21:50:45 +0000 (21:50 +0000)]
Travis changes for Xonotic:
- Do not require root any more.
- Change the i386 build to build on Ubuntu directly, not in a chroot created using debootstrap.
- Remove the -isysroot option for OS X as the path broke after some Travis change.
havoc [Tue, 3 Jan 2017 03:25:39 +0000 (03:25 +0000)]
Fix some crashes affecting dedicated quake servers where texture->materialshaderpass is NULL. A few other tweaks to ca_dedicated checks that were redundant.
havoc [Mon, 2 Jan 2017 01:12:46 +0000 (01:12 +0000)]
Fix rogue mission pack (Dissolution of Eternity) plasma launcher which
uses velocity so small initially that SV_CheckVelocity was zeroing it in
the denormal check - the threshold has been lowered by 3 digits since
this was really only meant to detect denormals, not mess with real
numbers
havoc [Mon, 2 Jan 2017 00:26:06 +0000 (00:26 +0000)]
change shadowmapping atlas from 4096x4096 to 8192x8192 because it looks
bad when it has to degrade shadowmap resolution to fit into 4096x4096
some of the time in start.bsp
this texture size is 256MB and should fit on most video cards...
havoc [Sat, 10 Dec 2016 19:50:51 +0000 (19:50 +0000)]
Fix bug in loading additional skins after the ones that exist in the model in mdl loader, which resulted in the missing texture being shown because the skin referenced a texture beyond num_textures.
vic [Fri, 2 Dec 2016 20:19:47 +0000 (20:19 +0000)]
Use tighter bounds for bouncegrid texture
Calculate bounds enclosing all lights instead of using the world bounds.
Maps with unlit monster containers such as e1m7 benefit from reduced RAM usage.