Skip to content

Commit

Permalink
Merge branch 'r1.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
apanteleev committed Dec 10, 2020
2 parents 4132eed + ed88cc7 commit aed6d4f
Show file tree
Hide file tree
Showing 64 changed files with 2,720 additions and 2,411 deletions.
15 changes: 12 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

project(quake2-RTX)
set(Q2RTX_VERSION_MAJOR 1)
set(Q2RTX_VERSION_MINOR 3)
set(Q2RTX_VERSION_MINOR 4)
set(Q2RTX_VERSION_POINT 0)

# get short-hash
Expand All @@ -15,6 +15,15 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)

# get branch name
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE Q2RTX_VERSION_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)


OPTION(CONFIG_GL_RENDERER "Enable GL renderer" ON)
OPTION(CONFIG_VKPT_RENDERER "Enable VKPT renderer" ON)
OPTION(CONFIG_VKPT_ENABLE_DEVICE_GROUPS "Enable device groups (multi-gpu) support" ON)
Expand All @@ -41,9 +50,9 @@ endif ()

IF(WIN32)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELEASE} /MT")
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MT")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /MT")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MT")
ENDIF()

add_subdirectory(extern)
Expand Down
44 changes: 44 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,49 @@
# Quake II RTX Change Log

## 1.4.0

**New Features:**

* Added support for the final Vulkan Ray Tracing API. The game can now run on any GPU supporting the `VK_KHR_ray_tracing_pipeline` extension.
* Added temporal upscaling, or TAAU, for improved image quality at lower resolution scales.

**Fixed Issues:**

* Fixed a crash that happened when there are no available sound devices.
* Fixed a few issues with the tone mapper and the profiler for AMD GPU compatibility.
* Fixed a server crash: https://github.com/NVIDIA/Q2RTX/issues/86
* Fixed black materials and some light leaks: https://github.com/NVIDIA/Q2RTX/issues/55
* Fixed building the game with GCC10 on Linux: https://github.com/NVIDIA/Q2RTX/issues/80
* Fixed missing railgun lights in photo mode: https://github.com/NVIDIA/Q2RTX/issues/75
* Fixed missing sun light on geometry with invalid clusters.
* Fixed the CFLAGS for MinSizeRel and RelWithDebInfo builds to generate correct debug symbols.
* Fixed the game stuttering on Linux: https://github.com/NVIDIA/Q2RTX/issues/62
* Fixed the issue with all models being missing or corrupted on some maps during network play.
* Fixed the nearest filter when DRS was enabled and then disabled.

**Denoiser Improvements:**

* Implemented a new gradient estimation algorithm that makes the image more stable in reflections and refractions.
* Implemented sampling across checkerboard fields in the temporal filter to reduce blurring.
* Improved motion vectors for multiple refraction, in particular when thick glass is enabled.
* Improved the temporal filter to avoid smearing on surfaces that appear at small glancing angles, e.g. on the floor when going up the stairs.
* Improved the temporal filter to make lighting more stable on high-detail surfaces.


**Misc Improvements:**

* Added git branch name to the game version info.
* Improved in-game screenshot feature performance.
* Improved the console log to get more information in case of game crashes.
* Increased precision of printed FPS when running timedemos.
* Made the `wrote <filename>` message that was issued when taking screenshots optional, controlled by the `gl_screenshot_message` cvar.
* Reduced the amount of stutter that happened when new geometry is loaded, like on weapon pickup.
* Replaced the Vulkan headers stored in the repository with a submodule pointing to https://github.com/KhronosGroup/Vulkan-Headers
* Static resolution scale can now be set to as low as 25%.
* Updated SDL2 version to changeset 13784.
* Vulkan validation layer can now be enabled through the `vk_validation` cvar.


## 1.3.0

**New Features:**
Expand Down
32 changes: 9 additions & 23 deletions cmake/compileShaders.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ message(STATUS "Glslang compiler : ${GLSLANG_COMPILER}")

function(compile_shader)
set(options "")
set(oneValueArgs SOURCE_FILE OUTPUT_FILE_LIST)
set(multiValueArgs "")
set(oneValueArgs SOURCE_FILE OUTPUT_FILE_NAME OUTPUT_FILE_LIST)
set(multiValueArgs DEFINES)
cmake_parse_arguments(params "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

if (NOT params_SOURCE_FILE)
Expand All @@ -42,37 +42,23 @@ function(compile_shader)
endif()

set(src_file "${CMAKE_CURRENT_SOURCE_DIR}/${params_SOURCE_FILE}")
get_filename_component(base_file_name ${src_file} NAME)
get_filename_component(file_extension ${src_file} EXT)

if (file_extension STREQUAL ".comp")
set(DEFINES "-DSHADER_STAGE_COMP")
elseif(file_extension STREQUAL ".rahit")
set(DEFINES "-DSHADER_STAGE_ACHIT")
elseif(file_extension STREQUAL ".rmiss")
set(DEFINES "-DSHADER_STAGE_RMISS")
elseif(file_extension STREQUAL ".rchit")
set(DEFINES "-DSHADER_STAGE_RCHIT")
elseif(file_extension STREQUAL ".rgen")
set(DEFINES "-DSHADER_STAGE_RGEN")
elseif(file_extension STREQUAL ".frag")
set(DEFINES "-DSHADER_STAGE_FRAG")
elseif(file_extension STREQUAL ".vert")
set(DEFINES "-DSHADER_STAGE_VERT")
if (params_OUTPUT_FILE_NAME)
set(output_file_name ${params_OUTPUT_FILE_NAME})
else()
message(FATAL_ERROR "unknown extension in shader source file: ${file_extension}")
get_filename_component(output_file_name ${src_file} NAME)
endif()

set_source_files_properties(${src_file} PROPERTIES VS_TOOL_OVERRIDE "None")

set (out_dir "${CMAKE_SOURCE_DIR}/baseq2/shader_vkpt")
set (out_file "${out_dir}/${base_file_name}.spv")
set (out_file "${out_dir}/${output_file_name}.spv")

set(glslang_command_line
--target-env vulkan1.1
--target-env vulkan1.2
-DVKPT_SHADER
-V
${DEFINES}
${params_DEFINES}
"${src_file}"
-o "${out_file}")

Expand Down
2 changes: 1 addition & 1 deletion extern/SDL2
Submodule SDL2 updated 875 files
3 changes: 2 additions & 1 deletion inc/shared/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
// expand to generate version string
#define STRING(x) #x
#define _STR(x) STRING(x)
#define VERSION_STRING "" _STR(VERSION_MAJOR) "." _STR(VERSION_MINOR) "." _STR(VERSION_POINT) "-" _STR(VERSION_SHA)
#define VERSION_STRING "" _STR(VERSION_MAJOR) "." _STR(VERSION_MINOR) "." _STR(VERSION_POINT)
#define LONG_VERSION_STRING "" _STR(VERSION_MAJOR) "." _STR(VERSION_MINOR) "." _STR(VERSION_POINT) "-" _STR(VERSION_BRANCH) "-" _STR(VERSION_SHA)

#ifdef _WIN64
#define CPUSTRING "x86_64"
Expand Down
2 changes: 2 additions & 0 deletions setup/setup.nsi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

RequestExecutionLevel user
Unicode True

!include "nsDialogs.nsh"
!include "MUI2.nsh"
Expand Down Expand Up @@ -68,6 +69,7 @@ Section "Engine Files (Required)" Section_Game

SetOutPath "$INSTDIR\baseq2"
File "${SOURCE_DIR}\baseq2\gamex86_64.dll"
File "${SOURCE_DIR}\baseq2\gamex86_64.pdb"

SetCompress OFF
File "${SOURCE_DIR}\baseq2\shaders.pkz"
Expand Down
1 change: 1 addition & 0 deletions setup/steam_setup.nsi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

RequestExecutionLevel user
Unicode True

!include "nsDialogs.nsh"
!include "MUI2.nsh"
Expand Down
37 changes: 23 additions & 14 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -297,32 +297,20 @@ set(SRC_SHADERS
refresh/vkpt/shader/bloom_composite.comp
refresh/vkpt/shader/bloom_blur.comp
refresh/vkpt/shader/compositing.comp
refresh/vkpt/shader/primary_rays.rgen
refresh/vkpt/shader/direct_lighting.rgen
refresh/vkpt/shader/checkerboard_interleave.comp
refresh/vkpt/shader/indirect_lighting.rgen
refresh/vkpt/shader/path_tracer.rchit
refresh/vkpt/shader/path_tracer.rmiss
refresh/vkpt/shader/path_tracer_particle.rahit
refresh/vkpt/shader/path_tracer_sprite.rahit
refresh/vkpt/shader/path_tracer_beam.rahit
refresh/vkpt/shader/path_tracer_explosion.rahit
refresh/vkpt/shader/path_tracer_shadow.rmiss
refresh/vkpt/shader/asvgf_atrous.comp
refresh/vkpt/shader/asvgf_fwd_project.comp
refresh/vkpt/shader/asvgf_gradient_atrous.comp
refresh/vkpt/shader/asvgf_gradient_img.comp
refresh/vkpt/shader/asvgf_gradient_reproject.comp
refresh/vkpt/shader/asvgf_lf.comp
refresh/vkpt/shader/asvgf_seed_rng.comp
refresh/vkpt/shader/asvgf_taa.comp
refresh/vkpt/shader/asvgf_taau.comp
refresh/vkpt/shader/asvgf_temporal.comp
refresh/vkpt/shader/instance_geometry.comp
refresh/vkpt/shader/tone_mapping_histogram.comp
refresh/vkpt/shader/tone_mapping_curve.comp
refresh/vkpt/shader/tone_mapping_apply.comp
refresh/vkpt/shader/physical_sky.comp
refresh/vkpt/shader/physical_sky_space.comp
refresh/vkpt/shader/reflect_refract.rgen
refresh/vkpt/shader/shadow_map.vert
refresh/vkpt/shader/sky_buffer_resolve.comp
refresh/vkpt/shader/stretch_pic.frag
Expand All @@ -331,9 +319,29 @@ set(SRC_SHADERS
refresh/vkpt/shader/final_blit.vert
)

set(SRC_RT_SHADERS
refresh/vkpt/shader/primary_rays.rgen
refresh/vkpt/shader/direct_lighting.rgen
refresh/vkpt/shader/indirect_lighting.rgen
refresh/vkpt/shader/path_tracer.rchit
refresh/vkpt/shader/path_tracer.rmiss
refresh/vkpt/shader/path_tracer_particle.rahit
refresh/vkpt/shader/path_tracer_sprite.rahit
refresh/vkpt/shader/path_tracer_beam.rahit
refresh/vkpt/shader/path_tracer_explosion.rahit
refresh/vkpt/shader/path_tracer_shadow.rmiss
refresh/vkpt/shader/reflect_refract.rgen
)

include(../cmake/compileShaders.cmake)

if (GLSLANG_COMPILER)
foreach(s ${SRC_RT_SHADERS})
get_filename_component(shader_name ${s} NAME)
compile_shader(SOURCE_FILE ${s} OUTPUT_FILE_LIST shader_bytecode OUTPUT_FILE_NAME "${shader_name}.nv" DEFINES "-DNV_RAY_TRACING")
compile_shader(SOURCE_FILE ${s} OUTPUT_FILE_LIST shader_bytecode OUTPUT_FILE_NAME "${shader_name}.khr" DEFINES "-DKHR_RAY_TRACING")
endforeach()

foreach(s ${SRC_SHADERS})
compile_shader(SOURCE_FILE ${s} OUTPUT_FILE_LIST shader_bytecode)
endforeach()
Expand All @@ -348,6 +356,7 @@ ADD_DEFINITIONS(-DVERSION_MAJOR=${Q2RTX_VERSION_MAJOR})
ADD_DEFINITIONS(-DVERSION_MINOR=${Q2RTX_VERSION_MINOR})
ADD_DEFINITIONS(-DVERSION_POINT=${Q2RTX_VERSION_POINT})
ADD_DEFINITIONS(-DVERSION_SHA=${Q2RTX_VERSION_SHA})
ADD_DEFINITIONS(-DVERSION_BRANCH=${Q2RTX_VERSION_BRANCH})

ADD_DEFINITIONS(-DHAVE_CONFIG_H=1 -DCURL_STATICLIB)

Expand Down
2 changes: 1 addition & 1 deletion src/client/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ static void Con_DrawSolidConsole(void)
UI_DRAWCURSOR, con.charsetImage);
}

#define APP_VERSION APPLICATION " " VERSION_STRING
#define APP_VERSION APPLICATION " " LONG_VERSION_STRING
#define VER_WIDTH ((int)(sizeof(APP_VERSION) + 1) * CHAR_WIDTH)

y = vislines - CON_PRESTEP + CHAR_HEIGHT;
Expand Down
3 changes: 3 additions & 0 deletions src/client/refresh.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ cvar_t *_vid_fullscreen;
cvar_t *vid_display;
cvar_t *vid_displaylist;

// used in gl and vkpt renderers
int registration_sequence;

#define MODE_GEOMETRY 1
#define MODE_FULLSCREEN 2
#define MODE_MODELIST 4
Expand Down
7 changes: 5 additions & 2 deletions src/common/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ cvar_t *rcon_password;
extern cvar_t *fs_shareware;

const char com_version_string[] =
APPLICATION " " VERSION_STRING " " __DATE__ " " BUILDSTRING " " CPUSTRING;
APPLICATION " " LONG_VERSION_STRING " " __DATE__ " " BUILDSTRING " " CPUSTRING;

unsigned com_framenum;
unsigned com_eventTime;
Expand Down Expand Up @@ -1019,6 +1019,10 @@ void Qcommon_Init(int argc, char **argv)
Cmd_AddCommand("recycle", Com_Recycle_f);
#endif

// Print the engine version early so that it's definitely included in the console log.
// The log file is opened during the execution of one of the config files above.
Com_LPrintf(PRINT_NOTICE, "\nEngine version: " APPLICATION " " LONG_VERSION_STRING ", built on " __DATE__ "\n\n");

Netchan_Init();
NET_Init();
BSP_Init();
Expand Down Expand Up @@ -1054,7 +1058,6 @@ void Qcommon_Init(int argc, char **argv)
Com_AddConfigFile(COM_POSTINIT_CFG, FS_TYPE_REAL);

Com_Printf("====== " PRODUCT " initialized ======\n\n");
Com_LPrintf(PRINT_NOTICE, APPLICATION " " VERSION_STRING ", " __DATE__ "\n");

if (fs_shareware->integer)
{
Expand Down
2 changes: 0 additions & 2 deletions src/refresh/gl/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ statCounters_t c;

entity_t gl_world;

int registration_sequence;

// regular variables
cvar_t *gl_partscale;
cvar_t *gl_partstyle;
Expand Down
14 changes: 8 additions & 6 deletions src/refresh/images.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@ SCREEN SHOTS

static cvar_t *r_screenshot_format;
static cvar_t *r_screenshot_quality;
static cvar_t *r_screenshot_compression;
static cvar_t* r_screenshot_compression;
static cvar_t* r_screenshot_message;

static qhandle_t create_screenshot(char *buffer, size_t size,
const char *name, const char *ext)
Expand Down Expand Up @@ -466,7 +467,7 @@ static void make_screenshot(const char *name, const char *ext,

if (ret < 0) {
Com_EPrintf("Couldn't write %s: %s\n", buffer, Q_ErrorString(ret));
} else {
} else if(r_screenshot_message->integer) {
Com_Printf("Wrote %s\n", buffer);
}
}
Expand Down Expand Up @@ -1430,10 +1431,11 @@ void IMG_Init(void)
r_texture_formats->changed = r_texture_formats_changed;
r_texture_formats_changed(r_texture_formats);

r_screenshot_format = Cvar_Get("gl_screenshot_format", "jpg", 0);
r_screenshot_format = Cvar_Get("gl_screenshot_format", "png", 0);
r_screenshot_quality = Cvar_Get("gl_screenshot_quality", "100", 0);
r_screenshot_compression = Cvar_Get("gl_screenshot_compression", "6", 0);
r_screenshot_format = Cvar_Get("gl_screenshot_format", "jpg", CVAR_ARCHIVE);
r_screenshot_format = Cvar_Get("gl_screenshot_format", "png", CVAR_ARCHIVE);
r_screenshot_quality = Cvar_Get("gl_screenshot_quality", "100", CVAR_ARCHIVE);
r_screenshot_compression = Cvar_Get("gl_screenshot_compression", "6", CVAR_ARCHIVE);
r_screenshot_message = Cvar_Get("gl_screenshot_message", "0", CVAR_ARCHIVE);

Cmd_Register(img_cmd);

Expand Down
Loading

0 comments on commit aed6d4f

Please sign in to comment.