havoc [Sun, 5 Aug 2018 23:17:18 +0000 (23:17 +0000)]
Remove a lot of OpenGL extension checks.
Rename OpenGL extension functions and defines to core names.
Require the functions for all of the OpenGL3.2 Core Profile functionality - we're not asking for a Core Profile context yet, that will be later.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12453
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 5 Aug 2018 22:09:56 +0000 (22:09 +0000)]
Change a comment and a description to remove mentions of GL_ARB_occlusion_query because it is standard in GL3.2.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12452
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 5 Aug 2018 21:39:11 +0000 (21:39 +0000)]
Upload the VBOs for Mod_Mesh models (such as the UI) during Mod_Mesh_Finalize.
Refactored the vbooffset handling in models to allow different vertex buffers for each array (this would only happen in the dynamic case when a buffer is recycled - so some code makes that assumption about dynamic buffers when freeing these).
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12451
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 5 Aug 2018 21:29:44 +0000 (21:29 +0000)]
Fix UI corruption caused by poor handling of missing VBO with firstvertex > 0.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12450
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Tue, 31 Jul 2018 02:05:57 +0000 (02:05 +0000)]
Fix gl_debug code which was broken as I didn't copy enough of the headers over from another checkout.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12449
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Tue, 31 Jul 2018 01:35:10 +0000 (01:35 +0000)]
Remove some unused stuff related to glDrawRangeElements.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12448
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 29 Jul 2018 23:35:29 +0000 (23:35 +0000)]
Make the VBO handling in RSurf_PrepareVerticesForBatch much more consistent by refactoring it into RSurf_UploadBuffersForBatch.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12447
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 29 Jul 2018 23:23:36 +0000 (23:23 +0000)]
Fix a console dprint about shader compilation that was trying to print a 64bit permutation number as 32bit.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12446
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 29 Jul 2018 23:22:01 +0000 (23:22 +0000)]
Disable the code path that compiles geometry shaders - we don't currently use any of these and the code path is broken.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12445
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 29 Jul 2018 23:20:37 +0000 (23:20 +0000)]
Remove some old fixed-function state tracking that wasn't needed.
Add gl_debug implementation which was forgotten in previous change.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12444
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 29 Jul 2018 23:18:44 +0000 (23:18 +0000)]
Assume that GL_EXT_blend_subtract is supported.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12443
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 29 Jul 2018 23:15:59 +0000 (23:15 +0000)]
Assume that GL_ARB_texture_compression is supported.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12442
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 29 Jul 2018 23:12:41 +0000 (23:12 +0000)]
Add gl_debug cvar, if enabled the GL context will have GL_ARB_debug_output enabled, which will print in the console.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12441
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 29 Jul 2018 23:04:41 +0000 (23:04 +0000)]
Remove gl_dither cvar, it isn't supported in GL3.2 Core Profile.
Remove unused gl_fbo cvar.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12440
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 1 Jul 2018 08:45:55 +0000 (08:45 +0000)]
One last edit for the UI rendering with materials change.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12439
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 1 Jul 2018 08:22:40 +0000 (08:22 +0000)]
Use the model renderer on the UI - this means q3shaders and other material features now work.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12438
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sat, 30 Jun 2018 21:59:21 +0000 (21:59 +0000)]
Change MAX_TEXTUREUNITS from 16 to 32 - this fixes a memory corruption that was causing all kinds of problems (e.g. cachepic issues).
Get rid of vid.texarrayunits, vid.teximageunits, vid.texunits variables as they are meaningless, assume 32 (because that is how many GL enums exist).
Don't clear texture units on reset, we don't know how many texture units really exist and it's largely pointless.
Do a more thorough unbind of textures on deletion, just for good measure.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12437
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 17 Jun 2018 17:32:36 +0000 (17:32 +0000)]
Fix a printf bug in Draw_CachePic so it passes path rather than pic
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12436
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sat, 16 Jun 2018 17:46:08 +0000 (17:46 +0000)]
Remove cl-release and similar targets from makefile as they no longer exist.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12435
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Tue, 22 May 2018 02:11:13 +0000 (02:11 +0000)]
Add more debugging prints in Draw_CachePic, most of these are for edge cases.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12434
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Tue, 22 May 2018 02:09:42 +0000 (02:09 +0000)]
Clean up GL extensions a bit to only have the stuff the engine actually uses.
Remove a few things that offend GL3.2 Core Profile.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12433
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Tue, 22 May 2018 01:43:35 +0000 (01:43 +0000)]
Rename RENDERPATH_GL20 to RENDERPATH_GL32.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12432
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Tue, 22 May 2018 01:40:17 +0000 (01:40 +0000)]
Add more CHECKGLERROR calls, and clean up a few obsolete code scraps.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12431
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Tue, 22 May 2018 01:33:35 +0000 (01:33 +0000)]
Remove unused gl20_texunit enum since all of the non-GL paths have been removed and the GL path allocates texture units according to usage.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12430
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Tue, 22 May 2018 01:31:16 +0000 (01:31 +0000)]
Remove use of glPolygonStipple - it will need to be reimplemented in the shader using discard, or drawn as an overlay over the area.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12429
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 20 May 2018 23:59:04 +0000 (23:59 +0000)]
Just assume GL_ARB_texture_non_power_of_two and a number of other extensions are supported, this simplifies a lot of conditions.
Always use GL_ARB_vertex_buffer_object.
Remove use of glDrawRangeElements as it doesn't exist in GL3.2 Core Profile, and is less necessary with GL_ARB_vertex_buffer_object.
Merge a number of extensions into the core opengl functions.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12428
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 20 May 2018 23:44:22 +0000 (23:44 +0000)]
Remove unused light attention textures (2D and 3D) since the GL1 path was removed.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12427
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 20 May 2018 23:38:27 +0000 (23:38 +0000)]
Bugfix: Don't use OpenGL 3.2 core context just yet - more fixes needed first.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12426
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 20 May 2018 20:57:46 +0000 (20:57 +0000)]
Remove support for libSDL1.2 which has been deprecated for years.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12425
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 20 May 2018 20:43:24 +0000 (20:43 +0000)]
Remove some unused parameters on R_SetupShader_Generic.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12424
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 20 May 2018 20:39:22 +0000 (20:39 +0000)]
vid_bitsperpixel is now locked to 32.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12423
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 13 May 2018 05:06:07 +0000 (05:06 +0000)]
Removed per-platform clients (wgl/glx/agl) - now only SDL2 client
exists.
Removed dedicated server from VS2017 projects - it's not really needed.
Removed cd_sdl.c since SDL1.2 support is not maintained, and the SDL2
code path in it is equivalent to cd_null.c as SDL2 does not support
controlling cd audio playback - also removed cd_null.c and the
corresponding code in cd_shared.c, which now only uses faketrack mode.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12422
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 6 May 2018 04:39:34 +0000 (04:39 +0000)]
Remove r_vertexgeneric_t, r_vertexmesh_t, vid.interleavedarrays and code related to them.
Refactor r_showsurfaces code to modify the rsurface.batchlightmapcolor4f in place instead of using the R_Mesh_PrepareVertices_Generic_Lock/Unlock functions which have been removed.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12421
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sat, 5 May 2018 19:20:15 +0000 (19:20 +0000)]
Fix more Mod_ValidateElements sequencing issues - always generate
element3s before calling it, or don't pass element3s at all.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12420
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sat, 5 May 2018 18:54:37 +0000 (18:54 +0000)]
make precache_pic not use the fallback image
(reported by terencehill)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12419
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sat, 5 May 2018 08:54:40 +0000 (08:54 +0000)]
Fix a bug in MD3 model loading that caused warnings from
Mod_ValidateElements.
Fix a bug in the output of Mod_ValidateElements which did not show the
mismatching elements correctly.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12418
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Fri, 4 May 2018 04:37:14 +0000 (04:37 +0000)]
Simplify Mod_ShadowMesh_* functions - removed support for every unused feature of shadowmeshes (e.g. texcoords, and linked list meshes).
Add back Mod_CreateCollisionMesh which was mistakenly removed.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12417
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Wed, 2 May 2018 07:23:56 +0000 (07:23 +0000)]
Remove Mod_CreateCollisionMesh and reduce the exposed API of Mod_ShadowMesh, it really doesn't need to support most of the things it supports as only compiled shadowmaps use it now.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12416
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Wed, 2 May 2018 07:17:13 +0000 (07:17 +0000)]
Remove model->surfmesh.shadowmesh which was a vertex-welded version of the regular surfmesh, we don't need that as we're not computing triangle neighbors as shadow volume support was removed.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12415
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Wed, 2 May 2018 07:00:12 +0000 (07:00 +0000)]
Remove shadowvolume rendering entirely, now shadowmaps are the only kind of shadow.
Also remove R_SetStencilSeparate and corresponding gl bindings since it isn't needed (R_SetStencil could also be removed but it might have uses).
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12414
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Tue, 1 May 2018 06:49:00 +0000 (06:49 +0000)]
Refactored and improved Mod_ValidateElements so it also validates element3s and has more useful output.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12413
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Tue, 1 May 2018 06:48:05 +0000 (06:48 +0000)]
Fix a crash on Doombringer duel5.bsp where one of the lights has more than 32768 triangles - this was using more than one shadowmesh and the sidetotals code was written incorrectly to assume there is a single shadowmesh per light - so now shadowmeshes are preallocated large enough for the entire model, to ensure there is only one.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12412
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Tue, 1 May 2018 02:48:46 +0000 (02:48 +0000)]
Generate a pvs for refraction renders just like for reflection renders, this fixes a water rendering issue in the Doombringer map duel2.bsp where certain leafs did not include the necessary pvs data (or something was wrong with how the renderer used the existing vis data).
In light of the above, allow r_wateralpha when r_water is used, even if the bsp is not watervised - this works for all non-recursive cases (so the elder hall water pool in start.bsp is still broken).
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12411
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Tue, 1 May 2018 02:21:46 +0000 (02:21 +0000)]
Fix a missing newline in system vars mismatch warning.
Fix a typo in r_shadow_culllights_trace_pad which made it not work.
Fix the name used on index buffers for Mod_ShadowMesh geometry - loadmodel->name doesn't make sense given where this is called.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12410
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Mon, 30 Apr 2018 21:59:24 +0000 (21:59 +0000)]
Fix lighting origins on CSQC entities.
Fix a couple crashes with showtex 1 on level change where prog is not fully initialized.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12409
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Mon, 30 Apr 2018 19:54:49 +0000 (19:54 +0000)]
Fix clipping plane bug on r_water - a line had been deleted when removing RENDERPATH_SOFT that should have stayed.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12408
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Mon, 30 Apr 2018 06:38:44 +0000 (06:38 +0000)]
Fix bugs with unloading of cachepic skinframes in QC menus - the reloading was broken in some weird way that made it white (it wasn't reusing the skinframe).
Simplify Draw_CachePic behaviors with regards to NewPic and textureflags (mismatch now causes texture reload rather than having multiple with the same name in memory).
Improved reloading of unloaded pics by reusing the existing skinframe, so it can not produce duplicates.
Make Draw_NewPic clear the pic->autoload flag, this is a behavior change in VM_CL_ReadPicture.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12407
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 29 Apr 2018 10:27:38 +0000 (10:27 +0000)]
Fix a typo in DrawQ_RotPic which broke it badly.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12406
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 29 Apr 2018 10:16:09 +0000 (10:16 +0000)]
Fix multiple bugs with ft2 font loading that were caused by the switch to cachepic and skinframe.
R_Skinframe_LoadExternal now uses comparecrc = -1 to allow the shader loading to find the skinframe for an ft2 font.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12405
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 29 Apr 2018 09:34:22 +0000 (09:34 +0000)]
Default vid_desktopfullscreen to 1.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12404
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 29 Apr 2018 09:32:21 +0000 (09:32 +0000)]
Fix the menu for missing data, it needs to use CACHEPICFLAG_FAILONMISSING or the Draw_IsPicLoaded call will never fail.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12403
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 29 Apr 2018 09:23:09 +0000 (09:23 +0000)]
Fix Image_GenerateNoTexture, it was using a wrong stride, resulting in a very bogus image with the bottom half being black.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12402
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Fri, 20 Apr 2018 06:06:03 +0000 (06:06 +0000)]
Remove the last remnants of DPSOFTRAST support in vid_glx.c.
Remove some dead files.
Fix some warnings on CL_MeshEntities functions that should have been
static.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12401
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Fri, 20 Apr 2018 05:59:25 +0000 (05:59 +0000)]
Fix a prvm_int_t variable that was being passed directly to printf.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12400
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Fri, 20 Apr 2018 05:36:20 +0000 (05:36 +0000)]
Remove all render paths except GL20/GLES2. This means no DPSOFTRAST, no DX9 support, no GL1.1/GL1.3 support.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12399
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 15 Apr 2018 23:23:11 +0000 (23:23 +0000)]
Reworked v_isometric code significantly, it now defaults to a proper isometric view and some maps are actually playable like this.
Added R_Viewport_InitOrtho3D which more correctly implements the VF_PERSPECTIVE=0 case for CSQC, with correct camera orientation and all that. This may break existing mods that tried to use that feature but I doubt there are any as it was pretty broken before.
Reworked how R_CanSeeBox (and other vis code) determine if the view is able to use vieworigin based culling or not, this is now a separate property (r_refdef.view.usevieworiginculling) and can be turned on or off for reflection views and such. This is also exposed as v_isometric_usevieworiginculling for the v_isometric case.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12398
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 15 Apr 2018 23:17:19 +0000 (23:17 +0000)]
Changed how polygonbegin guesses if the geometry is 2D or 3D, it now uses a separate variable rather than relying on r_refdef.draw2dstage.
Reworked DrawQ_* and R_RenderView code to make clear distinctions between 2D and 3D code, this removes a lot of unnecessary calls to DrawQ_FlushUI (including ones that happened in R_RenderView).
Added R_DebugLine which takes a line in world coordinates and adds it as a 2D line in CL_Mesh_UI.
Added r_showparticleedges and r_showspriteedges debugging cvars which make use of R_DebugLine.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12397
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sat, 14 Apr 2018 06:54:35 +0000 (06:54 +0000)]
Added v_isometric cvars, this mode is mostly a curiosity but it's useful for testing engine compatibility with non-perspective rendering.
Fixed a few bugs where distance culling was misbehaving with non-perspective rendering.
Make r_refdef.view.ismain more useful - it's now cleared after R_RenderView rather than before, so R_RenderView can make use of it (for r_motionblur ghost texture updates and anything else that wants to happen just on the main view).
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12396
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sat, 14 Apr 2018 05:20:44 +0000 (05:20 +0000)]
Added r_cullentities_trace_expand and pad cvars, these configure additional ways to expand entity boxes when culling by traceline.
Added r_vis_trace feature which allows you to turn on traceline-based culling of portals, and r_vis_trace_surfaces lets you cull surfaces by traceline (slow and probably pointless, but a curious feature).
Added r_shadow_culllights_trace_expand and pad cvars.
Added sv_cullentities_trace_expand to make SV_CanSeeBox be at feature parity with R_CanSeeBox.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12395
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sat, 14 Apr 2018 05:11:44 +0000 (05:11 +0000)]
Fix two pieces of code that did not compile with PRVM_64.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12394
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sat, 14 Apr 2018 04:34:54 +0000 (04:34 +0000)]
Enable PRVM_64 - the QuakeC VM will run as 64bit (using int64/double rather than int/float).
This means that levels can run for > 10 hours without time precision issues, and float flags values can have flags ranging up to 54 bits rather than 24 bits.
There may be bugs, and physics is still using 32bit floats in a bunch of places so this does not enable huge worlds currently.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12393
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sat, 14 Apr 2018 04:26:28 +0000 (04:26 +0000)]
Check r_showtris cvar as a float rather than integer - can now use fractional brightness.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12392
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Fri, 13 Apr 2018 05:31:46 +0000 (05:31 +0000)]
Fix incorrect layer color values that caused models to be completely black in RENDERPATH_GL1*.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12391
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Fri, 13 Apr 2018 05:20:44 +0000 (05:20 +0000)]
Made RENDERPATH_GL20 require fbo support and always use it.
Implemented R_RenderTarget system for managing fbo and texture requests dynamically, reusing the same ones across frames - this means that the textures are now allocated much smaller and there is better handling of multiple CSQC viewports.
In the short-term this means that vid_samples antialiasing doesn't do anything, it will need to be reimplemented using fbo.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12390
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Fri, 13 Apr 2018 05:00:22 +0000 (05:00 +0000)]
Fix some viewport issues with r_viewfbo and r_bloom by passing view size information when calling the various rendering subsystems - there are still a bunch of bugs but this is a temporary measure before rendertargets are put in.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12389
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Fri, 13 Apr 2018 02:23:34 +0000 (02:23 +0000)]
CSQC polygonbegin functionality now uses the CL_MeshEntities system, this finally makes it possible to use shaders on those polygons.
UI elements (DrawQ_ system) now use the CL_MeshEntities system, but still renders the mesh the old way, shader support is planned.
DrawQ_Line no longer uses GL_LINES, it now produces a polygon in the CL_MeshEntities system, so shownetgraph and r_speeds_graph features now work on D3D9/DPSOFTRAST/GLES2 render paths.
Added MATERIALFLAG_VERTEXCOLOR as a special case for rgbgen vertex shaders that are being used by CL_MeshEntities meshes, currently this is an unlit type of material but lighting support for it is planned.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12388
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Thu, 12 Apr 2018 22:08:34 +0000 (22:08 +0000)]
Default scr_loadingscreen_background to 1, and also a fix for sRGB issues with the loadingscreen background.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12387
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Thu, 12 Apr 2018 21:44:41 +0000 (21:44 +0000)]
Fix a bug where R_GetTexture could return 0 rather than a white texture.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12386
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Wed, 11 Apr 2018 05:28:24 +0000 (05:28 +0000)]
Added Draw_GetPicWidth, Draw_GetPicHeight, Draw_IsPicLoaded functions and moved cachepic_t to live in gl_draw.c (no longer visible to other modules).
Changed Draw_CachePic to use the R_SkinFrame_LoadExternal system, and reworked font loading to use Draw_CachePic rather than keeping track of textures itself. R_SkinFrame_LoadExternal can now load gfx.wad lumps and gfx/*.lmp files, and the embedded images have been moved to image.c as they are now returned as raw images, suitable for R_SkinFrame_LoadExternal to use.
Reworked cl_video code to not need the cl_dyntexture system (which has been removed); it still uses dynamic texture callbacks (which is a feature of rtexture_t).
Changed the parameters to Mod_LoadCustomMaterial and a few other model_shared.c functions to not assume loadmodel is the owner of memory and textures; this was necessary for Draw_CachePic to be able to use R_SkinFrame_LoadExternal.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12385
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Tue, 10 Apr 2018 06:59:02 +0000 (06:59 +0000)]
Remove the model parameter from NativeContentsFromSuperContents/SuperContentsFromNativeContents functions, none of the current formats need it.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12384
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Tue, 10 Apr 2018 05:11:30 +0000 (05:11 +0000)]
Enable GL_OES_framebuffer_object on Android - it was broken in Android 2.1 but that's been irrelevant for years.
Remove prototype for R_Init, it doesn't exist.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12383
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Tue, 10 Apr 2018 05:10:08 +0000 (05:10 +0000)]
Don't bother setting anisotropy on textures twice during startup.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12382
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Tue, 10 Apr 2018 05:09:08 +0000 (05:09 +0000)]
Remove v_glslgamma cvar (now assumed to be 1) and corresponding code like R_DrawGamma.
RENDERPATH_GL1* paths no longer support bloom.
Fix a bug in D3D9 renderpath where SHADERPERMUTATION_GAMMARAMPS would crash due to using the wrong variable for the texture unit.
Enable GL_ARB_texture_non_power_of_two on OSX again - the old OSX versions and corresponding hardware that had issues are long gone.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12381
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Mon, 9 Apr 2018 05:58:15 +0000 (05:58 +0000)]
Improved r_sky_scissor - scissor box is tighter as it now computes scissor box for each surface and combines them.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12380
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Mon, 9 Apr 2018 05:29:12 +0000 (05:29 +0000)]
Implemented r_sky_scissor feature (on by default) - this limits rendering of sky to approximately the area of the surfaces.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12379
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Mon, 9 Apr 2018 05:01:24 +0000 (05:01 +0000)]
Added R_SkinFrame_PurgeSkinFrame to de-duplicate some repeated code.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12378
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Mon, 9 Apr 2018 04:40:24 +0000 (04:40 +0000)]
Add prvm_offsets.h to VS2017 projects, so it can be searched easily.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12377
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Mon, 9 Apr 2018 04:39:19 +0000 (04:39 +0000)]
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.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12376
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Mon, 9 Apr 2018 02:52:08 +0000 (02:52 +0000)]
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).
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12375
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Mon, 9 Apr 2018 02:39:42 +0000 (02:39 +0000)]
Increase shadowmap bordersize from 4 to 5, thanks Vic for debugging this
- the shadowmap filters need one more pixel than originally thought.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12374
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 8 Apr 2018 23:59:22 +0000 (23:59 +0000)]
Fix a bug with height fog which was revealed by removing
RSurf_ActiveWorldEntity.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12373
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sat, 7 Apr 2018 20:46:54 +0000 (20:46 +0000)]
Missed the cl_particles.c edits to remove RSurf_ActiveWorldEntity. I blame VS2017, just because.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12372
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sat, 7 Apr 2018 19:27:07 +0000 (19:27 +0000)]
Uncomment the texture binding check in R_Mesh_TexBind so that the engine makes less calls.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12371
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sat, 7 Apr 2018 19:25:34 +0000 (19:25 +0000)]
Delete unused Debug_PolygonBegin and associated code.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12370
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sat, 7 Apr 2018 19:25:02 +0000 (19:25 +0000)]
Fix a mistake made when merging R_RenderView call in #12367.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12369
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sat, 7 Apr 2018 19:20:05 +0000 (19:20 +0000)]
Configure all of the CL_MeshEntities* meshes the same, the material flags decide whether each thing should cast a shadow.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12368
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sat, 7 Apr 2018 19:18:49 +0000 (19:18 +0000)]
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.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12367
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sat, 7 Apr 2018 19:14:39 +0000 (19:14 +0000)]
Don't duplicate the entity relinking when using CSQC.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12366
d7cf8633-e32d-0410-b094-
e92efae38249
divverent [Thu, 5 Apr 2018 20:43:05 +0000 (20:43 +0000)]
Mark r_fakelight and r_equalize_entities_fullbright DEPRECATED.
Users of these features should migrate to r_fullbright_directed 1, which
is simpler but achieves a similar effect.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12365
d7cf8633-e32d-0410-b094-
e92efae38249
divverent [Thu, 5 Apr 2018 20:43:02 +0000 (20:43 +0000)]
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).
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12364
d7cf8633-e32d-0410-b094-
e92efae38249
divverent [Thu, 5 Apr 2018 20:42:33 +0000 (20:42 +0000)]
Add an in_releaseall command for debugging/working around stuck keys.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12363
d7cf8633-e32d-0410-b094-
e92efae38249
divverent [Thu, 5 Apr 2018 20:42:29 +0000 (20:42 +0000)]
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.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12362
d7cf8633-e32d-0410-b094-
e92efae38249
divverent [Thu, 5 Apr 2018 00:32:02 +0000 (00:32 +0000)]
Fix "Cully McCullface" bug found by terencehill.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12361
d7cf8633-e32d-0410-b094-
e92efae38249
divverent [Thu, 5 Apr 2018 00:31:59 +0000 (00:31 +0000)]
Fix compile of vid_glx.c after the update on hwgamma.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12360
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Tue, 3 Apr 2018 05:33:43 +0000 (05:33 +0000)]
Remove v_hwgamma feature as it is not worth maintaining and has severe restrictions on Windows that are unintuitive.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12359
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Tue, 3 Apr 2018 05:14:29 +0000 (05:14 +0000)]
Fix mouse spinning bug in wgl client when the game window is moved left or above the default monitor (negative window position).
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12358
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 25 Mar 2018 21:29:52 +0000 (21:29 +0000)]
Change shader permutation flags to 64bit.
Added dpuint64 and dpint64 types.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12357
d7cf8633-e32d-0410-b094-
e92efae38249
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.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12356
d7cf8633-e32d-0410-b094-
e92efae38249
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.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12355
d7cf8633-e32d-0410-b094-
e92efae38249
havoc [Sun, 25 Mar 2018 19:51:29 +0000 (19:51 +0000)]
Various cleanup.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12354
d7cf8633-e32d-0410-b094-
e92efae38249