Commit Graph

3515 Commits

Author SHA1 Message Date
Zack Middleton 00d60d05c4 OpenGL2: Increase flare limit to match opengl1 2024-08-29 16:42:51 -04:00
Zack Middleton a1fe522d3d Show fs_homepath in Flatpak missing pk3 error
Tell users to copy pk3 files to fs_homepath as fs_basepath is not user
writable.
2024-08-28 21:56:38 -04:00
Zack Middleton 118a533cbf Use XDG_DATA_HOME for Flatpak
Use XDG_DATA_HOME for Flatpak so that fs_homepath is accessible without
special permissions/handling. This changes the home path for Flatpak
from ~/.q3a/ to ~/.var/app/org.ioquake3.ioquake3/data/q3a/.
2024-08-28 21:56:38 -04:00
Zack Middleton 7112bfb77f Make copy to clipboard in Windows error dialog include error message
There is a copy to clipboard option but the error itself wasn't printed
to the console so it wasn't copied to the clipboard.

Unix-like platforms print it to the console so it's written in
crashlog.txt.
2024-08-28 17:52:54 -04:00
Zack Middleton e42db5b2b0 Make Team Arena pk3 error show when missing all pk3 files
The error was only displayed for Team Arena if one of the Team Arena pk3s
were found. Fix it to be display when trying to run Team Arena even with
no Team Arena pk3s present.
2024-08-28 17:52:54 -04:00
Zack Middleton 814e1755f5 Add better directions/error for missing default pk3 files 2024-08-28 17:52:54 -04:00
Zack Middleton a575c1c710 OpenGL2: Fix still projecting sun shadows onto nothing
Increase the range for clamping the screen shadow depth to 1.0 (nothing
drawn). Old epsilon ~0.00000006, new 0.001. This fixes it on another
computer.
2024-08-28 16:52:20 -04:00
Zack Middleton 4c19ff2b55 OpenGL2: Don't project sun shadows onto nothing
Don't project sun shadows (r_forceSun 1) on to view depth equal to 1.0
(nothing drawn or skybox). This caused a full second shadow of the
entire level in tr.screenShadowImage. It would move as the camera far
plane changed and rotate/stretch strangely as the camera view changed.

It was visible in-game on lightmapped transparent surfaces facing the
skybox and happen to overlap the extra shadow of the level.

This affected the glass in wop_padship's underwater room.
2024-07-27 02:30:32 -04:00
Zack Middleton 15f5fe78ad Fix compiling without PATCH_STITCHING defined 2024-07-13 23:53:48 -04:00
James Darpinian e505e34d79
Fix framerate throttling in Emscripten builds
Default com_maxfps to 0 under Emscripten. Under Emscripten the browser
handles throttling the frame rate. Manual framerate throttling interacts
poorly with Emscripten's browser-driven event loop.
2024-06-25 02:52:11 -04:00
Zack Middleton 99be1151f7 Fix web client vid_restart with r_mode -2
If getting the display index of the existing window fails, fallback to
the default display size instead of falling back to 640x480.

emscripten r_mode -2 worked on window creation but vid_restart fellback
to 640x480.
2024-06-24 22:38:48 -04:00
Zack Middleton c1ab47a764 Rename client-config.json based on CLIENTBIN
Also make viewing client.html directly use client-config.json in the
same directory so it's possible to "live edit" both the files without
having to run make.
2024-06-11 04:40:08 -04:00
Zack Middleton 7bfd5c90b8 Add support for mods to web client
ioquake3.html?fs_game=missionpack will run Team Arena when not using
--preload-file.
2024-06-11 04:40:08 -04:00
Zack Middleton 2660bb4a03 Add support for overriding basegame to web client
List files for multiple games in a single client-config.json file so
that com_basegame argument can pick different game data.

Use ioquake3.html?com_basegame=demoq3 (or tademo) to run the Quake 3 or
Team Arena demo. They require new QVMs from baseq3/missionpack to run.
2024-06-11 04:40:08 -04:00
Zack Middleton 8365ea7ed2 Customize the web client HTML file
Modify the client HTML file when copying it to the build directory to
apply current CLIENTBIN and BASEGAME. It always loads engine/data from
the current directory (no need to try to locate the build directory).
2024-06-11 04:40:08 -04:00
Zack Middleton e6c0776d98 Allow web client to use unzipped QVMs
Compile the QVMs and automatically uses them when not using --preload-file.
2024-06-11 04:40:08 -04:00
Zack Middleton 41ec9ae05f Make emscripten --preload-file opt-in 2024-06-11 04:40:08 -04:00
Zack Middleton ab8f7eb0bd Clean up emscripten in Makefile
- Remove emscripten build steps from Makefile (see readme)
- USE_CURL=0 has no effect
- HAVE_VM_COMPILED=false has no effect
- WebGL 1 and 2 are supported by the OpenGL2 renderer
- FULL_ES2 (client-side arrays) isn't needed
- Rename EMSCRIPTENOBJ to GENERATEDTARGETS and separate it from
  TARGETS so it's more readable.
2024-06-11 04:40:08 -04:00
Zack Middleton b14c5a3d9c Add BUILD_RENDERER_OPENGL1 to disable opengl1
Have emscripten disable BUILD_RENDERER_OPENGL1 instead of hardcoded to
disable opengl1 client.
2024-06-11 04:40:08 -04:00
Zack Middleton 198c92b9f8 Add DEPEND_MAKEFILE to disable rebuild on Makefile edit 2024-06-11 04:40:08 -04:00
James Darpinian e0ce0ceea0 Add Emscripten to README 2024-06-09 22:10:52 -04:00
James Darpinian 14a4278cdb Add GitHub Actions workflow for web/Emscripten 2024-06-09 22:10:52 -04:00
James Darpinian 1f9cbddf37 Speed up GitHub Actions with -j 2024-06-09 22:10:52 -04:00
James Darpinian f2169ed0b4 Support debug Emscripten build 2024-06-09 22:10:52 -04:00
James Darpinian 9348dbf643 Silence compiler warnings 2024-06-09 22:10:52 -04:00
James Darpinian 6fe061c36e Fix build when specifying PLATFORM=emscripten manually instead of using emmake 2024-06-09 22:10:52 -04:00
James Darpinian 2765cd5398 Get rid of "Nothing to be done for _.zip" message 2024-06-09 22:10:52 -04:00
James Darpinian db24dfe13f ioquake3.html replaces Emscripten-generated HTML shell
This enables several things:
* Optionally load pk3 files from a web server at runtime instead of bundling them with Emscripten at build time
* Set command line arguments via URL param
* It's not ugly
2024-06-09 22:10:52 -04:00
James Darpinian e247b316a7 Rebuild every target if Makefile changes 2024-06-09 22:10:52 -04:00
James Darpinian 37d78b6279 Add .vscode and baseq3 to gitignore 2024-06-09 22:10:52 -04:00
Zack Middleton 413be19a8d Add -ffast-math for emscripten to match other platforms
Co-authored-by: James Darpinian <jdarpinian@gmail.com>
2024-06-09 22:10:52 -04:00
Zack Middleton 25a680ab6e Allow building for emscripten with "emmake make"
Co-authored-by: James Darpinian <jdarpinian@gmail.com>
2024-06-09 22:10:52 -04:00
Zack Middleton 17cadb5369 Fix using emscripten 3.1.27+
emscripten 3.1.27 reduced the stack size from 5MB to 64KB. This caused
run-time errors: Uncaught RuntimeError: index out of bounds

Co-authored-by: James Darpinian <jdarpinian@gmail.com>
2024-06-09 22:10:52 -04:00
Zack Middleton 6f5c038947 Use BASEGAME for emscripten assets 2024-06-08 23:28:09 -04:00
Zack Middleton 4fc059b940 Fix emscripten build directions 2024-06-07 19:11:40 -04:00
Zack Middleton f41bd37fde Add minimal emscripten support 2024-06-06 20:51:44 -04:00
Zack Middleton f869bffe97 OpenGL2: Fallback to OpenGL ES if OpenGL fails 2024-06-06 19:49:17 -04:00
Zack Middleton 551fa6c797 OpenGL2: Fix issues running under WebGL 2024-06-06 19:49:17 -04:00
Jack Slater 980147721a
Merge pull request #664 from zturtleman/opengles2 2024-06-05 17:33:16 -10:00
Zack Middleton 98b9008c0d OpenGL2: Use CPU vertex animation if too few vertex attributes
OpenGL ES has a minimum of 8 vertex attributes while desktop OpenGL has
a minimum of 16. Vertex animation uses attributes 10 to 12.
2024-06-05 21:36:48 -05:00
Zack Middleton b25a3c6e4d OpenGL2: Add run-time support for unsigned short indexes
OpenGL ES 2 is only required to support unsigned short for indexes.
2024-06-05 21:36:05 -05:00
Zack Middleton 3b984d2b51 OpenGL2: Add OpenGL ES 2.0+ support
This mainly targets OpenGL ES 2.0 but it also supports compiling GLSL as
ESSL 3.00. It's missing support for framebuffer objects which should be
possible on ES 2. (Though using renderbuffers instead of textures.)

opengl1 cvars that are not supported will display a message and disable
the cvar. This has not been reviewed for new opengl2 cvars. Enabling
cvars may cause rendering issues. Some of the broken cvars may be
possible to support using OpenGL ES 3 features.

The game displays okay with the default cvars.
2024-06-05 21:33:08 -05:00
Zack Middleton 1fc83e4845 Update macOS version for GitHub CI
macOS 11 runner image is scheduled to be removed next month.
2024-05-20 15:16:04 -04:00
rilysh 735d987303 Makefile: fix compilation on FreeBSD 2024-05-18 12:48:44 +01:00
Alan Zhao aecf3f55ce
Use nanosleep(2) instead of usleep(3)
usleep(3) was declared obsolete in POSIX.1-2001 and removed in
POSIX.1-2008 and nanosleep(2) was recommended to be used instead.
2024-05-15 18:14:52 -04:00
Jack Slater 60dfabbeb7
Update SECURITY.md 2024-04-18 08:45:56 -10:00
Zack Middleton 5a918bfa96 opengl1: Fix skybox in OpenGL 1.1
Fix six image skybox having a black border around the sides of the sky
when using OpenGL 1.1 (using CL_CLAMP instead of GL_CLAMP_TO_EDGE).

It's technically visible in q3dm10 but it's more obvious in Team Arena
maps such as mpteam6.
2024-04-18 00:04:33 -04:00
Zack Middleton f9547e4533 OpenGL2: Don't mix drawing to default framebuffer and FBO
Don't draw the world scene to a separate FBO from the rest of the
screen.

This fixes the world scene having HOM instead of seeing through to the
previously drawn content. World of Padman uses this to have a separate
3D scene for the sky and world in wop_padship for dynamic skybox.

This also makes r_ext_framebuffer_multisample apply to HUD models
instead of depending on r_ext_multisample (which doesn't work on Linux
with some Intel graphics).
2024-03-02 06:09:59 -05:00
Zack Middleton 2cd1a7ef4a Fix GitHub Actions CI deprecation warnings 2024-02-26 13:28:57 -05:00
Zack Middleton 7d711f8121 Fix running on Windows XP
Newer mingw-w64 changed default Windows version compatibility.
Need to specify older behavior for EnumProcesses() to avoid "missing
K32EnumProcesses()" runtime error.
2024-02-17 17:01:44 -05:00