Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Sampling/Sampling.hlsl"

#include "Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/FetchGeometry.hlsl"
#include "Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/TraceRayAndQueryHit.hlsl"
#include "Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/TraceRay.hlsl"


#define DISTANCE_THRESHOLD 5e-5f
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using UnityEditor.AssetImporters;
using System.IO;

namespace UnityEditor.Rendering.UnifiedRayTracing
{
[ScriptedImporter(1, "urtshader")]
internal class UnifiedRTShaderImporter : ScriptedImporter
{
public override void OnImportAsset(AssetImportContext ctx)
{
string source = File.ReadAllText(ctx.assetPath);

var com = ShaderUtil.CreateComputeShaderAsset(ctx, computeShaderTemplate.Replace("SHADERCODE", source));
var rt = ShaderUtil.CreateRayTracingShaderAsset(ctx,
raytracingShaderTemplate.Replace("SHADERCODE", source));

ctx.AddObjectToAsset("ComputeShader", com);
ctx.AddObjectToAsset("RayTracingShader", rt);
ctx.SetMainObject(com);
}

// NOTE: The UnifiedRayTracing runtime was vendored into com.unity.render-pipelines.core
// (see "Move light transport package in urp"), so these raygen includes point at the
// vendored core location rather than the original com.unity.rendering.light-transport package.
const string computeShaderTemplate =
"#define UNIFIED_RT_BACKEND_COMPUTE\n" +
"SHADERCODE\n" +
"#include_with_pragmas \"Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/Compute/ComputeRaygenShader.hlsl\"\n";

const string raytracingShaderTemplate =
"#define UNIFIED_RT_BACKEND_HARDWARE\n" +
"SHADERCODE\n" +
"#include_with_pragmas \"Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/Hardware/HardwareRaygenShader.hlsl\"\n";
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Unity.Rendering.LightTransport.Editor",
"rootNamespace": "",
"references": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,6 @@ public void ProcessRenderer(int i)
overridenComponents |= InstanceComponentGroup.Lightmap;
}

// Scan all materials once to retrieve whether this renderer is indirect-compatible or not (and store it in the RangeKey).
var supportsIndirect = true;
for (int matIndex = 0; matIndex < materialsCount; ++matIndex)
{
if (matIndex >= submeshCount)
Expand All @@ -435,7 +433,6 @@ public void ProcessRenderer(int i)

var materialIndex = rendererData.materialIndex[materialsOffset + matIndex];
var packedMaterialData = rendererData.packedMaterialData[materialIndex];
supportsIndirect &= packedMaterialData.isIndirectSupported;
}

var rangeKey = new RangeKey
Expand All @@ -446,7 +443,7 @@ public void ProcessRenderer(int i)
shadowCastingMode = packedRendererData.shadowCastingMode,
staticShadowCaster = packedRendererData.staticShadowCaster,
rendererPriority = rendererPriority,
supportsIndirect = supportsIndirect
supportsIndirect = true, // For 6000.0, we always support indirect draw calls.
};

ref DrawRange drawRange = ref EditDrawRange(rangeKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void Load(uint resourceBitmask = (uint)ResourceType.BlueNoiseTextures)
{
if ((resourceBitmask & (uint)ResourceType.BlueNoiseTextures) != 0)
{
const string path = "Packages/com.unity.rendering.light-transport/Runtime/";
const string path = "Packages/com.unity.render-pipelines.core/Runtime/";

m_SobolScramblingTile = AssetDatabase.LoadAssetAtPath<Texture2D>(path + "Sampling/Textures/SobolBlueNoise/ScramblingTile256SPP.png");
m_SobolRankingTile = AssetDatabase.LoadAssetAtPath<Texture2D>(path + "Sampling/Textures/SobolBlueNoise/RankingTile256SPP.png");
Expand Down Expand Up @@ -66,5 +66,3 @@ public void Dispose()

}
}


Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal class RayTracingResources
#if UNITY_EDITOR
public void Load()
{
const string path = "Packages/com.unity.rendering.light-transport/Runtime/";
const string path = "Packages/com.unity.render-pipelines.core/Runtime/";

geometryPoolKernels = AssetDatabase.LoadAssetAtPath<ComputeShader>(path + "UnifiedRayTracing/Common/GeometryPool/GeometryPoolKernels.compute");
copyBuffer = AssetDatabase.LoadAssetAtPath<ComputeShader>(path + "UnifiedRayTracing/Common/Utilities/CopyBuffer.compute");
Expand All @@ -40,5 +40,3 @@ public void Load()

}
}


Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private static class Styles
SerializedProperty m_ShadowShape2DProvider;
SortingLayerDropDown m_SortingLayerDropDown;
CastingSourceDropDown m_CastingSourceDropDown;


public void OnEnable()
{
Expand Down Expand Up @@ -128,7 +128,7 @@ public override void OnInspectorGUI()

if ((ShadowCaster2D.ShadowCastingSources)m_CastingSource.intValue == ShadowCaster2D.ShadowCastingSources.ShapeEditor)
ShadowCaster2DInspectorGUI<ShadowCaster2DShadowCasterShapeTool>();
else if (EditorToolManager.IsActiveTool<ShadowCaster2DShadowCasterShapeTool>())
else if (Path2D.EditorToolManager.IsActiveTool<ShadowCaster2DShadowCasterShapeTool>())
ToolManager.RestorePreviousTool();

EditorGUILayout.PropertyField(m_ShadowShape2DProvider, Styles.shadowShape2DProvider, true);
Expand Down