Skip to content

Commit 87fb784

Browse files
committed
Large cleanup and perf improvements
Fixed emissive objects with uneven scales Large improvements to materials Decent performance improvements Using SEGIs upscaler now Texture UVs are fixed Fixed ASVGF for mirrors Added a ding that plays when BVH build is complete for builds that take longer than 15 seconds Improved ReSTIR GI for glass Improved SVGF Fixed Emissive Video Players Renamed "Upscaling Ratio" to "Internal Resolution Ratio" Fixed swapping scenes Large cleanup on several compute shaders improved RIS estimator for lights Terrain is now smooth Fixed NEE and cutout objects with Hardware RT ReCUR can now use ReSTIR GIs gradients Replaced emission texture handling Lower end devices should no longer need to reduce the atmospheric scattering samples hopefully ReSTIR GI now does much better for specular dark objects Re-implemented ASMDF files Bloom now works in DX11
1 parent ae89371 commit 87fb784

Some content is hidden

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

52 files changed

+6627
-2960
lines changed

README.md

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ Notes:</br>
88
A passion projects that has been going on for a while with the goal of bringing at least interactive path-tracing to everyone in unity, regardless of their hardware
99
## Features:
1010
<ul>
11-
<li>Fast Compute Shader based path tracing</li>
12-
<li>Disney BSDF for materials with support for emissive meshes and Video Players</li>
11+
<li>Fast Compute Shader based path tracing without RT cores</li>
12+
<li>Full Disney BSDF for materials with support for emissive meshes and Video Players</li>
1313
<li>Ability to move, add, and remove objects during play</li>
1414
<li>Ability to update material properties on the fly during play</li>
1515
<li>ASVGF, SVGF, and my own Recurrent Denoisers</li>
1616
<li>Compressed Wide Bounding Volume Hierarchy as the Acceleration Structure (See Ylitie et al. 2017 below)</li>
1717
<li>PBR Texture Support</li>
1818
<li>Next Event Estimation with Multiple Importance Sampling for Explicit Light Sampling</li>
1919
<li>Support for all default unity lights, which interact via NEE</li>
20-
<li>Bloom, Depth of Field, AutoExposure, TAA, Tonemappiong</li>
20+
<li>Bloom, Depth of Field, AutoExposure, TAA, Tonemapping</li>
2121
<li>No specific GPU vendor needed(this will run on integrated graphics if you so wish it, aka no RTX cores needed)</li>
2222
<li>Precomputed Multiple Atmospheric Scattering for dynamic and realtime sky(from ebruneton below)</li>
2323
<li>Object Instancing</li>
2424
<li>ReSTIR GI for faster convergence in complex scenes and more complete images in scenes with changing lighting</li>
25-
<li>Simple upscaling ability for performance increase</li>
25+
<li>Simple upscaling ability</li>
2626
<li>Hardware RT Support for modern cards</li>
2727
<li>Supports Built-in, HDRP, and URP</li>
2828
<li>Full skinned mesh support for animated skinned meshes</li>
@@ -43,14 +43,12 @@ Let me know if you use this for anything, I would be excited to see any use of t
4343
# Instructions:
4444
## Required Settings Changes:
4545
<ul>
46-
<li>Set the Color Space to Linear through Edit Tab(Top Left) -> Project Settings -> Player -> Other Settings -> Color Space, and change from Gamma to Linear</li>
47-
<li>Enable Unsafe Code(Its for memory management) through Edit -> Project Settings -> Player -> Other Settings -> "Allow 'unsafe' Code" (near the bottom)</li>
4846
<li>Change the Graphics Api for Windows to DirectX12 through Edit Tab(Top Left) -> Project Settings -> Player -> Other Settings -> Untoggle "Auto Graphics API For Windows", then click the little + that appears, select "Direct3D12(Experimental)", and drag that to the top. A restart of the editor is required</li>
4947
<li>Your target camera NEEDS to be deferred</li>
5048
</ul>
5149

5250
## Controls:
53-
Camera Controls: WASD, Mouse, and press T to freeze/unfreeze the camera(Camera starts frozen), and shift increases speed
51+
Camera Controls: WASD, Mouse, hold right click rotate the camera, and shift increases speed
5452

5553
## General Setup
5654
<ul>
@@ -69,7 +67,7 @@ Camera Controls: WASD, Mouse, and press T to freeze/unfreeze the camera(Camera s
6967
## General Use/Notes
7068
<ul>
7169
<li>The camera you want to render from, you attach the RenderHandler script to(if you have a camera tagged MainCamera, this will be done automatically)</li>
72-
<li>The green/red rectangle shows when the acceleration structure is done building, and thus ready to render, red means that its not done, and green means its done building</li>
70+
<li>The green/red rectangle shows when the acceleration structure is done building, and thus ready to render, red means that its not done, and green means its done building, a ding will sound when it completes if it takes longer than 15 seconds</li>
7371
<li>Objects can be added and removed at will simply by toggling the associated GameObject with a ParentObject script on/off in the hierarchy(clicking on parent objects with complex objects for children will lag), but they will take time to appear as the acceleration structure needs to be rebuilt for them</li>
7472
<li>Emissive meshes need to be emissive when you build the hierarchy to work with NEE, and can have their emissiveness at will</li>
7573
<li>If you use normal maps, they need to be in unity normal map format</li>
@@ -109,6 +107,12 @@ Camera Controls: WASD, Mouse, and press T to freeze/unfreeze the camera(Camera s
109107
<li>Then just use like normal, but this does not support Instances</li>
110108
</ul>
111109

110+
## Using DX11 Only
111+
<ul>
112+
<li>In the TrueTrace settings menu, click on the top right button "Functionality Settings" and toggle "Use DX11"</li>
113+
<li>Uncomment the "#define DX11" in: TrueTrace -> Resources -> GlobalDefines.cginc</li>
114+
</ul>
115+
112116
## Editor Window Guide
113117
BVH Options Description -
114118
<ul>
@@ -120,36 +124,37 @@ BVH Options Description -
120124
<li>Force Instances - Looks at all meshes in the scene, sees what objects have the same meshes, and makes them into instances, keep in mind instances use the same material and textures</li>
121125
<li>Remaining Objects - Objects still being processed</li>
122126
<li>Max Bounces - Sets the maximum number of bounces a ray can achieve</li>
123-
<li>Render Scale - Render scale in comparison to gameview size, turn to below 1 while in edit mode to decrease rendered resolution(to then be upscaled)</li>
127+
<li>Internal Resolution Ratio - Render scale in comparison to gameview size, turn to below 1 while in edit mode to decrease rendered resolution(to then be upscaled)</li>
124128
<li>Atlas Size - Maximum size of the texture atlas used(All textures are packed into atlas's so I can send them to the GPU)</li>
125129
<li>Use Russian Roulette - Highly recommended to leave this on, kills rays that may not contribute much early, and thus greatly increases performance</li>
126130
<li>Enable Object Moving - Allows objects to be moved during play, and allows for added objects to spawn in when they are done building</li>
127131
<li>Allow Image Accumulation - Allows the image to accumulate while the camera is not moving</li>
128132
<li>Use Next Event Estimation - Enables shadow rays/NEE for direct light sampling</li>
129133
<li>RIS Count - Number of RIS passes done for lights(select the best light out of X number of randomly selected lights)</li>
130134
<li>Allow Mesh Skinning - Turns on the ability for skinned meshes to be animated or deformed with respect to their armeture</li>
131-
<li>Denoisers -> Allows you to switch between different denoisers</li>
135+
<li>Denoiser - Allows you to switch between different denoisers</li>
132136
<li>Allow Bloom - Turns on or off Bloom</li>
133137
<li>Enable DoF - Turns on or off Depth of Field, and its associated settings</li>
134138
<li>Autofocus DoF - Sets the focal length to bring whatever is in the center of the screen into focus</li>
135-
<li>Enable Auto/Manual Exposure - Turns on or off Auto Exposure(Set all the way to left to use autoexposure)</li>
136-
<li>Use ReSTIR GI - Enables ReSTIR GI which is usually much higher quality(Does not work with ASVGF)</li>
139+
<li>Enable Auto/Manual Exposure - Turns on or off Exposure</li>
140+
<li>Use ReSTIR GI - Enables ReSTIR GI which is usually much higher quality(Works with Recur and SVGF denoisers)</li>
137141
<li>Do Sample Connection Validation - Confirms that two samples are mutually visable and throws it away if they are not</li>
138-
<li>Update Rate - How many pixels per frame get re-traced to ensure they are still valid paths(7 is a good number to aim for here)</li>
142+
<li>Update Rate - How many pixels per frame get re-traced to ensure they are still valid paths(7 or 33 is a good number to aim for here at 1080p)</li>
139143
<li>Enable Temporal - Enables the Temporal pass of ReSTIR GI(allows samples to travel across time</li>
140144
<li>Temporal M Cap - How long a sample may live for, lower means lighting updates faster(until 0 which is the opposite) but more noise(recommended either 0 or around 12, but can be played with)</li>
145+
<li>Enable Denoiser - Enables a custom denoiser that is more tuned for ReSTIR GI</li>
141146
<li>Enable Spatial - Enables the Spatial pass of ReSTIR GI(Allows pixels to choose to use the neighboring pixels sample instead)</li>
142147
<li>Spatial Sample Count - How many neighboring pixels are looked at(turn to 0 to make it adapative to sample count)</li>
143148
<li>Minimum Spatial Radius - The minimum radius the spatial pass can sample from</li>
144-
<li>Use Temporal Antialiasing - Enables Temporal Antialiasing(TAA)</li>
145-
<li>Enable Tonemapping - Turns on tonemapping</li>
149+
<li>Enable TAA - Enables Temporal Antialiasing</li>
150+
<li>Enable Tonemapping - Turns on tonemapping, and allows you to select a specific tonemapper</li>
146151
<li>Enable TAAU - Use TAAU for upscaling(if off, you use my semi custom upscaler instead)</li>
147152
<li>Use Partial Rendering - Traces only 1 out of X rays</li>
148153
<li>Use AntiFirefly - Enables RCRS filter for getting rid of those single bright pixels</li>
149154
<li>RR Ignores Primary Hit - Allows for an extra bounce basically, makes it so that dark objects arent noisier, but at the cost of performance</li>
150155
<li>Atmospheric Scatter Samples - Lower this to 1 if you keep crashing on entering play mode(controls how many atmospheric samples are precomputed)</li>
151156
<li>Current Samples - Shows how many samples have currently been accumulated</li>
152-
</ul>
157+
</ul>
153158

154159
## Materials(RayTracingObject script)
155160
<ul>
@@ -159,26 +164,24 @@ BVH Options Description -
159164
<li>Emission - The emittance of an object(how much light it gives off)</li>
160165
<li>Emission Color - Changes the color of emissive objects, most useful when you have an emission mask on an object</li>
161166
<li>Roughness - Roughness of the object</li>
167+
<li>Metallic - How metallic an object is</li>
168+
<li>IOR - Index of Refraction of an object - Affects Glass and Specular</li>
169+
<li>Specular - Adds specular reflection to an object, use in conjunction with Roughness and IOR</li>
170+
<li>Specular Tint - Weights color more towards the objects color for specular reflections</li>
171+
<li>Sheen - Adds Sheen to objects</li>
172+
<li>SheenTint - Allows you to choose if an objects sheen is white or is that objects base color</li>
173+
<li>ClearCoat - Adds a ClearCoat effect to the object</li>
174+
<li>ClearCoatGloss - Influences the ClearCoat</li>
175+
<li>Anisotropic - Makes the material anisotropic based on roughness</li>
176+
<li>SpecTrans(Glass) - Makes an object more or less like glass</li>
177+
<li>Thin - Marks an object as thin, Influences Diffuse, DiffTrans, and SpecTrans</li>
178+
<li>Diffuse Transmission - Makes an object Diffuse but Transmissive(transluscent)</li>
179+
<li>Transmission Color - Affects Diffuse Transmission color, must be greater than 0 for diffuse transmission</li>
180+
<li>Flatness - Affects Thin objects</li>
181+
<li>Scatter Distance - Affects SpecTrans and Diffuse Transmission, must be greater than 0 for Diffuse Transmission</li>
182+
<li>Propogate To Materials - Copies properties of local material to all other objects in the scene with the same material</li>
162183
</ul>
163184

164-
## Disney BSDF Only Properties
165-
<ul>
166-
<li>IOR - Index of Refraction of an object. Affects only Disney BSDF</li>
167-
<li>Metallic - How metallic an object is. Affects only Disney BSDF</li>
168-
<li>Specular - Adds specular reflection to an object, use in conjunction with Roughness and IOR. Affects only Disney BSDF</li>
169-
<li>Specular Tint - Weights color more towards the objects color for specular reflections. Affects only Disney BSDF</li>
170-
<li>Sheen - Adds Sheen to objects. Affects only Disney BSDF</li>
171-
<li>SheenTint - Allows you to choose if an objects sheen is white or is that objects base color. Affects only Disney BSDF</li>
172-
<li>ClearCoat - Adds a ClearCoat effect to the object. Affects only Disney BSDF</li>
173-
<li>ClearCoatGloss - Influences the ClearCoat. Affects only Disney BSDF</li>
174-
<li>Anisotropic - Makes the material(mostly metallic and specular) anisotropic. Affects only Disney BSDF</li>
175-
<li>Specular Transmission - Makes an object more or less like glass. Affects only Disney BSDF(Play with the IOR for this)</li>
176-
<li>Diffuse Transmission - Makes an object Diffuse but Transmissive(transluscent). Affects only Disney BSDF</li>
177-
<li>Transmission Color - doesn't do anything for now, used for volumetric disney bsdf(which is not yet implemented)</li>
178-
<li>Flatness - Affects Thin objects. Affects only Disney BSDF</li>
179-
<li>Thin - Marks an object as thin so it can be better handled by the BSDF. Affects only Disney BSDF, can be either 0 or 1</li>
180-
</ul>
181-
182185
# Known Bugs:
183186
</br>
184187
<ul>

TrueTrace.unitypackage

176 KB
Binary file not shown.

0 commit comments

Comments
 (0)