Expand Up @@ -190,6 +190,10 @@ internal static HDRenderPipeline currentPipeline
// Use to detect frame changes (for accurate frame count in editor, consider using hdCamera.GetCameraFrameCount)
int m_FrameCount;

// Standard render workflow uses default render loop history channel
// User render requests can use different ones to avoid mixing history information
HDCamera.HistoryChannel m_CurrentCameraHistoryChannel = HDCamera.HistoryChannel.RenderLoopHistory;

internal GraphicsFormat GetColorBufferFormat()
{
if (CoreUtils.IsSceneFilteringEnabled())
Expand Down Expand Up @@ -2171,6 +2175,172 @@ protected override void Render(ScriptableRenderContext renderContext, Camera[] c
#endif
}


/// <summary>
/// Check whether RenderRequest type is supported
/// </summary>
/// <param name="camera"></param>
/// <param name="data"></param>
/// <typeparam name="RequestData"></typeparam>
/// <returns></returns>
protected override bool IsRenderRequestSupported<RequestData>(Camera camera, RequestData data)
{
if (data is StandardRequest)
return true;

return false;
}

// To prevent run-time alloc
static List<Camera> s_RenderRequestCamera = new List<Camera>();
static readonly AOVRequestDataCollection s_EmptyAOVRequests = new AOVRequestDataCollection(null);

/// <summary>
/// Process a render request requested by user manually through RPC RenderRequest API
/// </summary>
/// <param name="context"></param>
/// <param name="camera"></param>
/// <param name="renderRequest"></param>
/// <typeparam name="RequestData"></typeparam>
protected override void ProcessRenderRequests<RequestData>(ScriptableRenderContext context, Camera camera, RequestData renderRequest)
{
StandardRequest standardRequest = renderRequest as StandardRequest;

if(standardRequest != null)
{
//store original texture that will be temporarily switched
var originalTarget = camera.targetTexture;

RenderTexture destination = standardRequest.destination;

//don't go further if no destination texture
if(destination == null)
{
Debug.LogError("RenderRequest has no destination texture, set one before sending request");
return;
}

int mipLevel = standardRequest.mipLevel;

//if mip is 0 and target is Texture2D we can directly render to the destination
//otherwise we use a temporary texture
RenderTexture temporaryRT = null;
if(destination.dimension == TextureDimension.Tex2D && mipLevel == 0)
{
camera.targetTexture = destination;
}
else
{
RenderTextureDescriptor RTDesc = destination.descriptor;
//need to use default constructor of RenderTextureDescriptor which doesn't enable allowVerticalFlip for cubemaps.
if (destination.dimension == TextureDimension.Cube)
RTDesc = new RenderTextureDescriptor();

RTDesc.colorFormat = destination.format;
RTDesc.volumeDepth = 1;
RTDesc.msaaSamples = destination.descriptor.msaaSamples;
RTDesc.dimension = TextureDimension.Tex2D;
RTDesc.width = destination.width / (int)Math.Pow(2, mipLevel);
RTDesc.height = destination.height / (int)Math.Pow(2, mipLevel);
RTDesc.width = Mathf.Max(1, RTDesc.width);
RTDesc.height = Mathf.Max(1, RTDesc.height);

temporaryRT = RenderTexture.GetTemporary(RTDesc);

camera.targetTexture = temporaryRT;
}

HDAdditionalCameraData hdCam = null;
camera.TryGetComponent<HDAdditionalCameraData>(out hdCam);
AOVRequestDataCollection existingAOVs = null;

//temporarily disable AOV requests
if(hdCam != null)
{
existingAOVs = (AOVRequestDataCollection) hdCam.aovRequests;
hdCam.SetAOVRequests(s_EmptyAOVRequests);
}

//Next render call will create/use a HDCamera with a specific history channel different from main render loop one
//doing so, we can differentiate and preserve camera history buffers/data
m_CurrentCameraHistoryChannel = HDCamera.HistoryChannel.CustomUserHistory0;

s_RenderRequestCamera.Clear();
s_RenderRequestCamera.Add(camera);
//trigger whole render pipeline
Render(context, s_RenderRequestCamera);

m_CurrentCameraHistoryChannel = HDCamera.HistoryChannel.RenderLoopHistory;

//re-enable any AOV request
if(existingAOVs != null)
{
hdCam.SetAOVRequests(existingAOVs);
}

if(temporaryRT)
{
bool isCopySupported = false;

int slice = standardRequest.slice;
int face = (int)standardRequest.face;

switch(destination.dimension)
{
case TextureDimension.Tex2D:
if((SystemInfo.copyTextureSupport & CopyTextureSupport.Basic) != 0)
{
isCopySupported = true;
Graphics.CopyTexture(temporaryRT, 0, 0, destination, 0, mipLevel);
}
break;
case TextureDimension.Tex2DArray:
if((SystemInfo.copyTextureSupport & CopyTextureSupport.DifferentTypes) != 0)
{
isCopySupported = true;
Graphics.CopyTexture(temporaryRT, 0, 0, destination, slice, mipLevel);
}
break;
case TextureDimension.Tex3D:
if((SystemInfo.copyTextureSupport & CopyTextureSupport.DifferentTypes) != 0)
{
isCopySupported = true;
Graphics.CopyTexture(temporaryRT, 0, 0, destination, slice, mipLevel);
}
break;
case TextureDimension.Cube:
if((SystemInfo.copyTextureSupport & CopyTextureSupport.DifferentTypes) != 0)
{
isCopySupported = true;
Graphics.CopyTexture(temporaryRT, 0, 0, destination, face, mipLevel);
}
break;
case TextureDimension.CubeArray:
if((SystemInfo.copyTextureSupport & CopyTextureSupport.DifferentTypes) != 0)
{
isCopySupported = true;
Graphics.CopyTexture(temporaryRT, 0, 0, destination, face + slice * 6, mipLevel);
}
break;
default:
break;
}

if(!isCopySupported)
Debug.LogError("RenderRequest cannot have destination texture of this format: " + Enum.GetName(typeof(TextureDimension), destination.dimension));
}

//restore original target
camera.targetTexture = originalTarget;
Graphics.SetRenderTarget(originalTarget);
RenderTexture.ReleaseTemporary(temporaryRT);
}
else
{
Debug.LogWarning("RenderRequest type: " + typeof(RequestData).FullName + " is either invalid or unsupported by HDRP");
}
}

void CollectScreenSpaceShadowData()
{
// For every unique light that has been registered, make sure it is kept track of
Expand Down Expand Up @@ -2477,7 +2647,7 @@ void InitializeGlobalResources(ScriptableRenderContext renderContext)
currentFrameSettings.SetEnabled(FrameSettingsField.TransparentsWriteMotionVector, false);
}

hdCamera = HDCamera.GetOrCreate(camera, xrPass.multipassId);
hdCamera = HDCamera.GetOrCreate(camera, xrPass.multipassId, m_CurrentCameraHistoryChannel);

//Forcefully disable antialiasing if DLSS is enabled.
if (additionalCameraData != null)
Expand Down
Expand Up @@ -475,12 +475,20 @@ protected override void ProcessRenderRequests<RequestData>(ScriptableRenderConte
if(standardRequest != null || singleRequest != null)
{
RenderTexture destination = standardRequest != null ? standardRequest.destination : singleRequest.destination;

//don't go further if no destination texture
if(destination == null)
{
Debug.LogError("RenderRequest has no destination texture, set one before sending request");
return;
}

int mipLevel = standardRequest != null ? standardRequest.mipLevel : singleRequest.mipLevel;
int slice = standardRequest != null ? standardRequest.slice : singleRequest.slice;
int face = standardRequest != null ? (int)standardRequest.face : (int)singleRequest.face;

//store data that will be changed
var orignalTarget = camera.targetTexture;
var originalTarget = camera.targetTexture;

//set data
RenderTexture temporaryRT = null;
Expand Down Expand Up @@ -517,28 +525,61 @@ protected override void ProcessRenderRequests<RequestData>(ScriptableRenderConte

if(temporaryRT)
{
bool isCopySupported = false;

switch(destination.dimension)
{
case TextureDimension.Tex2D:
if((SystemInfo.copyTextureSupport & CopyTextureSupport.Basic) != 0)
{
isCopySupported = true;
Graphics.CopyTexture(temporaryRT, 0, 0, destination, 0, mipLevel);
}
break;
case TextureDimension.Tex2DArray:
if((SystemInfo.copyTextureSupport & CopyTextureSupport.DifferentTypes) != 0)
{
isCopySupported = true;
Graphics.CopyTexture(temporaryRT, 0, 0, destination, slice, mipLevel);
}
break;
case TextureDimension.Tex3D:
Graphics.CopyTexture(temporaryRT, 0, 0, destination, slice, mipLevel);
if((SystemInfo.copyTextureSupport & CopyTextureSupport.DifferentTypes) != 0)
{
isCopySupported = true;
Graphics.CopyTexture(temporaryRT, 0, 0, destination, slice, mipLevel);
}
break;
case TextureDimension.Cube:
if((SystemInfo.copyTextureSupport & CopyTextureSupport.DifferentTypes) != 0)
{
isCopySupported = true;
Graphics.CopyTexture(temporaryRT, 0, 0, destination, face, mipLevel);
}
break;
case TextureDimension.CubeArray:
Graphics.CopyTexture(temporaryRT, 0, 0, destination, face + slice * 6, mipLevel);
if((SystemInfo.copyTextureSupport & CopyTextureSupport.DifferentTypes) != 0)
{
isCopySupported = true;
Graphics.CopyTexture(temporaryRT, 0, 0, destination, face + slice * 6, mipLevel);
}
break;
default:
break;
}

if(!isCopySupported)
Debug.LogError("RenderRequest cannot have destination texture of this format: " + Enum.GetName(typeof(TextureDimension), destination.dimension));
}

//restore data
camera.targetTexture = orignalTarget;
Graphics.SetRenderTarget(orignalTarget);
camera.targetTexture = originalTarget;
Graphics.SetRenderTarget(originalTarget);
RenderTexture.ReleaseTemporary(temporaryRT);
}
else
{
Debug.LogWarning("The given RenderRequest type: " + typeof(RequestData).FullName + ", is either invalid or unsupported by the current pipeline");
Debug.LogWarning("RenderRequest type: " + typeof(RequestData).FullName + " is either invalid or unsupported by the current pipeline");
}
}

Expand Down
@@ -0,0 +1,116 @@
using System;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using Object = UnityEngine.Object;
using System.Text.RegularExpressions;

// Unit tests to check parts of the RenderRequest API not generating any graphics output
// Rest of the API is tested in Scenes/9x_Other/9960-RPCRenderRequest integration test
class UserRenderRequestTests
{
GameObject m_Obj;
Camera m_Camera;

/// <summary>
/// Data structure describing the data for a NON supported render request
/// </summary>
public class NonSupportedRequest
{
public RenderTexture destination = null;
public int mipLevel = 0;
public CubemapFace face = CubemapFace.Unknown;
public int slice = 0;
}

[SetUp]
public void Setup()
{
m_Obj = new GameObject();
m_Camera = m_Obj.AddComponent<Camera>();
m_Obj.AddComponent<HDAdditionalCameraData>();

// Create main render loop history
HDCamera.GetOrCreate(m_Camera);

// Creating all user history channels
for(HDCamera.HistoryChannel channel = HDCamera.HistoryChannel.CustomUserHistory0; channel <= HDCamera.HistoryChannel.CustomUserHistory7; ++channel)
{
HDCamera.HistoryChannel newGeneratedChannel = HDCamera.GetFreeUserHistoryChannel(m_Camera);
HDCamera.GetOrCreate(m_Camera, 0, newGeneratedChannel);
Assert.IsTrue(newGeneratedChannel == channel);
}
}

[TearDown]
public void Cleanup()
{
Object.DestroyImmediate(m_Obj);
m_Obj = null;
m_Camera = null;
}

[Test, Description("Given a HDRP render pipeline, when checking its render request support, then we see that only Standard Request is supported")]
public void CheckRenderRequestSupport()
{
RenderPipeline.StandardRequest request = new RenderPipeline.StandardRequest();
Assert.IsTrue(RenderPipeline.SupportsRenderRequest(m_Camera, request));

NonSupportedRequest nonSupportedRequest = new NonSupportedRequest();
Assert.IsFalse(RenderPipeline.SupportsRenderRequest(m_Camera, nonSupportedRequest));
}

// History Channel API is only for internal use for now, to be publicly available when implemented in SRP Core
[Test, Description("Given a camera with all history channels generated, when checking if they exist, then the channels are found")]
public void CheckExistingHistoryChannels()
{
// All history channels should have been created at Setup (user ones + main render loop)
for(HDCamera.HistoryChannel channel = HDCamera.HistoryChannel.CustomUserHistory0; channel <= HDCamera.HistoryChannel.RenderLoopHistory; ++channel)
{
Assert.IsTrue(HDCamera.IsHistoryChannelExisting(m_Camera, 0, channel));
}
}

[Test, Description("Given a camera with all history channels generated, when trying to create a new user history channel, then an exception is thrown")]
public void ThrowWhenTryingToCreateExtraUserHistoryChannel()
{
// No more available channel, all created at Setup, function will throw an exception
Assert.Throws<Exception>(() => HDCamera.GetFreeUserHistoryChannel(m_Camera));
}

[Test, Description("Given a camera with all history channels generated, when deleting a specific user history channel, then the user channel is deleted")]
public void FreeSpecificHistoryChannel()
{
// Clearing user channels one by one
for(HDCamera.HistoryChannel channel = HDCamera.HistoryChannel.CustomUserHistory0; channel <= HDCamera.HistoryChannel.CustomUserHistory7; ++channel)
{
Assert.IsTrue(HDCamera.FreeUserHistoryChannel(m_Camera, 0, channel));
// Can't free channel again, already gone
Assert.IsFalse(HDCamera.FreeUserHistoryChannel(m_Camera, 0, channel));
}

// Can never free main render loop history
Assert.IsFalse(HDCamera.FreeUserHistoryChannel(m_Camera, 0, HDCamera.HistoryChannel.RenderLoopHistory));
}

[Test, Description("Given a camera with all history channels generated, when trying to delete all user history channels, then all user channels are deleted")]
public void FreeAllHistoryChannels()
{
// Clearing all user history channels at once
HDCamera.FreeAllUserHistoryChannels(m_Camera);

// Making sure all user history channels are gone
for(HDCamera.HistoryChannel channel = HDCamera.HistoryChannel.CustomUserHistory0; channel <= HDCamera.HistoryChannel.CustomUserHistory7; ++channel)
{
Assert.IsFalse(HDCamera.IsHistoryChannelExisting(m_Camera, 0, channel));
}

// Can never free main render loop history
Assert.IsTrue(HDCamera.IsHistoryChannelExisting(m_Camera, 0, HDCamera.HistoryChannel.RenderLoopHistory));
}
}

Large diffs are not rendered by default.

@@ -0,0 +1,39 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: CubeTarget
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_IsAlphaChannelOptional: 0
serializedVersion: 5
m_Width: 256
m_Height: 256
m_AntiAliasing: 1
m_MipCount: -1
m_DepthStencilFormat: 0
m_ColorFormat: 8
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 4
m_VolumeDepth: 1
m_ShadowSamplingMode: 2
@@ -0,0 +1,136 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-6857844957278198841
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 13
hdPluginSubTargetMaterialVersions:
m_Keys: []
m_Values:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: 2DArrayMaterial
m_Shader: {fileID: -6465566751694194690, guid: 2f3133a777ef57245bc0b7b9856963be,
type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _DISABLE_SSR_TRANSPARENT
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2225
stringTagMap:
MotionVector: User
disabledShaderPasses:
- TransparentDepthPrepass
- TransparentDepthPostpass
- TransparentBackface
- RayTracingPrepass
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _Texture2D_Array:
m_Texture: {fileID: 8400000, guid: 4f23887bfac34674bac778e33c332f23, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaCutoffEnable: 0
- _AlphaDstBlend: 0
- _AlphaSrcBlend: 1
- _BlendMode: 0
- _ConservativeDepthOffsetEnable: 0
- _CullMode: 2
- _CullModeForward: 2
- _DepthOffsetEnable: 0
- _DoubleSidedEnable: 0
- _DoubleSidedGIMode: 0
- _DoubleSidedNormalMode: 2
- _DstBlend: 0
- _EnableBlendModePreserveSpecularLighting: 1
- _EnableFogOnTransparent: 1
- _MaterialID: 1
- _MaterialTypeMask: 2
- _OpaqueCullMode: 2
- _QueueControl: 0
- _QueueOffset: 0
- _RayTracing: 0
- _ReceivesSSR: 1
- _ReceivesSSRTransparent: 0
- _RefractionModel: 0
- _RenderQueueType: 1
- _RequireSplitLighting: 0
- _SrcBlend: 1
- _StencilRef: 0
- _StencilRefDepth: 8
- _StencilRefDistortionVec: 4
- _StencilRefGBuffer: 10
- _StencilRefMV: 40
- _StencilWriteMask: 6
- _StencilWriteMaskDepth: 9
- _StencilWriteMaskDistortionVec: 4
- _StencilWriteMaskGBuffer: 15
- _StencilWriteMaskMV: 41
- _SupportDecals: 1
- _SurfaceType: 0
- _TransmissionEnable: 1
- _TransparentBackfaceEnable: 0
- _TransparentCullMode: 2
- _TransparentDepthPostpassEnable: 0
- _TransparentDepthPrepassEnable: 0
- _TransparentSortPriority: 0
- _TransparentWritingMotionVec: 0
- _TransparentZWrite: 0
- _UseShadowThreshold: 0
- _ZTestDepthEqualForOpaque: 3
- _ZTestGBuffer: 4
- _ZTestTransparent: 4
- _ZWrite: 1
m_Colors:
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []
--- !u!114 &3052253946277034384
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7
@@ -0,0 +1,276 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-3204572539675280851
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 13
hdPluginSubTargetMaterialVersions:
m_Keys: []
m_Values:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Scene
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _DISABLE_SSR_TRANSPARENT
- _NORMALMAP_TANGENT_SPACE
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2225
stringTagMap: {}
disabledShaderPasses:
- TransparentDepthPrepass
- TransparentDepthPostpass
- TransparentBackface
- RayTracingPrepass
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _CoatMaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _IridescenceMaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _IridescenceThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceMaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TransmissionMaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TransmittanceColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AORemapMax: 1
- _AORemapMin: 0
- _ATDistance: 1
- _AddPrecomputedVelocity: 0
- _AlbedoAffectEmissive: 0
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _AlphaCutoffPostpass: 0.5
- _AlphaCutoffPrepass: 0.5
- _AlphaCutoffShadow: 0.5
- _AlphaDstBlend: 0
- _AlphaRemapMax: 1
- _AlphaRemapMin: 0
- _AlphaSrcBlend: 1
- _Anisotropy: 0
- _BlendMode: 0
- _CoatMask: 0
- _CullMode: 2
- _CullModeForward: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DiffusionProfile: 0
- _DiffusionProfileHash: 0
- _DisplacementLockObjectScale: 1
- _DisplacementLockTilingScale: 1
- _DisplacementMode: 0
- _DoubleSidedEnable: 0
- _DoubleSidedGIMode: 0
- _DoubleSidedNormalMode: 1
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveExposureWeight: 1
- _EmissiveIntensity: 1
- _EmissiveIntensityUnit: 0
- _EnableBlendModePreserveSpecularLighting: 1
- _EnableFogOnTransparent: 1
- _EnableGeometricSpecularAA: 0
- _EnergyConservingSpecularColor: 1
- _HeightAmplitude: 0.02
- _HeightCenter: 0.5
- _HeightMapParametrization: 0
- _HeightMax: 1
- _HeightMin: -1
- _HeightOffset: 0
- _HeightPoMAmplitude: 2
- _HeightTessAmplitude: 2
- _HeightTessCenter: 0.5
- _InvTilingScale: 1
- _Ior: 1.5
- _IridescenceMask: 1
- _IridescenceThickness: 1
- _LinkDetailsWithBase: 1
- _MaterialID: 1
- _Metallic: 0
- _MetallicRemapMax: 1
- _MetallicRemapMin: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _ObjectSpaceUVMapping: 0
- _ObjectSpaceUVMappingEmissive: 0
- _OpaqueCullMode: 2
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _PPDPrimitiveLength: 1
- _PPDPrimitiveWidth: 1
- _RayTracing: 0
- _ReceivesSSR: 1
- _ReceivesSSRTransparent: 0
- _RefractionModel: 0
- _Smoothness: 0.5
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 0
- _SpecularAAScreenSpaceVariance: 0.1
- _SpecularAAThreshold: 0.2
- _SpecularOcclusionMode: 1
- _SrcBlend: 1
- _StencilRef: 0
- _StencilRefDepth: 8
- _StencilRefGBuffer: 10
- _StencilRefMV: 40
- _StencilWriteMask: 6
- _StencilWriteMaskDepth: 9
- _StencilWriteMaskGBuffer: 15
- _StencilWriteMaskMV: 41
- _SubsurfaceMask: 1
- _SupportDecals: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _TexWorldScaleEmissive: 1
- _Thickness: 1
- _TransmissionEnable: 1
- _TransmissionMask: 1
- _TransparentBackfaceEnable: 0
- _TransparentCullMode: 2
- _TransparentDepthPostpassEnable: 0
- _TransparentDepthPrepassEnable: 0
- _TransparentSortPriority: 0
- _TransparentWritingMotionVec: 0
- _TransparentZWrite: 0
- _UVBase: 0
- _UVDetail: 0
- _UVEmissive: 0
- _UseEmissiveIntensity: 0
- _UseShadowThreshold: 0
- _ZTestDepthEqualForOpaque: 3
- _ZTestGBuffer: 4
- _ZTestTransparent: 4
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _BaseColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DiffusionProfileAsset: {r: 0, g: 0, b: 0, a: 0}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColorLDR: {r: 0, g: 0, b: 0, a: 1}
- _InvPrimScale: {r: 1, g: 1, b: 0, a: 0}
- _IridescenceThicknessRemap: {r: 0, g: 1, b: 0, a: 0}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _ThicknessRemap: {r: 0, g: 1, b: 0, a: 0}
- _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMaskEmissive: {r: 1, g: 0, b: 0, a: 0}
m_BuildTextureStacks: []
@@ -0,0 +1,353 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-1324166032169216762
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 13
hdPluginSubTargetMaterialVersions:
m_Keys: []
m_Values:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Texture2DTarget
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _DISABLE_SSR_TRANSPARENT
- _NORMALMAP_TANGENT_SPACE
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2225
stringTagMap: {}
disabledShaderPasses:
- TransparentDepthPrepass
- TransparentDepthPostpass
- TransparentBackface
- RayTracingPrepass
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 8400000, guid: 3e4a877aea3e91540a72b16a50cd5644, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseMap:
m_Texture: {fileID: 8400000, guid: 93902ee79cd9b0a46a26567520a7aa01, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _CoatMaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _IridescenceMaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _IridescenceThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 8400000, guid: 3e4a877aea3e91540a72b16a50cd5644, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceMaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TransmissionMaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TransmittanceColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AORemapMax: 1
- _AORemapMin: 0
- _ATDistance: 1
- _AddPrecomputedVelocity: 0
- _AlbedoAffectEmissive: 0
- _AlphaClip: 0
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _AlphaCutoffPostpass: 0.5
- _AlphaCutoffPrepass: 0.5
- _AlphaCutoffShadow: 0.5
- _AlphaDstBlend: 0
- _AlphaRemapMax: 1
- _AlphaRemapMin: 0
- _AlphaSrcBlend: 1
- _Anisotropy: 0
- _Blend: 0
- _BlendMode: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _CoatMask: 0
- _Cull: 2
- _CullMode: 2
- _CullModeForward: 2
- _Cutoff: 0.5
- _DepthOffsetEnable: 0
- _DetailAlbedoMapScale: 1
- _DetailAlbedoScale: 1
- _DetailNormalMapScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DiffusionProfile: 0
- _DiffusionProfileHash: 0
- _DisplacementLockObjectScale: 1
- _DisplacementLockTilingScale: 1
- _DisplacementMode: 0
- _DoubleSidedEnable: 0
- _DoubleSidedGIMode: 0
- _DoubleSidedNormalMode: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EmissiveColorMode: 1
- _EmissiveExposureWeight: 1
- _EmissiveIntensity: 1
- _EmissiveIntensityUnit: 0
- _EnableBlendModePreserveSpecularLighting: 1
- _EnableFogOnTransparent: 1
- _EnableGeometricSpecularAA: 0
- _EnergyConservingSpecularColor: 1
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _HeightAmplitude: 0.02
- _HeightCenter: 0.5
- _HeightMapParametrization: 0
- _HeightMax: 1
- _HeightMin: -1
- _HeightOffset: 0
- _HeightPoMAmplitude: 2
- _HeightTessAmplitude: 2
- _HeightTessCenter: 0.5
- _InvTilingScale: 1
- _Ior: 1.5
- _IridescenceMask: 1
- _IridescenceThickness: 1
- _LinkDetailsWithBase: 1
- _MaterialID: 1
- _Metallic: 0
- _MetallicRemapMax: 0
- _MetallicRemapMin: 0
- _NormalMapSpace: 0
- _NormalScale: 1
- _ObjectSpaceUVMapping: 0
- _ObjectSpaceUVMappingEmissive: 0
- _OcclusionStrength: 1
- _OpaqueCullMode: 2
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _PPDPrimitiveLength: 1
- _PPDPrimitiveWidth: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _RayTracing: 0
- _ReceiveShadows: 1
- _ReceivesSSR: 1
- _ReceivesSSRTransparent: 0
- _RefractionModel: 0
- _Smoothness: 0.5
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 0
- _SmoothnessTextureChannel: 0
- _SpecularAAScreenSpaceVariance: 0.1
- _SpecularAAThreshold: 0.2
- _SpecularHighlights: 1
- _SpecularOcclusionMode: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _StencilRef: 0
- _StencilRefDepth: 8
- _StencilRefGBuffer: 10
- _StencilRefMV: 40
- _StencilWriteMask: 6
- _StencilWriteMaskDepth: 9
- _StencilWriteMaskGBuffer: 15
- _StencilWriteMaskMV: 41
- _SubsurfaceMask: 1
- _SupportDecals: 1
- _Surface: 0
- _SurfaceType: 0
- _TexWorldScale: 1
- _TexWorldScaleEmissive: 1
- _Thickness: 1
- _TransmissionEnable: 1
- _TransmissionMask: 1
- _TransparentBackfaceEnable: 0
- _TransparentCullMode: 2
- _TransparentDepthPostpassEnable: 0
- _TransparentDepthPrepassEnable: 0
- _TransparentSortPriority: 0
- _TransparentWritingMotionVec: 0
- _TransparentZWrite: 0
- _UVBase: 0
- _UVDetail: 0
- _UVEmissive: 0
- _UseEmissiveIntensity: 0
- _UseShadowThreshold: 0
- _WorkflowMode: 1
- _ZTestDepthEqualForOpaque: 3
- _ZTestGBuffer: 4
- _ZTestTransparent: 4
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _BaseColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DiffusionProfileAsset: {r: 0, g: 0, b: 0, a: 0}
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColorLDR: {r: 0, g: 0, b: 0, a: 1}
- _InvPrimScale: {r: 1, g: 1, b: 0, a: 0}
- _IridescenceThicknessRemap: {r: 0, g: 1, b: 0, a: 0}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _ThicknessRemap: {r: 0, g: 1, b: 0, a: 0}
- _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMaskEmissive: {r: 1, g: 0, b: 0, a: 0}
m_BuildTextureStacks: []
--- !u!114 &6330573358565326672
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7
@@ -0,0 +1,136 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-652487388218780746
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Texture3DMaterial
m_Shader: {fileID: -6465566751694194690, guid: bcbfcfa7d1a936a43b447d2965faadd1,
type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _DISABLE_SSR_TRANSPARENT
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2225
stringTagMap:
MotionVector: User
disabledShaderPasses:
- TransparentDepthPrepass
- TransparentDepthPostpass
- TransparentBackface
- RayTracingPrepass
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _Texture3D:
m_Texture: {fileID: 8400000, guid: 197769df871dcab4ebf6687b159e729b, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaCutoffEnable: 0
- _AlphaDstBlend: 0
- _AlphaSrcBlend: 1
- _BlendMode: 0
- _ConservativeDepthOffsetEnable: 0
- _CullMode: 2
- _CullModeForward: 2
- _DepthOffsetEnable: 0
- _DoubleSidedEnable: 0
- _DoubleSidedGIMode: 0
- _DoubleSidedNormalMode: 2
- _DstBlend: 0
- _EnableBlendModePreserveSpecularLighting: 1
- _EnableFogOnTransparent: 1
- _MaterialID: 1
- _MaterialTypeMask: 2
- _OpaqueCullMode: 2
- _QueueControl: 0
- _QueueOffset: 0
- _RayTracing: 0
- _ReceivesSSR: 1
- _ReceivesSSRTransparent: 0
- _RefractionModel: 0
- _RenderQueueType: 1
- _RequireSplitLighting: 0
- _SrcBlend: 1
- _StencilRef: 0
- _StencilRefDepth: 8
- _StencilRefDistortionVec: 4
- _StencilRefGBuffer: 10
- _StencilRefMV: 40
- _StencilWriteMask: 6
- _StencilWriteMaskDepth: 9
- _StencilWriteMaskDistortionVec: 4
- _StencilWriteMaskGBuffer: 15
- _StencilWriteMaskMV: 41
- _SupportDecals: 1
- _SurfaceType: 0
- _TransmissionEnable: 1
- _TransparentBackfaceEnable: 0
- _TransparentCullMode: 2
- _TransparentDepthPostpassEnable: 0
- _TransparentDepthPrepassEnable: 0
- _TransparentSortPriority: 0
- _TransparentWritingMotionVec: 0
- _TransparentZWrite: 0
- _UseShadowThreshold: 0
- _ZTestDepthEqualForOpaque: 3
- _ZTestGBuffer: 4
- _ZTestTransparent: 4
- _ZWrite: 1
m_Colors:
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []
--- !u!114 &1984176137618647316
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 13
hdPluginSubTargetMaterialVersions:
m_Keys: []
m_Values:
@@ -0,0 +1,136 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-7627984445654775351
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 13
hdPluginSubTargetMaterialVersions:
m_Keys: []
m_Values:
--- !u!114 &-1623093597045508073
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: cubeMaterial
m_Shader: {fileID: -6465566751694194690, guid: 474a8569bb8db314ebf758dd15911ea1,
type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _DISABLE_SSR_TRANSPARENT
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2225
stringTagMap:
MotionVector: User
disabledShaderPasses:
- TransparentDepthPrepass
- TransparentDepthPostpass
- TransparentBackface
- RayTracingPrepass
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _Cubemap:
m_Texture: {fileID: 8400000, guid: a814dcfb0bee3be4c8ca5a369bf68730, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaCutoffEnable: 0
- _AlphaDstBlend: 0
- _AlphaSrcBlend: 1
- _BlendMode: 0
- _ConservativeDepthOffsetEnable: 0
- _CullMode: 2
- _CullModeForward: 2
- _DepthOffsetEnable: 0
- _DoubleSidedEnable: 0
- _DoubleSidedGIMode: 0
- _DoubleSidedNormalMode: 2
- _DstBlend: 0
- _EnableBlendModePreserveSpecularLighting: 1
- _EnableFogOnTransparent: 1
- _MaterialID: 1
- _MaterialTypeMask: 2
- _OpaqueCullMode: 2
- _QueueControl: 0
- _QueueOffset: 0
- _RayTracing: 0
- _ReceivesSSR: 1
- _ReceivesSSRTransparent: 0
- _RefractionModel: 0
- _RenderQueueType: 1
- _RequireSplitLighting: 0
- _SrcBlend: 1
- _StencilRef: 0
- _StencilRefDepth: 8
- _StencilRefDistortionVec: 4
- _StencilRefGBuffer: 10
- _StencilRefMV: 40
- _StencilWriteMask: 6
- _StencilWriteMaskDepth: 9
- _StencilWriteMaskDistortionVec: 4
- _StencilWriteMaskGBuffer: 15
- _StencilWriteMaskMV: 41
- _SupportDecals: 1
- _SurfaceType: 0
- _TransmissionEnable: 1
- _TransparentBackfaceEnable: 0
- _TransparentCullMode: 2
- _TransparentDepthPostpassEnable: 0
- _TransparentDepthPrepassEnable: 0
- _TransparentSortPriority: 0
- _TransparentWritingMotionVec: 0
- _TransparentZWrite: 0
- _UseShadowThreshold: 0
- _ZTestDepthEqualForOpaque: 3
- _ZTestGBuffer: 4
- _ZTestTransparent: 4
- _ZWrite: 1
m_Colors:
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []
@@ -0,0 +1,135 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;

// Non-graphics related parts of the RenderRequest API are tested in HDRP_PlayMode
[RequireComponent(typeof(HDAdditionalCameraData))]
public class RenderRequest : MonoBehaviour
{
[SerializeField]
RenderTexture texture2D, texture2DArray, cubeMap, texture3D;
Texture2D blackTexture;
RTHandle aovDepthTexture;

bool m_IsAOVCallbackTriggered = false;

void CheckSubmitRenderRequestAPI(Camera cam)
{
RenderPipeline.StandardRequest request = new RenderPipeline.StandardRequest();

if (RenderPipeline.SupportsRenderRequest(cam, request))
{
// Adding AOV request to HDRP in parallel to SRP render requests, it should not be triggered by them
GetComponent<HDAdditionalCameraData>().SetAOVRequests(BuildAovRequest());

request.destination = texture2D;
RenderPipeline.SubmitRenderRequest(cam, request);

request.destination = texture2DArray;
for(int i = 0; i < texture2DArray.volumeDepth; i++)
{
request.slice = i;
RenderPipeline.SubmitRenderRequest(cam, request);
}

//Set all cubemap faces to black, Switch doesn't initialize the data to black
blackTexture = new Texture2D(256, 256, TextureFormat.RGBA32, false);
Color[] colors = new Color[256 * 256];
for (int i = 0; i < colors.Length; i++)
{
colors[i] = Color.black;
}
blackTexture.SetPixels(colors);
blackTexture.Apply();
for (int i = 0; i < 6; ++i)
{
Graphics.CopyTexture(blackTexture, 0, cubeMap, i);
}

var faces = new[] {
CubemapFace.NegativeX, CubemapFace.PositiveX,
CubemapFace.NegativeY, CubemapFace.PositiveY,
CubemapFace.NegativeZ, CubemapFace.PositiveZ
};

request.destination = cubeMap;
request.slice = 0;
foreach (var face in faces)
{
request.face = face;
RenderPipeline.SubmitRenderRequest(cam, request);
}

request.destination = texture3D;
for (int i = 0; i < texture3D.volumeDepth; i++)
{
request.slice = i;
RenderPipeline.SubmitRenderRequest(cam, request);
}

// StandardRequests should not trigger AOV callbacks
if (m_IsAOVCallbackTriggered)
throw new System.Exception("AOV callback should NOT have been triggered");
}
}

// Callback is done by main thread sequentially after rendering, no data race
void AovCallback(
CommandBuffer cmd,
List<RTHandle> buffers,
RenderOutputProperties outProps
)
{
m_IsAOVCallbackTriggered = true;
}

RTHandle RTAllocator(AOVBuffers bufferID)
{
if(bufferID == AOVBuffers.DepthStencil)
return aovDepthTexture ??
(aovDepthTexture = RTHandles.Alloc(
256, 256, 1, DepthBits.None, GraphicsFormat.R8G8B8A8_SRGB));

return null;
}

AOVRequestDataCollection BuildAovRequest()
{
return new AOVRequestBuilder().Add(
AOVRequest.NewDefault(),
RTAllocator,
null, // lightFilter
new[]
{
AOVBuffers.DepthStencil,
},
AovCallback
).Build();
}

public void OnDisable()
{
RTHandles.Release(aovDepthTexture);
Destroy(blackTexture);
}

bool m_TriggerOnce = true;

// Update is called once per frame
public void Update()
{
if(m_TriggerOnce)
{
Camera cam = GetComponent<Camera>();

// Check if the texture transfers from SRP to user project can be done
CheckSubmitRenderRequestAPI(cam);

m_TriggerOnce = false;
}
}
}
@@ -0,0 +1,39 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: SceneCamera
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_IsAlphaChannelOptional: 0
serializedVersion: 5
m_Width: 256
m_Height: 256
m_AntiAliasing: 1
m_MipCount: -1
m_DepthStencilFormat: 94
m_ColorFormat: 8
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1
m_ShadowSamplingMode: 2

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -0,0 +1,39 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Texture2DArrayTarget
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_IsAlphaChannelOptional: 0
serializedVersion: 5
m_Width: 256
m_Height: 256
m_AntiAliasing: 1
m_MipCount: -1
m_DepthStencilFormat: 94
m_ColorFormat: 8
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 5
m_VolumeDepth: 10
m_ShadowSamplingMode: 2
@@ -0,0 +1,39 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Texture2DTarget
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_IsAlphaChannelOptional: 0
serializedVersion: 5
m_Width: 256
m_Height: 256
m_AntiAliasing: 1
m_MipCount: -1
m_DepthStencilFormat: 94
m_ColorFormat: 8
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1
m_ShadowSamplingMode: 2
@@ -0,0 +1,39 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Texture3DTarget
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_IsAlphaChannelOptional: 0
serializedVersion: 5
m_Width: 256
m_Height: 256
m_AntiAliasing: 1
m_MipCount: -1
m_DepthStencilFormat: 0
m_ColorFormat: 8
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 3
m_VolumeDepth: 1
m_ShadowSamplingMode: 2
Expand Up @@ -887,5 +887,8 @@ EditorBuildSettings:
- enabled: 1
path: Assets/GraphicTests/Scenes/9x_Other/9950-LineRendering.unity
guid: 65ec8013d474e1a4e85d97b29e7302f0
- enabled: 1
path: Assets/GraphicTests/Scenes/9x_Other/9960-RPCRenderRequest.unity
guid: 877ce1fd6af6ce444ad7df1b05f9b7e0
m_configObjects: {}
m_UseUCBPForAssetBundles: 0