Skip to content

Commit 7524c89

Browse files
committed
Merge branch 'pkristof/rc_3_2025' into 'main'
Remix update 03/2025 Closes REMIX-3923 See merge request lightspeedrtx/dxvk-remix-nv!1360
2 parents c8a01c1 + e1b727c commit 7524c89

File tree

275 files changed

+15564
-6239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

275 files changed

+15564
-6239
lines changed

.gitmodules

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,14 @@
2525
url = https://github.com/KhronosGroup/Vulkan-Headers
2626
[submodule "submodules/rtxdi"]
2727
path = submodules/rtxdi
28-
url = https://github.com/NVIDIAGameWorks/RTXDI.git
28+
url = https://github.com/NVIDIA-RTX/RTXDI
2929
branch = remix
30+
[submodule "submodules/rtxcr"]
31+
path = submodules/rtxcr
32+
url = https://github.com/NVIDIA-RTX/RTXCR-Material-Library.git
33+
[submodule "submodules/nrc"]
34+
path = submodules/nrc
35+
url = https://github.com/NVIDIAGameWorks/Neural-Radiance-Cache.git
36+
[submodule "submodules/nvapi/nvapi"]
37+
path = submodules/nvapi
38+
url = https://github.com/NVIDIA/nvapi.git

RtxOptions.md

Lines changed: 144 additions & 63 deletions
Large diffs are not rendered by default.

documentation/RemixApiChangelog.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
### Fixed
1515

1616
### Removed
17+
18+
19+
## [0.4.3]
20+
21+
### Added
22+
- remixapi_MaterialInfoOpaqueSubsurfaceEXT.subsurfaceDiffusionProfile
23+
- remixapi_MaterialInfoOpaqueSubsurfaceEXT.subsurfaceRadius
24+
- remixapi_MaterialInfoOpaqueSubsurfaceEXT.subsurfaceRadiusScale
25+
- remixapi_MaterialInfoOpaqueSubsurfaceEXT.subsurfaceMaxSampleRadius
26+
27+
### Changed
28+
29+
### Fixed
30+
31+
### Removed

documentation/TerrainSystem.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,21 @@ Caveats/limitations:
2525
Future considerations / not supported (yet):
2626
- Material constants per input terrain replacement material.
2727
- Orthogonal surfaces (i.e. walls with floor) and separate multi-layer surfaces (i.e. baked road on a bridge over another baked road below). For these cases you can use the decal system. The benefit of the terrain system to the decal system is that the terrain baking exactly replicates original game's blending while the decal system only approximates the original blending. On the other hand, decal system supports blending in any direction and the input decal textures are sampled at the desired resolution at the time of ray hits the surface while the terrain system resamples original textures to a shared terrain texture. This can result in a of loss of image fidelity depending on the parametrization of the terrain system (see [rtx.terrainBaker.*](../RtxOptions.md)).
28+
29+
30+
## Terrain as decals
31+
32+
If a game draws a terrain as: an opaque draw call and blending translucent draw calls on top, then potentially, a terrain can be emulated via decals, since there's an opaque termination surface.
33+
34+
Such terrain-as-decals behaviour is set when the terrain baker 'Enable Runtime Terrain Baking' (`rtx.terrainBaker.enableBaking`) is disabled, so that the draw calls that are marked as 'Terrain' will be internally handled as a decal.
35+
36+
Advantages of terrain-as-decals:
37+
- Lower VRAM consumption as there are no terrain baking render targets.
38+
- Lower CPU workload, as draw calls don't need be preprocessed.
39+
- Less GPU context switches caused by rasterization of each terrain piece and layer in a specific way.
40+
- Can handle orthogonal surfaces (e.g. a horizontal beach and vertical cliff can be handled).
41+
- Higher resolution texture blending compared to using terrain baker cascades.
42+
43+
Disadvantages of terrain-as-decals:
44+
- The method is not applicable if terrain does NOT have an opaque surface draw call, as then decals won't have a termination point.
45+
- Potentially, higher GPU workload, as there are more rays to trace against the decals.

include/vulkan

Submodule vulkan updated 88 files

meson.build

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ add_global_arguments('/DREMIX_LIBRARY_EXPORTS=1', language : 'cpp')
168168

169169
dxvk_include_dirs = [
170170
'./include',
171-
'./include/vulkan/include'
171+
'./include/vulkan/include',
172+
'submodules/nrc/include',
172173
]
173174

174175
dxvk_include_path = include_directories(dxvk_include_dirs)
@@ -263,9 +264,9 @@ python_interpreter = find_program('python3', 'python')
263264
shader_compile_script = join_paths(global_src_root_norm, 'scripts-common/compile_shaders.py')
264265

265266
# GLSL compiler...
267+
# Note: The GLSL compiler in Meson is only used for DXVK shaders currently. RTX shaders use the shader compile script and have
268+
# their options/arguments within that script.
266269

267-
# The ShaderManager::compileShaders() function also uses glslangValidator to compile shader source for debug purpose.
268-
# If the command here is changed, the command in that function should also be updated.
269270
glsl_args = [ '-V', '--vn', '@BASENAME@', '@INPUT@', '-o', '@OUTPUT@', '--target-env', 'vulkan1.2', '@EXTRA_ARGS@' ]
270271

271272
if run_command(glsl_compiler, [ '--quiet', '--version' ], check: false).returncode() == 0
@@ -404,11 +405,13 @@ boost_include_path = include_directories('external/nv_usd/include/boost-1_78/')
404405
usd_include_paths = [nv_usd_include_path, boost_include_path]
405406

406407
vk_include_path = include_directories('./include/vulkan/include')
408+
# required for NV_present_metering
409+
add_project_arguments('-DVK_ENABLE_BETA_EXTENSIONS', language : 'cpp')
407410

408411
lssusd_include_paths = [nv_usd_include_path, boost_include_path, vk_include_path]
409412

410-
nvapi_include_paths = include_directories('external/nvapi')
411-
nvapi_lib_path = join_paths(global_src_root_norm, 'external/nvapi/amd64')
413+
nvapi_include_paths = include_directories('submodules/nvapi')
414+
nvapi_lib_path = join_paths(global_src_root_norm, 'submodules/nvapi/amd64')
412415
nvapi_lib = dxvk_compiler.find_library('nvapi64', dirs : nvapi_lib_path)
413416

414417
# Cache lib locations
@@ -439,6 +442,9 @@ dlfg_root_path = 'external/ngx_sdk_dlfg'
439442
dlfg_lib_path = join_paths(global_src_root_norm, dlfg_root_path, 'lib/Windows_x86_64/rel/')
440443
external_dll_paths += dlfg_lib_path
441444

445+
nrc_dll_name = 'NRC_Vulkan.dll'
446+
nrc_dll_path = join_paths(global_src_root_norm, 'submodules/nrc/bin/')
447+
442448
nrd_lib_path = join_paths(global_src_root_norm, 'external/nrd/Lib/Release/')
443449
if get_option('buildtype') == 'debug'
444450
nrd_lib_path = join_paths(global_src_root_norm, 'external/nrd/Lib/Debug/')
@@ -448,6 +454,10 @@ rtxdi_include_path = include_directories('submodules/rtxdi/rtxdi-sdk/include')
448454
# Need to use the include path as an argument to the shader build string,
449455
# and I couldn't find how to convert the IncludeDirs thing to a string... Meson.
450456
rtxdi_include_path_string = join_paths(global_src_root_norm, 'submodules/rtxdi/rtxdi-sdk/include')
457+
volumetrics_include_path_string = join_paths(global_src_root_norm, 'submodules/rtxdi/rtxdi-sdk/include/volumetrics')
458+
459+
rtxcr_include_path = include_directories('submodules/rtxcr/shaders/include')
460+
rtxcr_include_path_string = join_paths(global_src_root_norm, 'submodules/rtxcr/shaders/include')
451461

452462
if not dxvk_is_ninja
453463
# Copy dependencies that must be in same dir as executable to _output dir
@@ -479,6 +489,21 @@ if not dxvk_is_ninja
479489
build_by_default : true,
480490
command : [copy_script_path, usd_lib_path, output_dir, tbbmalloc_dll_name] )
481491

492+
copy_nrc_dll_target = custom_target('copy_nrc_dll',
493+
output : ['copy_nrc_dll'],
494+
build_by_default : true,
495+
command : [copy_script_path, nrc_dll_path, output_dir, nrc_dll_name] )
496+
497+
copy_nrc_cuda_deps_dll_target = custom_target('copy_nrc_cuda_deps_dll',
498+
output : ['copy_nrc_cuda_deps_dll'],
499+
build_by_default : true,
500+
command : [copy_script_path, nrc_dll_path, output_dir, 'cudart64_12.dll'] )
501+
502+
copy_nrc_cuda_nv_deps_dll_target = custom_target('copy_nrc_cuda_nv_deps_dll',
503+
output : ['copy_nrc_cuda_nv_deps_dll'],
504+
build_by_default : true,
505+
command : [copy_script_path, nrc_dll_path, output_dir, 'nvrtc*.dll'] )
506+
482507
copy_nrd_dll_target = custom_target('copy_nrd_dll',
483508
output : ['copy_nrd_dll'],
484509
build_by_default : true,
@@ -592,6 +617,8 @@ if dxvk_is_ninja
592617
# meson seems to force / as the path separator in custom_target
593618
# ... except in the case where the path separators are inconsistent, in which case it does nothing
594619
# force / as the path separator here to make sure it stays consistent
620+
nrc_lib_path = join_paths(global_src_root_norm, 'submodules/nrc/Lib/')
621+
595622
nrd_lib_path = join_paths(global_src_root_norm, 'external/nrd/Lib/Release/')
596623
if get_option('buildtype') == 'debug'
597624
nrd_lib_path = join_paths(global_src_root_norm, 'external/nrd/Lib/Debug/')
@@ -696,6 +723,27 @@ if dxvk_is_ninja
696723
output_path,
697724
tbbmalloc_dll_name] )
698725

726+
copy_nrc_dll = custom_target('copy_nrc_dll_' + target_suffix,
727+
output : ['copy_nrc_dll_' + target_suffix],
728+
command : [copy_script_path,
729+
nrc_dll_path,
730+
output_path,
731+
nrc_dll_name] )
732+
733+
copy_nrc_cuda_deps_dll = custom_target('copy_nrc_cuda_deps_dll_' + target_suffix,
734+
output : ['copy_nrc_cuda_deps_dll_' + target_suffix],
735+
command : [copy_script_path,
736+
nrc_dll_path,
737+
output_path,
738+
'cudart64_12.dll'] )
739+
740+
copy_nrc_cuda_nv_deps_dll = custom_target('copy_nrc_cuda_nv_deps_dll_' + target_suffix,
741+
output : ['copy_nrc_cuda_nv_deps_dll_' + target_suffix],
742+
command : [copy_script_path,
743+
nrc_dll_path,
744+
output_path,
745+
'nvrtc*.dll'] )
746+
699747
copy_nrd_dll = custom_target('copy_nrd_dll_' + target_suffix,
700748
output : ['copy_nrd_dll_' + target_suffix],
701749
command : [copy_script_path,
@@ -744,12 +792,15 @@ if dxvk_is_ninja
744792
copy_usd_dll,
745793
copy_tbb_dll,
746794
copy_tbbmalloc_dll,
795+
copy_nrc_dll,
796+
copy_nrc_cuda_deps_dll,
797+
copy_nrc_cuda_nv_deps_dll,
747798
copy_nrd_dll,
748799
copy_dlss_dll,
749800
copy_dlfg_dll,
750801
copy_aftermath_dll,
751802
d3d9_dll ]
752-
803+
753804
copy_target_depends += copy_reflex_dll
754805

755806
if enable_rtxio == true

packman-external.xml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,11 @@
55
<dependency name="fonts" linkPath="external/fonts">
66
<package name="rtx-remix-fonts" version="1" />
77
</dependency>
8-
<dependency name="nrd" linkPath="external/nrd">
9-
<package name="rtx-remix-nrd" version="4" />
10-
</dependency>
11-
<dependency name="nvapi" linkPath="external/nvapi">
12-
<package name="rtx-remix-nvapi" version="1" />
13-
</dependency>
148
<dependency name="nv_usd" linkPath="external/nv_usd">
159
<package name="rtx-remix-nv_usd" version="5" />
1610
</dependency>
1711
<dependency name="omni_core_materials" linkPath="external/omni_core_materials">
18-
<package name="rtx-remix-omni_core_materials" version="15" />
12+
<package name="rtx-remix-omni_core_materials" version="16" />
1913
</dependency>
2014
<dependency name="reflex" linkPath="external/reflex">
2115
<package name="rtx-remix-reflex" version="1" />
@@ -32,10 +26,13 @@
3226
<dependency name="nv_xxd" linkPath="external/nv_xxd">
3327
<package name="rtx-remix-nv_xxd" version="1" />
3428
</dependency>
35-
<dependency name="ngx_sdk_dldn" linkPath="external/ngx_sdk_dldn">
36-
<package name="rtx-remix-ngx_sdk_dldn" version="3" />
37-
</dependency>
38-
<dependency name="ngx_sdk_dlfg" linkPath="external/ngx_sdk_dlfg">
39-
<package name="rtx-remix-ngx_sdk_dlfg" version="1" />
40-
</dependency>
29+
<dependency name="ngx_sdk_dlfg" linkPath="external/ngx_sdk_dlfg">
30+
<package name="rtx-remix-ngx_sdk_dlfg" version="2" />
31+
</dependency>
32+
<dependency name="ngx_sdk_dldn" linkPath="external/ngx_sdk_dldn">
33+
<package name="rtx-remix-ngx_sdk_dldn" version="5" />
34+
</dependency>
35+
<dependency name="nrd" linkPath="external/nrd">
36+
<package name="rtx-remix-nrd" version="4.13" />
37+
</dependency>
4138
</project>

public/include/remix/remix.h

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
2+
* Copyright (c) 2023-2024, NVIDIA CORPORATION. All rights reserved.
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
55
* copy of this software and associated documentation files (the "Software"),
@@ -365,23 +365,30 @@ namespace remix {
365365
subsurfaceSingleScatteringAlbedoTexture = {};
366366
subsurfaceTransmittanceColor = { 0.5f, 0.5f, 0.5f };
367367
subsurfaceMeasurementDistance = 0.0f;
368-
subsurfaceSingleScatteringAlbedo = { 0.5f, 0.5f, 0.5f };;
368+
subsurfaceSingleScatteringAlbedo = { 0.5f, 0.5f, 0.5f };
369369
subsurfaceVolumetricAnisotropy = 0.0f;
370-
static_assert(sizeof remixapi_MaterialInfoOpaqueSubsurfaceEXT == 72);
370+
subsurfaceDiffusionProfile = false;
371+
subsurfaceRadius = { 0.5f, 0.5f, 0.5f };
372+
subsurfaceRadiusScale = 0.0f;
373+
subsurfaceMaxSampleRadius = 0.0f;
374+
subsurfaceRadiusTexture = {};
375+
static_assert(sizeof remixapi_MaterialInfoOpaqueSubsurfaceEXT == 104);
371376
}
372377

373378
MaterialInfoOpaqueSubsurfaceEXT(const MaterialInfoOpaqueSubsurfaceEXT& other)
374379
: remixapi_MaterialInfoOpaqueSubsurfaceEXT(other)
375380
, cpp_subsurfaceTransmittanceTexture(other.cpp_subsurfaceTransmittanceTexture)
376381
, cpp_subsurfaceThicknessTexture(other.cpp_subsurfaceThicknessTexture)
377-
, cpp_subsurfaceSingleScatteringAlbedoTexture(other.cpp_subsurfaceSingleScatteringAlbedoTexture) {
382+
, cpp_subsurfaceSingleScatteringAlbedoTexture(other.cpp_subsurfaceSingleScatteringAlbedoTexture)
383+
, cpp_subsurfaceRadiusTexture(other.cpp_subsurfaceRadiusTexture) {
378384
cpp_fixPointers();
379385
}
380386
MaterialInfoOpaqueSubsurfaceEXT(MaterialInfoOpaqueSubsurfaceEXT&& other) noexcept
381387
: remixapi_MaterialInfoOpaqueSubsurfaceEXT(other)
382388
, cpp_subsurfaceTransmittanceTexture(std::move(other.cpp_subsurfaceTransmittanceTexture))
383389
, cpp_subsurfaceThicknessTexture(std::move(other.cpp_subsurfaceThicknessTexture))
384-
, cpp_subsurfaceSingleScatteringAlbedoTexture(std::move(other.cpp_subsurfaceSingleScatteringAlbedoTexture)) {
390+
, cpp_subsurfaceSingleScatteringAlbedoTexture(std::move(other.cpp_subsurfaceSingleScatteringAlbedoTexture))
391+
, cpp_subsurfaceRadiusTexture(std::move(other.cpp_subsurfaceRadiusTexture)) {
385392
cpp_fixPointers();
386393
}
387394
MaterialInfoOpaqueSubsurfaceEXT& operator=(const MaterialInfoOpaqueSubsurfaceEXT& other) {
@@ -392,6 +399,7 @@ namespace remix {
392399
cpp_subsurfaceTransmittanceTexture = other.cpp_subsurfaceTransmittanceTexture;
393400
cpp_subsurfaceThicknessTexture = other.cpp_subsurfaceThicknessTexture;
394401
cpp_subsurfaceSingleScatteringAlbedoTexture = other.cpp_subsurfaceSingleScatteringAlbedoTexture;
402+
cpp_subsurfaceRadiusTexture = other.cpp_subsurfaceRadiusTexture;
395403
cpp_fixPointers();
396404
return *this;
397405
}
@@ -403,6 +411,7 @@ namespace remix {
403411
cpp_subsurfaceTransmittanceTexture = std::move(other.cpp_subsurfaceTransmittanceTexture);
404412
cpp_subsurfaceThicknessTexture = std::move(other.cpp_subsurfaceThicknessTexture);
405413
cpp_subsurfaceSingleScatteringAlbedoTexture = std::move(other.cpp_subsurfaceSingleScatteringAlbedoTexture);
414+
cpp_subsurfaceRadiusTexture = std::move(other.cpp_subsurfaceRadiusTexture);
406415
cpp_fixPointers();
407416
return *this;
408417
}
@@ -419,18 +428,24 @@ namespace remix {
419428
cpp_subsurfaceSingleScatteringAlbedoTexture = std::move(v);
420429
subsurfaceSingleScatteringAlbedoTexture = cpp_subsurfaceSingleScatteringAlbedoTexture.c_str();
421430
}
431+
void set_subsurfaceRadiusTexture(std::filesystem::path v) {
432+
cpp_subsurfaceRadiusTexture = std::move(v);
433+
subsurfaceRadiusTexture = cpp_subsurfaceRadiusTexture.c_str();
434+
}
422435

423436
private:
424437
void cpp_fixPointers() {
425438
subsurfaceTransmittanceTexture = cpp_subsurfaceTransmittanceTexture.c_str();
426439
subsurfaceThicknessTexture = cpp_subsurfaceThicknessTexture.c_str();
427440
subsurfaceSingleScatteringAlbedoTexture = cpp_subsurfaceSingleScatteringAlbedoTexture.c_str();
428-
static_assert(sizeof remixapi_MaterialInfoOpaqueSubsurfaceEXT == 72, "Recheck pointers");
441+
subsurfaceRadiusTexture = cpp_subsurfaceRadiusTexture.c_str();
442+
static_assert(sizeof remixapi_MaterialInfoOpaqueSubsurfaceEXT == 104, "Recheck pointers");
429443
}
430444

431445
std::filesystem::path cpp_subsurfaceTransmittanceTexture {};
432446
std::filesystem::path cpp_subsurfaceThicknessTexture {};
433447
std::filesystem::path cpp_subsurfaceSingleScatteringAlbedoTexture {};
448+
std::filesystem::path cpp_subsurfaceRadiusTexture{};
434449
};
435450

436451
struct MaterialInfoTranslucentEXT : remixapi_MaterialInfoTranslucentEXT {
@@ -759,6 +774,7 @@ namespace remix {
759774
radius = 0.05f;
760775
shaping_hasvalue = false;
761776
shaping_value = detail::defaultLightShaping();
777+
volumetricRadianceScale = 1.0f;
762778
static_assert(sizeof remixapi_LightInfoSphereEXT == 64);
763779
}
764780

@@ -779,6 +795,7 @@ namespace remix {
779795
direction = { 0.0f, 0.0f, 1.0f };
780796
shaping_hasvalue = false;
781797
shaping_value = detail::defaultLightShaping();
798+
volumetricRadianceScale = 1.0f;
782799
static_assert(sizeof remixapi_LightInfoRectEXT == 104);
783800
}
784801

@@ -799,6 +816,7 @@ namespace remix {
799816
direction = { 0.0f, 0.0f, 1.0f };
800817
shaping_hasvalue = false;
801818
shaping_value = detail::defaultLightShaping();
819+
volumetricRadianceScale = 1.0f;
802820
static_assert(sizeof remixapi_LightInfoDiskEXT == 104);
803821
}
804822

@@ -815,7 +833,8 @@ namespace remix {
815833
radius = 1.0f;
816834
axis = { 1.0f, 0.0f, 0.0f };
817835
axisLength = 1.0f;
818-
static_assert(sizeof remixapi_LightInfoCylinderEXT == 48);
836+
volumetricRadianceScale = 1.0f;
837+
static_assert(sizeof remixapi_LightInfoCylinderEXT == 56);
819838
}
820839
};
821840

@@ -825,7 +844,8 @@ namespace remix {
825844
pNext = nullptr;
826845
direction = { 0.0f, -1.0f, 0.0f };
827846
angularDiameterDegrees = 0.5f;
828-
static_assert(sizeof remixapi_LightInfoDistantEXT == 32);
847+
volumetricRadianceScale = 1.0f;
848+
static_assert(sizeof remixapi_LightInfoDistantEXT == 40);
829849
}
830850
};
831851

0 commit comments

Comments
 (0)