Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into release/v0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
nsubtil committed Dec 11, 2023
2 parents 3871d0d + 2108db0 commit ee334a5
Show file tree
Hide file tree
Showing 180 changed files with 7,914 additions and 2,270 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build

on:
push:
branches: [ main ]
branches: [ main, 'release/**' ]
pull_request:
branches: [ main ]
branches: [ main, 'release/**' ]

jobs:
build-windows:
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/test-build-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Test Builds on Windows

on: [push, pull_request, workflow_dispatch]

jobs:
build-set-windows:
runs-on: windows-2022

steps:
- name: Checkout code
id: checkout-code
uses: actions/checkout@v2
with:
submodules: recursive

- name: Setup glslangValidator
shell: pwsh
run: |
choco install vulkan-sdk -y
Write-Output "$([System.Environment]::GetEnvironmentVariable('VULKAN_SDK', 'Machine'))\Bin" `
| Out-File -FilePath "${Env:GITHUB_PATH}" -Append
- name: Setup Meson
shell: pwsh
run: pip install meson

- name: Find Visual Studio
shell: pwsh
run: |
$installationPath = Get-VSSetupInstance `
| Select-VSSetupInstance -Require Microsoft.VisualStudio.Workload.NativeDesktop -Latest `
| Select-Object -ExpandProperty InstallationPath
Write-Output "VSDEVCMD=${installationPath}\Common7\Tools\VsDevCmd.bat" `
| Out-File -FilePath "${Env:GITHUB_ENV}" -Append
- name: Build MSVC x86
shell: pwsh
run: |
& "${Env:COMSPEC}" /s /c "`"${Env:VSDEVCMD}`" -arch=x86 -host_arch=x64 -no_logo && set" `
| % { , ($_ -Split '=', 2) } `
| % { [System.Environment]::SetEnvironmentVariable($_[0], $_[1]) }
meson --buildtype release --backend vs2022 build-msvc-x86
msbuild -m build-msvc-x86/dxvk.sln
- name: Build MSVC x64
shell: pwsh
run: |
& "${Env:COMSPEC}" /s /c "`"${Env:VSDEVCMD}`" -arch=x64 -host_arch=x64 -no_logo && set" `
| % { , ($_ -Split '=', 2) } `
| % { [System.Environment]::SetEnvironmentVariable($_[0], $_[1]) }
meson --buildtype release --backend vs2022 build-msvc-x64
msbuild -m build-msvc-x64/dxvk.sln
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@
.vscode/
/external
**/_batch_output/**
/public/bin/
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ While dxvk-remix is a fork of DXVK, please report bugs encountered with dxvk-rem
## Project Documentation

- [Rtx Options](/RtxOptions.md)
- [Terrain System](/documentation/TerrainSystem.md)
- [Anti-Culling System](/documentation/AntiCullingSystem.md)
- [Foliage System](/documentation/FoliageSystem.md)
- [Opacity Micromap](/documentation/OpacityMicromap.md)
- [Terrain System](/documentation/TerrainSystem.md)
- [Unit Test](/documentation/UnitTest.md)
2 changes: 1 addition & 1 deletion RELEASE
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
# DEALINGS IN THE SOFTWARE.
#############################################################################

1.9.3
1.9.4
9 changes: 8 additions & 1 deletion RtxOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ Tables below enumerate all the options and their defaults set by RTX Remix. Note
|rtx.debugView.composite.compositeViewIdx|int|0|Index of a composite view to show when Composite Debug View is enabled\. The index must be a a valid value from CompositeDebugView enumeration\. Value of 0 disables Composite Debug View\.|
|rtx.debugView.debugViewIdx|int|0|Index of a debug view to show when Debug View is enabled\. The index must be a valid value from DEBUG\_VIEW\_\* macro defined indices\. Value of 0 disables Debug View\.|
|rtx.debugView.displayType|int|0||
|rtx.debugView.enableGammaCorrection|bool|False|Enables gamma correction of a debug view value\.|
|rtx.debugView.enablePseudoColor|bool|False|Enables RGB color coding of a scalar debug view value\.|
|rtx.debugView.evMaxValue|int|4||
|rtx.debugView.evMinValue|int|-4||
Expand Down Expand Up @@ -167,7 +168,11 @@ Tables below enumerate all the options and their defaults set by RTX Remix. Note
|rtx.di.stealBoundaryPixelSamplesWhenOutsideOfScreen|bool|True|Steal screen boundary samples when a hit point is outside the screen\.|
|rtx.displacement.displacementFactor|float|1|Scaling factor for all displacement maps|
|rtx.displacement.enableDirectLighting|bool|True|Whether direct lighting accounts for displacement mapping|
|rtx.displacement.enableIndirectHit|bool|False|Whether indirect ray hits account for displacement mapping \(Enabling this is expensive\. Without it, non\-perfect reflections of displaced objects will not show displacement\.\)|
|rtx.displacement.enableIndirectLighting|bool|True|Whether indirect lighting accounts for displacement mapping|
|rtx.displacement.enableNEECache|bool|True|Whether the NEE cache accounts for displacement mapping|
|rtx.displacement.enablePSR|bool|False|Enable PSR \(perfect reflections\) for materials with displacement\. Rays that have been perfectly reflected off a POM surface will not collide correctly with other parts of that same surface\.|
|rtx.displacement.enableReSTIRGI|bool|True|Whether ReSTIR GI accounts for displacement mapping|
|rtx.dlfg.enable|bool|True|Enables DLSS 3\.0 frame generation which generates interpolated frames to increase framerate at the cost of slightly more latency\.|
|rtx.dlssEnhancementDirectLightMaxValue|float|10|The maximum strength of direct lighting enhancement\.|
|rtx.dlssEnhancementDirectLightPower|float|0.7|The overall strength of direct lighting enhancement\.|
Expand Down Expand Up @@ -312,6 +317,7 @@ Tables below enumerate all the options and their defaults set by RTX Remix. Note
|rtx.lightConversionEqualityDirectionThreshold|float|0.99|The lower cosine angle threshold between two directions used to determine if two directional lights as the same light when uniquely identifying legacy lights for conversion\.|
|rtx.lightConversionEqualityDistanceThreshold|float|0.05|The upper distance threshold between two positions used to determine if two positional lights as the same light when uniquely identifying legacy lights for conversion\.|
|rtx.lightConversionSphereLightFixedRadius|float|4|The fixed radius in world units to use for legacy lights converted to sphere lights \(currently point and spot lights will convert to sphere lights\)\. Use caution with large light radii as many legacy lights will be placed close to geometry and intersect it, causing suboptimal light sampling performance or other visual artifacts \(lights clipping through walls, etc\)\.|
|rtx.lights.enableDebugMode|bool|False|Enables light debug visualization\.|
|rtx.localtonemap.boostLocalContrast|bool|False|Boosts contrast on local features\.|
|rtx.localtonemap.displayMip|int|0|Bottom mip level of tone map pyramid\.|
|rtx.localtonemap.exposure|float|0.75|Exposure factor applied on average exposure\.|
Expand Down Expand Up @@ -535,7 +541,8 @@ Tables below enumerate all the options and their defaults set by RTX Remix. Note
|rtx.stochasticAlphaBlendShareNeighbors|bool|True|Share result with other pixels to accelerate search\.|
|rtx.stochasticAlphaBlendUseNeighborSearch|bool|True|Get radiance from neighbor opaque pixels\.|
|rtx.stochasticAlphaBlendUseRadianceVolume|bool|True|Get radiance from radiance volume\.|
|rtx.subsurface.enableThinOpaque|bool|True|Enable thin opaque material\. The materials with th in opaque properties will fallback to normal opaque material\.|
|rtx.subsurface.enableThinOpaque|bool|True|Enable thin opaque material\. The materials withthin opaque properties will fallback to normal opaque material\.|
|rtx.subsurface.enableTextureMaps|bool|True|Enable texture maps such as thickness map or scattering albedo map\. The corresponding subsurface properties will fallback to per\-material constants if this is disabled\.|
|rtx.subsurface.surfaceThicknessScale|float|1|Scalar of the subsurface thickness\.|
|rtx.taauPreset|int|1|Adjusts TAA\-U scaling factor, trades quality for performance\.|
|rtx.temporalAA.colorClampingFactor|float|1|A scalar factor to apply to the standard deviation of the neighborhood of pixels in the color signal used for clamping\. Should be in the range 0\-infinity\.<br>This value essentially represents how many standard deviations of tolerance from the current frame's colors around each pixel pixel the temporally accumulated color signal may have\.<br>Higher values will cause more ghosting whereas lower values may reduce ghosting but will impact image quality \(less ability to upscale effectively\) and reduce stability \(more jittering\)\.|
Expand Down
4 changes: 4 additions & 0 deletions documentation/FoliageSystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ User Instructions:
b. [Subsurface Measurement Distance]: The thickness of the foliage surface in the range [0, 16]. Incidence radiance is attenuated proportionally to the thickness. The unit is [mm].
c. [Subsurface Single Scattering Albedo]: The coefficient determines how much energy is scattered when trace through subsurface materials.
d. [Subsurface Volumetric Anisotropy]: The anisotropy of the scattering phase function (-1 being backscattering, 0 being isotropic, 1 being forward scattering).
4. Optional: Setup Foliage Texture Maps:
a. [Subsurface Transmittance Color Map]
b. [Subsurface Measurement Distance Map]
c. [Subsurface Single Scattering Albedo Map]

Real-time debug interface:
1. Debugging View: Enable [Is Thin Opaque](../RtxOptions.md) or [rtx.debugView.debugViewIdx = 800] to verify if thin opaque materials are correctly set up.
Expand Down
14 changes: 14 additions & 0 deletions documentation/OpacityMicromap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Opacity Micromap

Opacity Micromap (OMM) optimizes ray tracing by skipping transparent surface ray interactions due to opacity texture cutouts. OMMs encode opacity at a microtriangle level in a triangle and there can be thousands of microtriangles generated per a triangle. This is similar to many texels from a texture being applied to a triangle. OMMs need to be pre-built for a triangle and are encoded during a bottom level acceleration structure (BLAS) construction for a GPU driver to use during ray tracing. Any transparent parts of the surface due to opacity texture and/or texture and vertex blending will be skipped by the driver. Without OMMs such hits would be returned as opaque hits to the ray tracing shader code and depend on the ray tracer to resolve the opacity and skip the hit, returning the execution to continue ray tracing to the driver. OMMs avoid this unnecessary roundtrip altogether and, thus, provide a performance speed up. In cases, where there is a lot of triangles with opacity cutouts and, especially, with multiple layers of such geometry (i.e. for fences, particles, foliage, etc.) the performance uplift in Remix can be in the order of 10% or higher. While older NVIDIA architectures benefit from this feature as well, the speed ups due to OMMs is higher on Ada (40**) GPUs.

OMMs are enabled by default in Remix and generated at runtime. This can be controlled via GUI or rtx.conf parameter [rtx.opacityMicromap.enable](../RtxOptions.md). OMMs are generated at runtime at a throttled pace so as to limit amount of GPU resources being used for them. It can take several seconds to generate OMMs for a scene. OMMs require enough free VRAM to get generated and, thus, their generation is dependant on enough VRAM being available. Disabling OMMs also releases the generated OMMs. Therefore, if you want to double check performance impact ON/OFF, it is advised to simply disable OMMs being bound via [rtx.opacityMicromap.enableBinding](../RtxOptions.md) so that they are not release in the process.

To take the best advantage of OMMs, author your assets considering following:
- Make transparent regions of assets resolve to opacity of 0 (i.e. fully transparent).
- Reuse UVs across triangles so that a same OMM can apply to multiple triangles in a geometry. Repeating textures are your friend. This reduces OMM build times and runtime memory cost.
- Avoid thin triangles.
- Avoid generating triangles with very high frequency of opaque and transparent regions changing back and forth across a triangle (i.e. a mesh in a high density fence, but represented with only few triangles). In such cases, tesselate your geometry further to lower the opacity frequency within a triangle. OMMs in Remix are generated roughly at up to 256x256 microtriangles per triangle. It is important that a good portion of such microtriangles correspond to fully transparent regions. If the underlying opacity for a triangle has a higher frequency of opaque and transparent features than the 256x256 and microtriangles cover areas that are both opaque and transparent, such microtriangles will be marked as non-transparent. In that case, there will be no speed up since the geometry is essentially treated as opaque by the driver. Therefore, make sure your geometry is tessellated enough such that opaque/transparent regions appear at a frequency lower than that and, preferably, end up with multiple neighboring microtriangles falling into the same opaque/transparent category.

Caveats:
- Similar to other instance tracking cases in Remix, the runtime hashes OMM signatures and uses the hashes to differentiate among the OMMs. However, although it's rarely the case, but should two OMMs hash collide they will be treated as equal. This will result in an incorrect OMM being bound for a triangle and, thus, having wrong opacity cutouts being applied. In that case, a triangle can appear transparent in areas where it should be opaque. If that happens, tag such texture as [rtx.opacityMicromapIgnoreTextures](../RtxOptions.md) to avoid generating OMMs for them and report this as an issue on github.
2 changes: 1 addition & 1 deletion dxvk.conf
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ d3d9.adapterOverride = 0
# Supported values:
# - True/False

# d3d9.floatEmulation =
# d3d9.floatEmulation = Auto


# Enable dialog box mode
Expand Down
7 changes: 7 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ if not dxvk_is_msvc
endif
endif

remix_api_include_path = include_directories('./public/include')
add_global_arguments('/DREMIX_LIBRARY_EXPORTS=1', language : 'cpp')

dxvk_include_dirs = [
'./include',
'./include/vulkan/include'
Expand Down Expand Up @@ -391,6 +394,10 @@ boost_include_path = include_directories('external/nv_usd/include/boost-1_78/')

usd_include_paths = [nv_usd_include_path, boost_include_path]

vk_include_path = include_directories('./include/vulkan/include')

lssusd_include_paths = [nv_usd_include_path, boost_include_path, vk_include_path]

nvapi_include_paths = include_directories(join_paths(meson.global_source_root(), 'external/nvapi'))
nvapi_lib_path = join_paths(meson.global_source_root(), 'external/nvapi/amd64')
nvapi_lib = dxvk_compiler.find_library('nvapi64', dirs : nvapi_lib_path)
Expand Down
4 changes: 2 additions & 2 deletions packman-external.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<package name="rtx-remix-nv_usd" version="5" />
</dependency>
<dependency name="omni_core_materials" linkPath="external/omni_core_materials">
<package name="rtx-remix-omni_core_materials" version="6" />
<package name="rtx-remix-omni_core_materials" version="9" />
</dependency>
<dependency name="reflex" linkPath="external/reflex">
<package name="rtx-remix-reflex" version="1" />
Expand All @@ -41,6 +41,6 @@
<package name="ngx_sdk_dlss" version="dlss_0602_2" />
</dependency>
<dependency name="ngx_sdk_dlfg" linkPath="external/ngx_sdk_dlfg">
<package name="ngx_sdk_dlfg" version="dlfg_0602_2" />
<package name="rtx-remix-ngx_sdk_dlfg" version="1" />
</dependency>
</project>
Loading

0 comments on commit ee334a5

Please sign in to comment.