GithubHelp home page GithubHelp logo

nvidia / q2rtx Goto Github PK

View Code? Open in Web Editor NEW
1.2K 40.0 179.0 9.92 MB

NVIDIA’s implementation of RTX ray-tracing in Quake II

License: Other

CMake 0.49% C 97.74% Batchfile 0.02% Shell 0.05% NSIS 0.15% GLSL 1.38% Python 0.17%

q2rtx's Introduction

Quake II RTX

Build Status

Quake II RTX is NVIDIA's attempt at implementing a fully functional version of Id Software's 1997 hit game Quake II with RTX path-traced global illumination.

Quake II RTX builds upon the Q2VKPT branch of the Quake II open source engine. Q2VKPT was created by former NVIDIA intern Christoph Schied, a Ph.D. student at the Karlsruhe Institute of Technology in Germany.

Q2VKPT, in turn, builds upon Q2PRO, which is a modernized version of the Quake II engine. Consequently, many of the settings and console variables that work for Q2PRO also work for Quake II RTX.

License

Quake II RTX is licensed under the terms of the GPL v.2 (GNU General Public License). You can find the entire license in the license.txt file.

The Quake II game data files remain copyrighted and licensed under the original id Software terms, so you cannot redistribute the pak files from the original game.

Features

Quake II RTX introduces the following features:

  • Caustics approximation and coloring of light that passes through tinted glass
  • Cutting-edge denoising technology
  • Cylindrical projection mode
  • Dynamic lighting for items such as blinking lights, signs, switches, elevators and moving objects
  • Dynamic real-time "time of day" lighting
  • Flare gun and other high-detail weapons
  • High-quality screenshot mode
  • Multi-GPU (SLI) support
  • Multiplayer modes (deathmatch and cooperative)
  • Optional two-bounce indirect illumination
  • Particles, laser beams, and new explosion sprites
  • Physically based materials, including roughness, metallic, emissive, and normal maps
  • Player avatar (casting shadows, visible in reflections)
  • Recursive reflections and refractions on water and glass, mirror, and screen surfaces
  • Procedural environments (sky, mountains, clouds that react to lighting; also space)
  • Sunlight with direct and indirect illumination
  • Volumetric lighting (god-rays)

You can download functional builds of the game from GitHub Releases.

Latest development builds can be found in the Actions tab. To run a development build, download the artifact, extract it and put q2rtx_media.pkz, blue_noise.pkz and the pak*.pak files from the original game into baseq2/.

Additional Information

Also, some source files have comments that explain various parts of the renderer:

Support and Feedback

System Requirements

In order to build Quake II RTX you will need the following software installed on your computer (with at least the specified versions or more recent ones).

Operating System

Windows Linux
Min Version Win 7 x64 Ubuntu 16.04 x86_64 or aarch64

Note: only the Windows 10 version has been extensively tested.

Note: distributions that are binary compatible with Ubuntu 16.04 should work as well.

Note: Linux ppc64le is also known to work though not officially supported.

Software

Min Version
NVIDIA GPU driver
https://www.geforce.com/drivers
460.82
AMD GPU driver
https://www.amd.com/en/support
21.1.1
git
https://git-scm.com/downloads
2.15
CMake
https://cmake.org/download/
3.8
Vulkan SDK
https://www.lunarg.com/vulkan-sdk/
1.2.162

Submodules

Build Instructions

  1. Clone the repository and its submodules from git :

    git clone --recursive https://github.com/NVIDIA/Q2RTX.git

  2. Create a build folder named build under the repository root (Q2RTX/build)

    Note: this is required by the shader build rules.

  3. Copy (or create a symbolic link) to the game assets folder (Q2RTX/baseq2)

    Note: the asset packages are required for the engine to run. Specifically, the blue_noise.pkz and q2rtx_media.pkz files or their extracted contents. The package files can be found in the GitHub releases or in the published builds of Quake II RTX.

  4. Configure CMake with either the GUI or the command line and point the build at the build folder created in step 2.

    cd build
    cmake ..

    Note: only 64-bit builds are supported, so make sure to select a 64-bit generator during the initial configuration of CMake.

    Note 2: when CMake is configuring curl, it will print warnings like Found no *nroff program. These can be ignored.

  5. Build with Visual Studio on Windows, make on Linux, or the CMake command line:

    cmake --build .

Music Playback Support

Quake II RTX supports music playback from OGG files, if they can be located. To enable music playback, copy the CD tracks into a music folder either next to the executable, or inside the game directory, such as baseq2/music. The files should use one of these two naming schemes:

  • music/02.ogg for music copied directly from a game CD;
  • music/Track02.ogg for music from the version of Quake II downloaded from GOG.

In the game, music playback is enabled when console variable ogg_enable is set to 1. Music volume is controlled by console varaible ogg_volume. Playback controls, such as selecting the track or putting it on pause, are available through the ogg command.

Music playback support is using code adapted from the Yamagi Quake 2 engine.

Photo Mode

When a single player game or demo playback is paused, normally with the pause key, the photo mode activates. In this mode, denoisers and some other real-time rendering approximations are disabled, and the image is produced using accumulation rendering instead. This means that the engine renders the same frame hundreds or thousands of times, with different noise patterns, and averages the results. Once the image is stable enough, you can save a screenshot.

In addition to rendering higher quality images, the photo mode has some unique features. One of them is the Depth of Field (DoF) effect, which simulates camera aperture and defocus blur, or bokeh. In contrast with DoF effects used in real-time renderers found in other games, this implementation computes "true" DoF, which works correctly through reflections and refractions, and has no edge artifacts. Unfortunately, it produces a lot of noise instead, so thousands of frames of accumulation are often needed to get a clean picture. To control DoF in the game, use the mouse wheel and Shift/Ctrl modifier keys: wheel alone adjusts the focal distance, Shift+Wheel adjusts the aperture size, and Ctrl makes the adjustments finer.

Another feature of the photo mode is free camera controls. Once the game is paused, you can move the camera and detach it from the character. To move the camera, use the regular W/A/S/D keys, plus Q/E to move up and down. Shift makes movement faster, and Ctrl makes it slower. To change orientation of the camera, move the mouse while holding the left mouse button. To zoom, move the mouse up or down while holding the right mouse button. Finally, to adjust camera roll, move the mouse left or right while holding both mouse buttons.

Settings for all these features can be found in the game menu. To adjust the settings from the console, see the pt_accumulation_rendering, pt_dof, pt_aperture, pt_freecam and some other similar console variables in the Client Manual.

Material System

The engine has a system for defining various properties for surface materials, such as textures, material kinds, flags, etc. Materials are defined in *.mat files in a custom text-based format. The engine will read all materials/*.mat files from the game directory (or directories when playing a non-base game) in alphabetic order, and materials in the later files override the materials in the earlier files. Then the engine also reads a <mapname>.mat file when loading a map, and the materials defined in the map-specific file override global materials - but only those used for map geometry, not models.

The .mat files consist of multiple material entries, where each entry can define multiple materials. For example:

textures/e1u2/wslt1_5,
textures/e1u2/wslt1_6:
    texture_base overrides/*.tga
    texture_normals overrides/*_n.tga
    texture_emissive overrides/*_light.tga
    is_light 1
    correct_albedo 1

The above example defines two materials that will be used for surfaces that reference .wal files with the same base names, and for each of these materials it defines three textures. The * symbol in the texture definition is replaced with the material base name, so either wslt1_5 or wslt1_6 in this example.

When a material is not defined for a surface, the engine will look for textures with matching names and various extensions. First, it will look in the overrides/ directory, then in the original texture path. Normal maps are searched with the _n suffix, and emissive maps are searched with the _light suffix. If no replacement files are found, just the original base texture will be used.

Materials can also use the automatic emissive texture generation feature. This is the case for undefined materials when the pt_enable_surface_lights console variable is nonzero: wall surfaces with the SURF_LIGHT flag (but not SURF_SKY or SURF_NODRAW) will generate an emissive texture from the base texture and a threshold value, if no emissive texture is found, and marked with the is_light material flag. The threshold value is set using the pt_surface_lights_threshold variable. For defined materials you can the synth_emissive and emissive_threshold material properties to explicitly enable emissive texture generation.

Materials can be examined and modified at run time, using the mat command. For example, mat print will print the properties of the currently targeted material to the console. To get more usage information, use mat help.

MIDI Controller Support

The Quake II console can be remote operated through a UDP connection, which allows users to control in-game effects from input peripherals such as MIDI controllers. This is useful for tuning various graphics parameters such as position of the sun, intensities of lights, material parameters, filter settings, etc.

You can find a compatible MIDI controller driver here

To enable remote access to your Quake II RTX client, you will need to set the following console variables before starting the game, i.e. in the config file or through the command line:

 rcon_password "<password>"
 backdoor "1"

Note: the password set here should match the password specified in the korgi configuration file.

Note 2: enabling the rcon backdoor allows other people to issue console commands to your game from other computers, so choose a good password.

Test Model

The engine includes support for placing a test model in any location. You can use any MD2, MD3 or IQM model. Follow these steps to use this feature:

  • To use the material sampling balls model, download the shader_balls.pkz package from the Releases page. Place or extract that package into your baseq2 folder.
  • Run the game with the cl_testmodel variable set to the path of the test model.
  • Use the puttest command to place the test model at the current player location.
  • Adjust the test model animation speed with the cl_testfps variable and its opacity with the cl_testalpha variable.

q2rtx's People

Contributors

a1batross avatar apanteleev avatar bjossialfreds avatar calinou avatar ckwarner avatar davevoyles avatar devnexen avatar hifi avatar illwieckz avatar ishitatsuyuki avatar jayschwa avatar joshua-ashton avatar kkartaltepe avatar kugelrund avatar liam-middlebrook avatar mjunix avatar mpyrzows avatar paril avatar perfectcolors avatar r-a-sattarov avatar randomdude4 avatar res2k avatar rumblehhh avatar runlevel5 avatar sherief avatar skullernet avatar sthalik avatar totallymehis avatar vash63 avatar yamagi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

q2rtx's Issues

White box / hangs on startup

Q2RTX 1.2.0 - tried both direct and steam versions. It doesnt "crash" it just says the program has stopped responding, and my options are to close or wait.

In the console.log, the last lines say:

[2019-11-29 23:13] Picked physical device 0: GeForce RTX 2080 SUPER
[2019-11-29 23:13] NVIDIA GPU detected. Driver version: 445.23
[2019-11-29 23:13] warning: could not load function vkDebugMarker

nothing after that. Never had an AMD graphics card in the system to have the wrong vulkan driver. Ran the AMD driver cleanup tool anyways, to no avail.

Manually installed vulkan runtime and OpenAL, that didn't help either.

Any other suggestions?

Light list sampling

The light proxies used in sample_light_list often aren't a great approximation of the corresponding lights. To demonstrate this, I have taken two reference mode screenshots using pt_bump_scale 0 and pt_roughness_override 0.02:

Reflections using the light list proxies (forced via pt_direct_roughness_threshold 0):
quake164

Reflections using the actual emissive maps (through indirect bounce specular):
quake165

The proxies are good enough for importance sampling, but it may make sense to sample the emissive texture to get the actual light color to return. Whether that's done or not, it would probably make sense to change the proxy sizes to better match the dimensions of the emissive portions of the corresponding lights (assuming this can be done without too much difficulty, I haven't looked much into the relevant code yet).

Direct light sampling

A couple of things with the direct light calculations in get_direct_illumination and get_sunlight in path_tracer_rgen.h:

  1. In both functions, the diffuse term is (correctly) multiplied by NdotL. However, since this is done before multiplication by the specular term, the latter ends up multiplied by that cosine as well, which I don't think is correct. I realized this after noticing that specular highlights on surfaces with roughness <= pt_direct_roughness_threshold - 0.02 were disproportionately brighter than those on surfaces with roughness >= pt_direct_roughness_threshold + 0.02. Changing the code so NdotL only affects diffuse but not specular corrects this inconsistency.

  2. I'm less sure about this, but shouldn't the diffuse (but not the specular of course) term in each function be divided by pi (lambertian scale factor)?

GGX importance sampling

Not a bug, but a suggestion. In my local fork I swapped the indirect specular importance sampling to the VNDF sampling method described in this paper: http://jcgt.org/published/0007/04/01/paper.pdf . This resulted in an immediately apparent improvement in the appearance of indirect specular at low sample counts. The code I used is this:

brdf.glsl:

float G1_Smith(float roughness, float NdotL)
{
    float alpha = square(max(roughness, 0.02));
    return 2.0 * NdotL / (NdotL + sqrt(square(alpha) + (1.0 - square(alpha)) * square(NdotL)));
}

vec3 ImportanceSampleGGXVNDF(vec2 u, float roughness, vec3 Ve)
{
    float alpha = square(roughness);
    vec3 Vh = normalize(vec3(alpha * Ve.x, alpha * Ve.y, Ve.z));
	
    float lensq = square(Vh.x) + square(Vh.y);
    vec3 T1 = lensq > 0.0 ? vec3(-Vh.y, Vh.x, 0.0) * inversesqrt(lensq) : vec3(1.0, 0.0, 0.0);
    vec3 T2 = cross(Vh, T1);

    float r = sqrt(u.x);
    float phi = 2.0 * M_PI * u.y;
    float t1 = r * cos(phi);
    float t2 = r * sin(phi);
    float s = 0.5 * (1.0 + Vh.z);
    t2 = (1.0 - s) * sqrt(1.0 - square(t1)) + s * t2;

    // Tangent space H
    vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - square(t1) - square(t2))) * Vh;

    return vec3(alpha * Nh.x, max(0.0, Nh.z), alpha * Nh.y);
}

indirect_lighting.rgen:

				mat3 basis = construct_ONB_frisvad(normal);

				vec3 N = normal;
				vec3 V = direction;
				vec3 H = normalize(basis * ImportanceSampleGGXVNDF(rng3, primary_roughness, -vec3(dot(V, basis[0]), dot(V, basis[2]), dot(V, basis[1]))));
				vec3 L = reflect(V, H);

		        float NoL = max(0.0, dot(N, L));
		        float NoV = max(0.0, -dot(N, V));

		        if (NoL > 0.0 && NoV > 0.0)
		        {
		            float G = G1_Smith(primary_roughness, NoL);

		            // Incident light = SampleColor * NoL
		            // Microfacet specular = D*G*F / (4*NoL*NoV)
		            // pdf = D * NoH / (4 * VoH)
		            bounce_throughput *= G;

					bounce_throughput *= 1.0 / specular_pdf;
					is_specular_ray = true;
					bounce_direction = L;
				}

(The added NoV > 0 condition is required - for a while I was getting subtly different results with this importance sampling in reference mode, until I eventually figured out that this was due to me having excluded this condition)

EDIT: Oh, I stopped using the Schlick approximation for the G term a while back, hence the form of my G1_Smith function. Obviously the formula used should be consistent with the one used in the G_Smith_over_NdotV function.

Support for additions

Will the following patches support the additions of Ground Zero and The Reckoning? And how to restore the video cut scenes that were in the original Quake 2? Weapon models were made poorly, especially blaster, super shotgun, chaingun, hyperblaster, railgun, bfg9000. They shine too much, as if oiled. And new weapon models are poorly made. Original weapon models were better. And what other corrections and additions are planned to be done in the near future for Quake 2 RTX?

Steam dependencies / redistributables setup?

It seems it hasn't been done?

I've noticed that for most people on the forums who claim the game doesn't boot, the core issue is absence of some Vulkan dependency that appears to not be included in driver or is only solved with a clean driver install. This causes crashes before the game does check on driver version to even inform them they need a newer one.

I'm not entirely sure since i'm not affected but perhaps including Vulkan SDK / runtime as part of initial Steam "first boot setup" would provide all of the missing bits?

Also while we're speaking about dependencies, from what i've noticed from console logs and random footage - fair amount of people run the game in software audio mode because they lack OpenAL or it fails to initialize, thankfully the client is smart enough to switch to software mode if it fails to initialize OpenAL, but nevertheless - ugh, it's software mode.
Including OpenAL installer as part of initial Steam setup would probably greatly help mitigate such cases (an even better option would be to ship the project with installer to make sure OpenAL gets all of its dependencies and provide precompiled binary of OpenAL Soft which unlike original OpenAL is still maintained and is overall just better).

Incorrect location on loading checkpoints

After dying, on levels with multiple separate maps, reloading the autosave often puts you in the wrong area. This can lead either to a game-breaking bug (not being able to get past a door you haven't unlocked yet) or to skipping big sections of the level.

I assumed this was a problem with Quake 2, not the nvidia version, but others think it is this version only that has this problem.

More info:
https://steamcommunity.com/app/1089130/discussions/0/1636410430549717402/

Nvidia Flow support and particle enhancements.

In one of the announcement articles for Quake 2 RTX it was said that there would be

optional NVIDIA Flow fire, smoke and particle effects

As far as I can tell, that hasn't made it into the release.

Those chunky 3D explosions and impact-smoke effects that Quake 2 uses could look a whole lot better if they used something like that instead. The same is true of the particle trails from the weapons.

The projectiles themselves for the blaster and hyperblaster could also be significantly better than the opaque rods they were initially implemented as in 1997.

NaN issue

The operation performed on primary_specular at line 545 of direct_lighting.rgen results in NaN in the rare case where NoV is 1 (normal == direction). Under most circumstances Q2RTX quickly recovers from this error, but when the reference path tracing mode is active the affected pixel turns black and remains black forever.

In my local fork I've fixed this by adding an if (NoV < 1) check.

Sound Problem

On the maps base3, jail1, jail2, jail3, jail5, lab the sounds of monsters disappear, doors open, gun shots, grenade explosions, etc. It is possible that other cards also have problems with sound. In Quake 2 RTX version 1.1.0 everything worked fine.

Sprite explosions & cutscenes

The game has sprite explosions. They look wrong when viewed from above. Is it possible to correct the display of these explosion sprites or improve them, as in Quake 2 XP ? Is it possible to use 3D HUD in future versions Quake 2 RTX, as in Quake 2 XP ?
quake000
quake2xp_2020_01_07_11_06_32_040
In version Quake 2 RTX 1.3.0 added support for cutscenes. But the initial logo clips do not appear, for example, the logo ID Software from the Idlog.cin file. Also, the initial logo clips from the additions "Ground Zero" and "The Reckoning" do not appear, although the addons are launched and cut scenes work in them.

Health gets reset on level change.

If you leave a level with greater than your normal maximum health - because you've picked up some of the single-unit health packs, for example - your health gets reset down to the maximum health (100 + n adrenalines) instead. This is obviously incorrect behaviour.

(Linux) Failed request: bad value

When I launch q2rtx, I get an error message:

]X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 154 (GLX)
Minor opcode of failed request: 3 (X_GLXCreateContext)
Value in failed request: 0x0
Serial number of failed request: 83
Current serial number in output stream: 84
AL lib: (EE) alc_cleanup: 1 device not closed

Specs:
Core i7
GTX 1050 (with nvidia-418)
Ubuntu 1804

Exposure compensation affecting particle effects/sprites

I will start by saying that I'm no programmer so bear with me if I sound like a noob, I am.
I've noticed that the exposure compensation is incorrectly affecting the particle sprites (?), an effect that is especially noticeable with big sprites such as those of the BFG or explosions which become washed out instead of actually dimming in the more exposed areas.
I suppose this is due to the images having a low dynamic range and the highlights being overexposed in the first place, so when the exposure goes down the highlights simply become grey instead of getting smaller as it would happen in reality.

I imagine it would be hard/impractical to use HDR images for those sprites but I wonder if they can be excluded from the exposure compensation. Here is an image showing what I see and what I would expect: https://imgur.com/a/0ab24wE (2nd and 3rd image, please ignore the colored blobs, it's an experimental fork but the issue is the same in the original).

pt_fake_roughness_threshold

pt_fake_roughness_threshold = 1 is the 'reference' value used, and the value at which the fake specular is no longer computed in asvgf_atrous.comp. However, fake_specular_weight = smoothstep(1 - 0.05, 1 + 0.05, roughness) will still be nonzero for roughness > 0.95. In my local fork I've fixed this by replacing the two instances of this computation (one in indirect_lighting.rgen, one in asvgf_atrous.comp) with

			float fake_specular_weight = smoothstep(
				global_ubo.pt_fake_roughness_threshold,
				global_ubo.pt_fake_roughness_threshold + 0.1,
				roughness);

Removing dead and insane soldiers with nomonsters 1

On line 622 of src/baseq2/g_spawn.c, replacing

if (nomonsters->value && strstr(ent->classname, "monster")) {

with

if (nomonsters->value && (strstr(ent->classname, "monster") || strstr(ent->classname, "misc_deadsoldier") || strstr(ent->classname, "misc_insane"))) {

means that the corpses and insane soldiers are removed, along with the enemies, when using nomonsters 1.

I needed to do this with my own copy, and thought that it might be useful for someone else wanting to achieve the same thing.

AI enhanced textures

IDK why Nvidia didn't use their AI tech to enhance the textures
Or at least some third party tools such as ESRGAN

compiling issue

in Ubuntu 19.10 with cmake I got the following compiling error:

[ 84%] Building C object src/CMakeFiles/client.dir/refresh/vkpt/bsp_mesh.c.o /home/biel/games/src/Q2RTX/src/refresh/vkpt/bsp_mesh.c:28:10: fatal error: tinyobj_loader_c.h: El fitxer o directori no existeix 28 | #include <tinyobj_loader_c.h> | ^~~~~~~~~~~~~~~~~~~~ compilation terminated. make[2]: *** [src/CMakeFiles/client.dir/build.make:2209: src/CMakeFiles/client.dir/refresh/vkpt/bsp_mesh.c.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:643: src/CMakeFiles/client.dir/all] Error 2 make: *** [Makefile:130: all] Error 2

Can you use vkUpdateDescriptorSetWithTemplate for filling acceleration structure in the descriptor set?

We are using vkUpdateDescriptorSetWithTemplate for all our descriptor updates. I was wondering if it is possible to use it for acceleration structures.
When I tried, it was crashing. I was passing the VkAccelerationStructureNV pointer as the pData.

VkAccelerationStructureNV acceleration_structure = m_AccelerationStructure->m_Handle;
vkUpdateDescriptorSetWithTemplate(...., acceleration_structure); // Crash

void* handle = NULL;
vkGetAccelerationStructureHandleNV(vk_device, acceleration_structure, sizeof(acceleration_structure), &handle);
vkUpdateDescriptorSetWithTemplate(...., handle); // Also Crashes

buffer_map : assertion failed

in Ubuntu 19.10 after compiling the game and attempting to play it i got the following error:

Q2RTX/src/refresh/vkpt/vk_util.c:152: buffer_map: Assertion `buf->memory != VK_NULL_HANDLE' failed.

$ ./q2rtx
------- FS_Init -------
Current search path:
/home/biel/.quake2rtx/baseq2
/mnt/0ce2dc47-e5f3-4d52-b2a4-7f505d5ea2c5/SteamLibrary/steamapps/common/Quake II RTX/baseq2
/mnt/0ce2dc47-e5f3-4d52-b2a4-7f505d5ea2c5/SteamLibrary/steamapps/common/Quake II RTX/baseq2/shaders.pkz (39 files)
/mnt/0ce2dc47-e5f3-4d52-b2a4-7f505d5ea2c5/SteamLibrary/steamapps/common/Quake II RTX/baseq2/q2rtx_media.pkz (4044 files)
/mnt/0ce2dc47-e5f3-4d52-b2a4-7f505d5ea2c5/SteamLibrary/steamapps/common/Quake II RTX/baseq2/blue_noise.pkz (258 files)
/mnt/0ce2dc47-e5f3-4d52-b2a4-7f505d5ea2c5/SteamLibrary/steamapps/common/Quake II RTX/baseq2/pak0.pak (1106 files)
1106 files in PAK files
4341 files in PKZ files
-----------------------
Logging console to logs/console.log
Execing default.cfg
Execing q2rtx.cfg
------- S_Init -------
OpenAL initialized.
No Ogg Vorbis music tracks have been found, so there will be no music.
----------------------
mode changed 1920 1080
Loaded 'materials.csv' (fast search = true)
----- init_vulkan -----
Available Vulkan layers: 
  VK_LAYER_VALVE_steam_overlay_64
  VK_LAYER_VALVE_steam_fossilize_32
  VK_LAYER_VALVE_steam_fossilize_64
  VK_LAYER_VALVE_steam_overlay_32
  VK_LAYER_KHRONOS_validation
  VK_LAYER_LUNARG_monitor
  VK_LAYER_MESA_overlay
  VK_LAYER_LUNARG_device_simulation
  VK_LAYER_LUNARG_screenshot
  VK_LAYER_LUNARG_vktrace
  VK_LAYER_LUNARG_api_dump
  VK_LAYER_LUNARG_standard_validation
Vulkan instance extensions required by SDL2: 
  VK_KHR_surface
  VK_KHR_xlib_surface
Supported Vulkan instance extensions: 
  VK_KHR_device_group_creation (requested)
  VK_KHR_display
  VK_KHR_external_fence_capabilities
  VK_KHR_external_memory_capabilities
  VK_KHR_external_semaphore_capabilities
  VK_KHR_get_display_properties2
  VK_KHR_get_physical_device_properties2
  VK_KHR_get_surface_capabilities2
  VK_KHR_surface (requested)
  VK_KHR_surface_protected_capabilities
  VK_KHR_wayland_surface
  VK_KHR_xcb_surface
  VK_KHR_xlib_surface (requested)
  VK_EXT_acquire_xlib_display
  VK_EXT_debug_report (requested)
  VK_EXT_direct_mode_display
  VK_EXT_display_surface_counter
  VK_EXT_debug_utils (requested)
Physical device 0: GeForce RTX 2060 SUPER
Max number of allocations: -1
Supported Vulkan device extensions:
  VK_KHR_8bit_storage
  VK_KHR_16bit_storage
  VK_KHR_bind_memory2
  VK_KHR_create_renderpass2
  VK_KHR_dedicated_allocation
  VK_KHR_depth_stencil_resolve
  VK_KHR_descriptor_update_template
  VK_KHR_device_group
  VK_KHR_draw_indirect_count
  VK_KHR_driver_properties
  VK_KHR_external_fence
  VK_KHR_external_fence_fd
  VK_KHR_external_memory
  VK_KHR_external_memory_fd
  VK_KHR_external_semaphore
  VK_KHR_external_semaphore_fd
  VK_KHR_get_memory_requirements2
  VK_KHR_image_format_list
  VK_KHR_imageless_framebuffer
  VK_KHR_maintenance1
  VK_KHR_maintenance2
  VK_KHR_maintenance3
  VK_KHR_multiview
  VK_KHR_pipeline_executable_properties
  VK_KHR_push_descriptor
  VK_KHR_relaxed_block_layout
  VK_KHR_sampler_mirror_clamp_to_edge
  VK_KHR_sampler_ycbcr_conversion
  VK_KHR_shader_atomic_int64
  VK_KHR_shader_draw_parameters
  VK_KHR_shader_float16_int8
  VK_KHR_shader_float_controls
  VK_KHR_storage_buffer_storage_class
  VK_KHR_swapchain
  VK_KHR_swapchain_mutable_format
  VK_KHR_timeline_semaphore
  VK_KHR_uniform_buffer_standard_layout
  VK_KHR_variable_pointers
  VK_KHR_vulkan_memory_model
  VK_EXT_blend_operation_advanced
  VK_EXT_buffer_device_address
  VK_EXT_calibrated_timestamps
  VK_EXT_conditional_rendering
  VK_EXT_conservative_rasterization
  VK_EXT_depth_clip_enable
  VK_EXT_depth_range_unrestricted
  VK_EXT_descriptor_indexing
  VK_EXT_discard_rectangles
  VK_EXT_display_control
  VK_EXT_fragment_shader_interlock
  VK_EXT_global_priority
  VK_EXT_host_query_reset
  VK_EXT_index_type_uint8
  VK_EXT_inline_uniform_block
  VK_EXT_line_rasterization
  VK_EXT_memory_budget
  VK_EXT_pci_bus_info
  VK_EXT_pipeline_creation_feedback
  VK_EXT_post_depth_coverage
  VK_EXT_sample_locations
  VK_EXT_sampler_filter_minmax
  VK_EXT_scalar_block_layout
  VK_EXT_separate_stencil_usage
  VK_EXT_shader_demote_to_helper_invocation
  VK_EXT_shader_subgroup_ballot
  VK_EXT_shader_subgroup_vote
  VK_EXT_shader_viewport_index_layer
  VK_EXT_subgroup_size_control
  VK_EXT_texel_buffer_alignment
  VK_EXT_transform_feedback
  VK_EXT_vertex_attribute_divisor
  VK_EXT_ycbcr_image_arrays
  VK_NV_clip_space_w_scaling
  VK_NV_compute_shader_derivatives
  VK_NV_cooperative_matrix
  VK_NV_corner_sampled_image
  VK_NV_dedicated_allocation
  VK_NV_dedicated_allocation_image_aliasing
  VK_NV_device_diagnostic_checkpoints
  VK_NV_fill_rectangle
  VK_NV_fragment_coverage_to_color
  VK_NV_fragment_shader_barycentric
  VK_NV_framebuffer_mixed_samples
  VK_NV_coverage_reduction_mode
  VK_NV_geometry_shader_passthrough
  VK_NV_mesh_shader
  VK_NV_sample_mask_override_coverage
  VK_NV_representative_fragment_test
  VK_NV_scissor_exclusive
  VK_NV_shader_image_footprint
  VK_NV_shader_sm_builtins
  VK_NV_shader_subgroup_partitioned
  VK_NV_shading_rate_image
  VK_NV_viewport_array2
  VK_NV_viewport_swizzle
  VK_NVX_binary_import
  VK_NVX_device_generated_commands
  VK_NVX_image_view_handle
  VK_NVX_multiview_per_view_attributes
  VK_NV_ray_tracing
Picked physical device 0: GeForce RTX 2060 SUPER
warning: could not load function vkDebugMarkerSetObjectNameEXT
-----------------------
Screen-space image memory: 651.62 MB
Maximum recursion depth: 31
Shader group handle size: 16
SDL mouse initialized.
====== Quake II RTX initialized ======

q2rtx 1.3.0-711e686, Dec 21 2019
mode changed 1920 1080
]q2rtx: /home/biel/games/src/Q2RTX/src/refresh/vkpt/vk_util.c:152: buffer_map: Assertion `buf->memory != VK_NULL_HANDLE' failed.

any idea what might be failing?

Laser beams don't emit lights?

By default it seems that laser beams don't behave like light sources at all, only exception is the player railgun beam.

As a test i tried porting over this behavior to all laser beams and got something like this:
https://streamable.com/87v3g

It works and in general is better than not having them at all (at least IMO) though it obviously means running into 32 dynamic lights limit in nearly every instance.
To work around that i made the lights spawn only if they're within 300 units of the camera.

There may be a better way of achieving this or at least i would hope so as having them emit lights makes them less shallow looking.

Support for video cutscenes

As Q2RTX is based on Q2PRO, support for game cutscenes is not present. Would it be feasible to implement them in order to allow those like me who would like to play through the game casually with insight of what's happening in the story?

Graphics issue

During the game, at random, the picture becomes as if in gray. Most often this happens after a quick save when you press the F6 key, closer to the middle of the game or to the end of the game, for example, on the Cooling Facility map.
q2rtx_2019_12_31_11_52_44_596
q2rtx_2020_01_01_17_31_12_498
After leaving Quake 2 RTX and restarting, the gray picture also remained. The problem disappeared only after I took the q2config.cfg file from version 1.1.0 and replaced the current q2config.cfg file with it. Sometimes the problem is solved if you go to the desktop and start the game again.

v1.2 issues

  1. The user "[clanramrod] MAVEDICK" on the Steam forums noticed that this pipe in the Outlands (strike) campaign map didn't look right. Upon further investigation, it appears to have backfacing normals:

quake010

quake011

Both images were taken with pt_num_bounce_rays 1, flt_scale_spec 0 and flt_scale_lf 0, with the time of day set to noon (so the sun is directly overhead). The only difference is that the second image uses pt_bump_scale 0. Furthermore, adding a line to get_material which replaces the normal with the geo_normal when the normal is backfacing (dot(normal, geo_normal) < 0) has more or less the same effect as pt_bump_scale 0.

  1. Might not be an issue, but was the replacement of these wall textures intentional (from the Comm Center/base3 map)?

Old:
quake000

New:
quake012

Compilation error

using vs2019
Im getting compilation error while building.

Q2RTX/src/refresh/vkpt/shader/asvgf_lf.comp:156: 'format' : image formats must match

I followed the build instructions, what could this be?

[solved] Fails to start: Nvidia 2060, Fedora 31

Vulkan error: /home/linux64/.local/share/Steam/ubuntu12_32/steamoverlayvulkanlayer.so: wrong ELF class: ELFCLASS32
Vulkan error: /home/linux64/.local/share/Steam/ubuntu12_32/libVkLayer_steam_fossilize.so: wrong ELF class: ELFCLASS32
Fossilize INFO: Overriding serialization path: "/home/linux64/.local/share/Steam/steamapps/shadercache/1089130/fozpipelinesv4/steamapprun_pipeline_cache".
Received signal 11, aborting

q2_rtx.log

Native game demo version (via Proton also fails)
Nvidia driver 440.36
Fedora 31 fully updated

Will look into this further.

Missing material in 1.2.1

In the Outer Courts, after using the pipe that sucks you up to the flooded room where you can find the hidden data spinner, after jumping over the retractable brigde and following the corridor, there is a piece on the ground that appears matte black.

20191220203635_1

Incorrect handling of multiple monitors

In multiple monitor setups geometry is hardcoded to only query monitor number 0, and hardcoded to reset window location to x:0 y:0, ignoring system primary monitor settings, this causes q2rtx to open fullscreen on the incorrect monitor on many layouts with no way to change which monitor it opens on. Bug is centered in VID_GetFullscreen in refresh.c and the SetMode functions in SDL2's video.c

Steam thread of issue here with temporary workaround https://steamcommunity.com/app/1089130/discussions/0/1754646083691358061/?tscn=1575797213

Announcement: SIGGRAPH presentation on lighting in Q2RTX

Hi everyone,

This year at SIGGRAPH, I will be giving a talk about lighting in Quake II RTX. The talk will include details about importance sampling of polygonal lights, geometry processing, and sky lighting.

Wednesday, July 31st, 2019, 9:00 AM:
https://www.nvidia.com/en-us/events/siggraph/schedule/?talkid=sig201973101

Slides and session recording should be available later.

Also, if you'll be at SIGGRAPH on Tuesday evening or on Wednesday and want to talk about something Q2 related, you can send me an email: alpanteleev @ nvidia . com

-- Alexey Panteleev
Lead engineer of Q2RTX

Rendering issue with new build

This is how it should look, and how it looks with the build I did a few days ago.
quake001

This is how it looks with the build I did today
quake002

and this is how it looks after changing the renderer to OpenGL and back to RTX (a vid_restart has the same effect)
quake003

Something peculiar has happened in the last couple of days. Also note that there's some kind of graph by default.

NaN issue

Due to floating point fun, when NoV is calculated on line 539 of direct_lighting.rgen it can very rarely come out very slightly greater than 1. When this happens, it can cause a NaN result in the following computations. Under most circumstances Q2RTX quickly recovers from this error, but when the reference path tracing mode is active the affected pixel turns black and remains black forever.

In my local fork, I've fixed this by replacing the NoV computation with:

float NoV = clamp(-dot(normal, direction), 0, 1);

More artwork needed

The new Steam Library interface is rolling out now, with different-sized images to before. Q2RTX doesn't yet have images of the appropriate size for the new interface.

Details of the requirements are here.

Controller support

I'm sure this isn't a priority, but would it be possible to implement controller support (for the player, not the sun). Or is there a way to bind it in the config?

Thanks.

Grates issue

quake249

The grates texture shown here from the first level (and other levels) appears to have a number of random colored texels inside the black areas. The above screenshot shows only the albedo channel to best demonstrate the issue, but it's visible under the in-game lighting conditions as well. Note that when I opened textures\e1u1\grate 1_4.tga (which I think is the correct texture) in an image-viewing program I found the colored texels to be impossible to see even when zoomed in, but examining the raw RGB values showed that they were still present.

Indirect lighting

A few things in indirect_lighting.rgen.

  1. The condition on line 104 as with other SH-related things should probably include an && global_ubo.flt_enable != 0.

  2. When low_freq is updated at lines 299-304, The SH version of the update should be wrapped in an #if ENABLE_SH ... #endif.

  3. I may be missing something here, but when low_freq is updated on line 300, should it really be multiplied by dot(bounce_direction, normal)? For lambertian diffuse reflectance, the output should be light * cos(theta_i) / PI, but the pdf is also cos(theta_i) / PI when theta_i is generated from a cosine-weighted distribution (line 112), so shouldn't the two cancel out?

Additions to the readme.

The full build instructions aren't complete, for Linux at least.

git clone --recursive https://github.com/NVIDIA/Q2RTX.git
cd Q2RTX/
mkdir build
cd build/
cmake ..
cmake --build .

are the commands you'll need. Note that it's Q2RTX, not q2rtx as it currently says in the Readme, and the cmake .. is not specified but is crucial.

Also, the minimum version of Ubuntu should be Ubuntu 16.04; there isn't an Ubuntu 16 - the format is year.month.

Since the media files are critical to having the game run, and they're right here on github, linking to them should be done in the readme, and it could be made clearer that they go in Q2RTX/baseq2.

Game stutters every 3 seconds on Linux

Every 3 seconds my game stutters. This freeze can last a little over a quarter of a second. While tracking down the issue I found out that it was a problem with SDL2 and has already been resolved 2 months ago upstream. spurious/SDL-mirror@59728f9

I have validated that this fix does indeed stop the stuttering I am getting. Could you please bump the version of SDL2 that is being used to at least a version including that commit? The constant stuttering makes the game almost unplayable.

Support for OGG OST

(this thread originally concerned both the OST and cutscenes, but has been renamed so they can be split in two separate issues)

Hello! I'd love to experience a casual playthrough of Quake II with RTX enabled. However, Q2RTX does not feature cutscenes (despite them showing in the trailer) or any kind of music.

Would it be possible to implement the playback for those two things in Q2RTX?

Why region locked?

Hey,

Just why?!

Steam: This item is currently unavailable in your region
Official NVIDIA Page: "Game Over DIE MISSION, DIESE SEITE AUFZURUFEN, IST GESCHEITERT."

So then why this GitHub repo is not region locked like other sites?

Regards,
TheAifam5

Transparency limitation/bug?

Something i noticed today and i'm not sure whether it's the tech limitation or a bug where having line of sight on transparent object through another transparent object will fail to render the second object.

Water pool is visible when viewed directly.
Quake 2 RTX Remaster Screenshot 2019 07 03 - 00 44 52 61

Water pool is entirely invisible when viewed through glass panel.
Quake 2 RTX Remaster Screenshot 2019 07 03 - 00 45 18 63

Another example with glass planel positioned between first panel and the pillar.
Quake 2 RTX Remaster Screenshot 2019 07 03 - 00 51 24 87

Pillar behind second panel is visible whilst panel itself is not.
Quake 2 RTX Remaster Screenshot 2019 07 03 - 00 51 32 75

Documentation mapping/modding

Are there any plans to document map making and modding/textures/materials for this build of the q2 engine? Not really an issue this just makes me want to get back into mapping and modding and any documentation that we could get would help take the guess work out of things

Male player sound gets played when female player drowns

This bug goes back to the initial release of Quake 2.

When the player drowns, the game requests "drown1.wav"

gi.sound(current_player, CHAN_VOICE, gi.soundindex("player/drown1.wav"), 1, ATTN_NORM, 0);

Unfortunately, this file for the female player model was incorrectly named "drown.wav" in pak0.pak, so the male sound gets played instead.

This line could instead play drown.wav if the player is female.

There may be some other sounds like this; this is the one that I noticed.

Hand misalignment with weapons

quake000
I'm not sure exactly when this happened; I'm pretty sure it all lined up properly at release. The game is using some kind of specific override - the hand doesn't change at all when changing player skin - which doesn't line up with the weapon.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.