Skip to content

Commit f203dc5

Browse files
committed
Merge branch 'Dev'
2 parents 2ff8d9b + 0680e70 commit f203dc5

34 files changed

+1601
-1596
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
![](/.Images/Yanus1.png)
44
### 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
55
# Discord Server: https://discord.gg/4Yh7AZuhcD
6-
## Demo: https://drive.google.com/file/d/1sb_zRycX23AlC3QQ9LfqrtEZzBj47Z-Y/view?usp=sharing
6+
## Demo: https://drive.google.com/file/d/1moYUEW5wUuqavgsFLSbgZLzVnMvBjBnl/view?usp=sharing
77

88

99

@@ -68,6 +68,10 @@ for bringing bindless textures to unity!
6868
### If you like what I do and want to support me or this project, Please consider becoming a Github Sponsor or a Patron at patreon.com/Pjbomb2! This allows me to keep this free for everyone!
6969
### You can contact me easiest through my discord server(above) or my [twitter](https://x.com/Pjbomb2) with bugs, ideas, or thoughts on the project!
7070

71+
## First Install Note
72+
<ul>
73+
<li>After you first install TrueTrace, you will need to restart the unity project this one time, so that the bindless plugin can initialize properly.</li>
74+
</ul>
7175

7276
## Adding new objects
7377
### Automatic methods

TrueTrace.unitypackage

-1.18 KB
Binary file not shown.

TrueTrace/DemoScene.asset

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ MonoBehaviour:
1919
UseRussianRoulette: 1
2020
UseNEE: 1
2121
DoTLASUpdates: 1
22-
Accumulate: 1
22+
Accumulate: 0
2323
PPBloom: 0
2424
BloomStrength: 0.5
2525
PPDoF: 0
@@ -31,11 +31,11 @@ MonoBehaviour:
3131
PPToneMap: 1
3232
PPTAA: 0
3333
RenderScale: 1
34-
DenoiserMethod: 1
34+
DenoiserMethod: 0
3535
UpscalerMethod: 0
3636
UseReSTIRGITemporal: 1
3737
UseReSTIRGISpatial: 1
38-
UseReSTIRGI: 0
38+
UseReSTIRGI: 1
3939
ReSTIRGITemporalMCap: 4
4040
DoReSTIRGIConnectionValidation: 1
4141
Exposure: 50
@@ -108,3 +108,4 @@ MonoBehaviour:
108108
PhotonGuidingRatio: 0.15
109109
PhotonGuidingPerLightGuidingResolution: 128
110110
PhotonGuidingTotalPhotonsPerFrame: 2000000
111+
RadCacheToggle: 0

TrueTrace/DemoScene.unity

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12853,9 +12853,9 @@ MonoBehaviour:
1285312853
Pad1: 0
1285412854
left: 2
1285512855
isLeaf: 0
12856+
NodeCount: 0
1285612857
SGTree: []
1285712858
PrimCount: 768
12858-
FinalIndices:
1285912859
MaxDepth: 12
1286012860
ParentList: []
1286112861
ZeroBound:
@@ -12972,7 +12972,7 @@ MonoBehaviour:
1297212972
LightBLASCopyKernel: 8
1297312973
CompactedMeshData: 0
1297412974
InstanceReferences: 0
12975-
NeedsToUpdate: 0
12975+
NeedsToUpdate: 1
1297612976
FailureCount: 0
1297712977
TotalTriangles: 0
1297812978
IsSkinnedGroup: 0
@@ -38148,7 +38148,7 @@ MonoBehaviour:
3814838148
m_Script: {fileID: 11500000, guid: e9c10216ea5531c4d82893474778943b, type: 3}
3814938149
m_Name:
3815038150
m_EditorClassIdentifier:
38151-
EnableDebugTexture: 0
38151+
EnableDebugTexture: 1
3815238152
EnableDebugTexturePrev: 0
3815338153
LocalTTSettingsName: DemoSceneMain
3815438154
HDRPorURPRenderInScene: 0
@@ -38216,6 +38216,7 @@ MonoBehaviour:
3821638216
IsFocusing: 0
3821738217
IsFocusingDelta: 0
3821838218
AGXCustomTex: {fileID: 0}
38219+
RaycastSelectedIndex: -1
3821938220
_currentSample: 0
3822038221
CurrentHorizonalPatch: {x: 0, y: 0}
3822138222
FramesSinceStart2: 0
@@ -38266,12 +38267,11 @@ MonoBehaviour:
3826638267
RenderTransforms: []
3826738268
RenderQue: []
3826838269
BuildQue:
38269-
- {fileID: 499686671}
38270-
- {fileID: 1770588100}
38271-
- {fileID: 1931085300}
38270+
- {fileID: 0}
3827238271
AddQue: []
3827338272
RemoveQue: []
38274-
UpdateQue: []
38273+
UpdateQue:
38274+
- {fileID: 0}
3827538275
InstanceRenderQue: []
3827638276
InstanceUpdateQue: []
3827738277
InstanceRenderTransforms: []
@@ -47618,9 +47618,9 @@ MonoBehaviour:
4761847618
Pad1: 0
4761947619
left: 2
4762047620
isLeaf: 0
47621+
NodeCount: 0
4762147622
SGTree: []
4762247623
PrimCount: 4864
47623-
FinalIndices:
4762447624
MaxDepth: 18
4762547625
ParentList: []
4762647626
ZeroBound:
@@ -47644,7 +47644,7 @@ MonoBehaviour:
4764447644
cosTheta_oe: 0
4764547645
left: 0
4764647646
ExistsInQue: 1
47647-
QueInProgress: 1
47647+
QueInProgress: 2
4764847648
RenderImposters: 0
4764947649
IsDeformable: 0
4765047650
Name: sponza
@@ -55315,11 +55315,11 @@ MonoBehaviour:
5531555315
ConstructKernel: 0
5531655316
RefitLayerKernel: 1
5531755317
UpdateGlobalBufferAABBKernel: 3
55318-
LightBLASRefitKernel: 6
55319-
LightBLASCopyKernel: 8
55318+
LightBLASRefitKernel: 5
55319+
LightBLASCopyKernel: 6
5532055320
CompactedMeshData: 0
5532155321
InstanceReferences: 0
55322-
NeedsToUpdate: 0
55322+
NeedsToUpdate: 1
5532355323
FailureCount: 0
5532455324
TotalTriangles: 0
5532555325
IsSkinnedGroup: 0
@@ -61809,9 +61809,9 @@ MonoBehaviour:
6180961809
Pad1: 0
6181061810
left: 0
6181161811
isLeaf: 0
61812+
NodeCount: 0
6181261813
SGTree: []
6181361814
PrimCount: 0
61814-
FinalIndices:
6181561815
MaxDepth: 0
6181661816
ParentList: []
6181761817
ZeroBound:
@@ -61928,7 +61928,7 @@ MonoBehaviour:
6192861928
LightBLASCopyKernel: 8
6192961929
CompactedMeshData: 3
6193061930
InstanceReferences: 0
61931-
NeedsToUpdate: 0
61931+
NeedsToUpdate: 1
6193261932
FailureCount: 0
6193361933
TotalTriangles: 0
6193461934
IsSkinnedGroup: 0

TrueTrace/Editor/PathTracerSettings.cs

Lines changed: 181 additions & 36 deletions
Large diffs are not rendered by default.

TrueTrace/Editor/RayTracingObjectEditor.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,17 @@ public void CopyFunction(RayTracingObject ThisOBJ, int SaveIndex) {
549549
string FolderName = "COPYPASTEBUFFER";
550550
string PresetName = "COPYPASTEBUFFER";
551551
UnityEditor.AssetDatabase.Refresh();
552+
if(RayMaster.LocalTTSettings.CurrentTargetFile == "") {
553+
string TempFilePath = TTPathFinder.GetMaterialPresetsPath();
554+
var info = new DirectoryInfo(TempFilePath);
555+
var fileInfo = info.GetFiles();
556+
for(int i = 0; i < fileInfo.Length; i++) {
557+
if(!fileInfo[i].Name.Contains(".xml.meta") && fileInfo[i].Name.Contains(".xml")) {
558+
RayMaster.LocalTTSettings.CurrentTargetFile = TempFilePath + fileInfo[i].Name;
559+
break;
560+
}
561+
}
562+
}
552563
using (var A = new StringReader(Resources.Load<TextAsset>("Utility/MaterialPresets/" + RayMaster.LocalTTSettings.CurrentTargetFile.Substring(RayMaster.LocalTTSettings.CurrentTargetFile.LastIndexOf("/") + 1).Replace(".xml", "")).text)) {
553564
var serializer = new XmlSerializer(typeof(RayObjFolderMaster));
554565
PresetMaster = serializer.Deserialize(A) as RayObjFolderMaster;
@@ -1109,7 +1120,7 @@ public override void OnInspectorGUI() {
11091120
ConnectionSources.Add("Smoothness", GUILayoutUtility.GetLastRect()); // Store position
11101121
ConnectionSourceNames.Add("Smoothness");
11111122
Flag = CommonFunctions.SetFlagVar(Flag, CommonFunctions.Flags.InvertSmoothnessTexture, EditorGUILayout.ToggleLeft("Invert Roughness Tex", Flag.GetFlag(CommonFunctions.Flags.InvertSmoothnessTexture), GUILayout.MaxWidth(135)));
1112-
Flag = CommonFunctions.SetFlagVar(Flag, CommonFunctions.Flags.ShadowCaster, EditorGUILayout.ToggleLeft("Casts Shadows", Flag.GetFlag(CommonFunctions.Flags.ShadowCaster), GUILayout.MaxWidth(135)));
1123+
Flag = CommonFunctions.SetFlagVar(Flag, CommonFunctions.Flags.ShadowCaster, !EditorGUILayout.ToggleLeft("Casts Shadows", !Flag.GetFlag(CommonFunctions.Flags.ShadowCaster), GUILayout.MaxWidth(135)));
11131124
Flag = CommonFunctions.SetFlagVar(Flag, CommonFunctions.Flags.UseVertexColors, EditorGUILayout.ToggleLeft("Vertex Colors", Flag.GetFlag(CommonFunctions.Flags.UseVertexColors), GUILayout.MaxWidth(135)));
11141125
EditorGUILayout.EndHorizontal();
11151126
EditorGUILayout.BeginHorizontal();

TrueTrace/Editor/TrueTraceEditor.asmdef

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"rootNamespace": "",
44
"references": [
55
"GUID:ed514bd980ff3ea46904db26e115c21d",
6-
"GUID:457756d89b35d2941b3e7b37b4ece6f1"
6+
"GUID:457756d89b35d2941b3e7b37b4ece6f1",
7+
"GUID:75469ad4d38634e559750d17036d5f7c"
78
],
89
"includePlatforms": [],
910
"excludePlatforms": [],

TrueTrace/GettingStarted.txt

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ For more in depth/full details, go to the Readme on the Truetrace Github(at leas
33

44

55
To get started:
6-
1. After importing the unity package, for a new scene you want to open the PathTracer tab on the top bar, and click "Arrange Hierarchy"
7-
2. After doing this, your scene should now be in the format required by the path tracer
8-
3. Now you can click "Build Aggregated BVH" to build the acceleration structure for all objects, and just wait for the "Remaining Objects" to turn green before entering play mode(this can be ignored if wanted)
9-
4. After that is done, you can just enter play mode and play as normal
6+
1. First, import the unity package. After doing this you will need to restart unity this one time, so that the bindless plugin initialized properly.
7+
2. After restarting, for a new scene you want to open the PathTracer tab on the top bar, and click "Arrange Hierarchy"
8+
3. After doing this, your scene should now be in the format required by the path tracer
9+
4. Now you can click "Build Aggregated BVH" to build the acceleration structure for all objects, and just wait for the "Remaining Objects" to turn green before entering play mode(this can be ignored if wanted)
10+
5. After that is done, you can just enter play mode and play as normal
1011

1112

1213
Adding new objects
@@ -27,6 +28,16 @@ Adding new objects
2728
Any parent gameobject of the RayTracingObjects(will group together all Skinned Children)
2829
For default unity lights, you just add the "RayTracingLight" script to each one
2930

31+
32+
What to do if your scene is all white/textures dont load:
33+
This is due to truetrace not recognizing the shader used by your materials. Thus, to fix this you will have to tell truetrace what each texture represents(I promise its not hard, and no there's no way to automate it).
34+
1. First, open up the truetrace settings menu and navigate to the "Material Pair Options" tab.
35+
2. You will see a slot at the top for a material. Drag ANY material that uses the unrecognized shader into this slot(This will all only need to be done once per shader, NOT per material, but doing it with a material this way lets me display textures nicely).
36+
3. After this, you will see an output block with a lot of plugs. You dont need to fill these all out, only what you want truetrace to use.
37+
4. At the top left, there will be 3 buttons, one for adding texture nodes, one for adding color nodes, and one for adding float nodes. Clicking these will spawn their respective node, and will serve as inputs to the Output node via the plugs.
38+
5. Simply drag the plugs from the input to the output, note that each output plug needs a unique input node(but these unique nodes can use the same texture/source, we just cant have a single input node directly point to 2 output plugs).
39+
6. After you have set up the plugs you want, just click "Apply Material Links" at the top, and rebuild the aggregated BVH to display the changes.
40+
3041
General Use/Notes
3142
DX12 is recommended, as it enables use of OIDN, Bindless texturing, RT Cores, and slightly higher performance
3243
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)

0 commit comments

Comments
 (0)