Skip to content

Commit d946c03

Browse files
committed
Optimized Texture Atlasing by 50%
Optimized atlas creation by 50% Fixed ReSTIR GI for terrain Fixed metallic and roughness textures for terrain Terrain alpha blending is fixed Fixed an issue where an objects material count could be less than its subobject count Very large improvements to restir GI and its denoisers quality ReSTIR GI performance improved by about 20% Fixed TAA in HDRP Fixed Upscaler in HDRP Changed Material Mapper to display actual variable texture names instead of their ID Fixed an issue with spotlights in ReSTIR GI Reduced overall RAM and VRAM consumption Improved remeshing performance slightly Added the ability for normal meshes to be deformable Massively simplified area light sampling code Added AlphaCutoff slider to materials Improved partial rendering Fixed normal maps for restir GI denoiser Prefabs now can be set up naturally with the ParentObject/RayTracingObject scripts n the prefab itself, and its materials can be adjusted from there as well Improved restir GI + denoiser reactiveness to changing lighting You can now modify internal resolution ratio during play Update rate is no longer needed for ReSTIR GI metallics Emissive textures should no longer blur over themselves with denoisers Fixed DoF autofocus not working when targeting an emissive texture Improved anti firefly shader by making it iterative Fixed random number seeding Added a very experimental lightmap baking mode
1 parent 87fb784 commit d946c03

38 files changed

+2046956
-3098
lines changed

Images/ArchViz4.png

5.4 MB
Loading

Images/ArchViz5.png

5.3 MB
Loading

Images/CommonRender.png

19.7 MB
Loading

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Payton Leather <[email protected]>
3+
Copyright (c) 2024 Payton Leather <[email protected]>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ A passion projects that has been going on for a while with the goal of bringing
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>
29+
<li>Supports deformable standard meshes</li>
2930
</ul>
3031

3132
[Ylitie et al](https://research.nvidia.com/sites/default/files/publications/ylitie2017hpg-paper.pdf)
3233
</br>[ebruneton](https://ebruneton.github.io/precomputed_atmospheric_scattering/)
3334
</br>
3435

35-
If you have any questions, or suggestions, etc. let me know either through github issues or my twitter or my discord! I am always looking for more stuff to add, and more ways to make it more user friendly or appealing for others to use
36+
If you have any questions, or suggestions, etc. let me know either through github issues, my twitter, or my discord! I am always looking for more stuff to add, and more ways to make this project more user friendly or appealing for others to use
3637
## You can contact me easiest through my discord server(above) or my twitter(https://twitter.com/Pjbomb2)
3738

3839

@@ -44,16 +45,16 @@ Let me know if you use this for anything, I would be excited to see any use of t
4445
## Required Settings Changes:
4546
<ul>
4647
<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>
47-
<li>Your target camera NEEDS to be deferred</li>
48+
<li>Your target camera NEEDS to be deferred, this will usually be automatically done for you by TrueTrace</li>
4849
</ul>
4950

5051
## Controls:
5152
Camera Controls: WASD, Mouse, hold right click rotate the camera, and shift increases speed
5253

5354
## General Setup
5455
<ul>
55-
<li>Download and import the UnityPackage provided and open the new Pathtracer Settings at the top of the screen, and click "Arrange Hierarchy"(This WILL re-arrange your hierarchy)</li>
56-
<li>Whenever you add a new object(or tree of objects), you need to add it to under the GameObject named Scene, and its recommended you press "Auto Assign Scripts" to automatically assign the needed scripts to the new objects</li>
56+
<li>Download and import the UnityPackage provided and open the new TrueTrace Settings tab at the top of the screen, and click "Arrange Hierarchy"(This WILL re-arrange your hierarchy)</li>
57+
<li>Its recommended you press "Auto Assign Scripts" to automatically assign the needed scripts to new objects</li>
5758
</ul>
5859

5960
## Basic script structure breakdown:
@@ -69,8 +70,7 @@ Camera Controls: WASD, Mouse, hold right click rotate the camera, and shift incr
6970
<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>
7071
<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>
7172
<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>
72-
<li>Emissive meshes need to be emissive when you build the hierarchy to work with NEE, and can have their emissiveness at will</li>
73-
<li>If you use normal maps, they need to be in unity normal map format</li>
73+
<li>Emissive meshes need to be have a non-zero emissive value when they are built or rebuilt to work with NEE, but after that can have their emissiveness changed at will</li>
7474
<li>To set up PBR with the DEFAULT material, all textures go into their proper names, but Roughness goes into the Occlusion texture(This can be changed in the MaterialPairing menu)</li>
7575
<li>If you are using blendshapes to change geometry of a skinned mesh, you may need to go to the import settings of it(in the inspector), turn off Legacy Blendshape Normals, and make sure all normals are imported, not calculated, otherwise the normals for blendshapes might be wrong</li>
7676
<li>A fun thing you may want to do is go to TrueTrace -> Resources -> RenderPipelines -> RendererHandle, and uncomment the "[ImageEffectOpaque]"</li>
@@ -89,14 +89,13 @@ Camera Controls: WASD, Mouse, hold right click rotate the camera, and shift incr
8989
<li>In the PathTracingSettings, click the tab called "Material Pair Options"</li>
9090
<li>Drag any material that has the shader you want to pair into the material slot that appears</li>
9191
<li>From here, you need to select each dropdown that appears and select the property that is associated with the text to the left of the dropdown</li>
92-
<li>If the names in the dropdown make no sense, you will have to navigate to the shader itself in the inspector(select the material in the project folder, click the 3 dots in the inspector, and click select shader), this should display the names along with what they mean to unity</li>
9392
<li>Once this is done, click "Apply Material Links" and rebuild the BVH in the "Main Options" tab to update the objects in the scene</li>
9493
</ul>
9594

9695
## Using HDRP
9796
<ul>
9897
<li>Go into TrueTrace -> Resources -> GlobalDefines.cginc, and uncomment the #define HDRP</li>
99-
<li>This is used by attatching it to a custom pass, so create a new custom pass(Hierarchy -> Volume -> Custom Pass) and add the custom pass in the inspector called "HDRP Compatibility"</li>
98+
<li>Create a new custom pass(Hierarchy -> Volume -> Custom Pass) and add the custom pass in the inspector called "HDRP Compatibility"</li>
10099
</ul>
101100

102101
## Using Hardware RT
@@ -113,6 +112,16 @@ Camera Controls: WASD, Mouse, hold right click rotate the camera, and shift incr
113112
<li>Uncomment the "#define DX11" in: TrueTrace -> Resources -> GlobalDefines.cginc</li>
114113
</ul>
115114

115+
## Using Lightmapping(EXPERIMENTAL, ONLY DIFFUSE)
116+
<ul>
117+
<li>In the TrueTrace settings menu, click on the top right button "Functionality Settings" and toggle "Use TrueTrace As A Lightmapper"</li>
118+
<li>Uncomment the "#define LightMapping" in: TrueTrace -> Resources -> GlobalDefines.cginc</li>
119+
<li>Make sure the lightmapping textures for the scene already exist(you need to already have unity bake the scene once, at any quality)</li>
120+
<li>Make sure to set the Game view size to the size of the lightmapping textures(Again its very experimental)</li>
121+
<li>Under the Scene gameobject, the RayTracingMaster script, adjust the sample count you want to use for each lightmap</li>
122+
<li>Click play and run truetrace as normal, it will cycle through each lightmap and do its thing, you should use ReSTIR GI with a low temporal M</li>
123+
</ul>
124+
116125
## Editor Window Guide
117126
BVH Options Description -
118127
<ul>
@@ -179,6 +188,7 @@ BVH Options Description -
179188
<li>Transmission Color - Affects Diffuse Transmission color, must be greater than 0 for diffuse transmission</li>
180189
<li>Flatness - Affects Thin objects</li>
181190
<li>Scatter Distance - Affects SpecTrans and Diffuse Transmission, must be greater than 0 for Diffuse Transmission</li>
191+
<li>Link Mat To Unity Material - Overwrites the material properties with the properties from the material assigned to the mesh by Unity</li>
182192
<li>Propogate To Materials - Copies properties of local material to all other objects in the scene with the same material</li>
183193
</ul>
184194

@@ -191,16 +201,14 @@ BVH Options Description -
191201
# Huge thanks to these people for being sponsors/patrons:
192202
<ul>
193203
<li>MakIt3D</li>
194-
<li>Christian Wauben</li>
195-
<li>John Draisey</li>
196204
<li>Andrew Varga</li>
197205
<li>Duong Nguyen</li>
198-
<li>UnityCoder</li>
199206
<li>jhintringer</li>
200207
</ul>
201208

202209
# Sample Images(Taken from various stages of development)
203210

211+
![](/Images/CommonRender.png)
204212
![](/Images/SunTemple1.png)
205213
![](/Images/ModernBistro.png)
206214
![](/Images/SunTemple2.png)
@@ -209,6 +217,8 @@ BVH Options Description -
209217
![](/Images/ArchRender2.png)
210218
![](/Images/ArchRender3.png)
211219
![](/Images/ArchRender4.png)
220+
![](/Images/ArchViz5.png)
221+
![](/Images/ArchViz4.png)
212222
![](/Images/ArchViz3.png)
213223
![](/Images/ArchViz1.png)
214224
![](/Images/ArchViz2.png)

TrueTrace.unitypackage

4.17 MB
Binary file not shown.

0 commit comments

Comments
 (0)