Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f5d9db1
Compute Skinning is applied in VertMesh through defines
Jan 18, 2021
58cbddd
Add front buffer index to access deformed vertices of current/previou…
svens-unity Jan 19, 2021
48b1ecf
Actually get the the vertex position of the current frame when render…
svens-unity Jan 19, 2021
a60bccc
d3d debug pragma for HDTarget
Jan 19, 2021
b6a4805
Remove skin setting component
Jan 19, 2021
b7dd69d
Apply skinning in motion vec pass, rename function
Jan 20, 2021
81d0788
Add motion vectors to unity instancing properties
Jan 20, 2021
0d6a8dd
Remove compute deformation node
Jan 20, 2021
860362d
Merge branch '10.x.x/release' into 10.x.x/dots-deformations/motion-ve…
Jan 21, 2021
4e921d8
Update changelog for HRDP and SG
Jan 21, 2021
82ffcd8
Enable vertexID when DOTS_INSTANCING_ON is defined
Jan 27, 2021
028e908
Remove manual adding of vertex id and defines in HD shader passes
Jan 27, 2021
80c2dcd
Remove skinning include and define
Jan 27, 2021
19846d9
Remove compute mesh index property when dots instancing is not defined
Jan 27, 2021
8ee28d1
Shader cleanup for dots deformations
Jan 27, 2021
0145e4b
Rename shader file for dots skinning functions
Jan 27, 2021
cf88c73
Remove changes from HDShaderPasses
Jan 27, 2021
ce95d4c
Remove formatting issues
Jan 27, 2021
fe9468e
Remove include define
Jan 27, 2021
80199e9
Merge branch '10.x.x/release' into 10.x.x/dots-deformations/motion-ve…
Jan 27, 2021
34db42a
Remove all changes from HDShaderPasses
Jan 27, 2021
2b8ea7d
Remove debug pragma
Jan 27, 2021
ee68b60
Update some comments
Jan 27, 2021
2825bd2
Remove duplicated define
Jan 27, 2021
69e7eae
Add compute mesh index to URP shader variables. Add function to fetch…
Jan 28, 2021
98d986e
Rename some functions, move fetching to different file
Jan 28, 2021
690298f
Rename deformation function for HDRP
Jan 28, 2021
8716688
Merge branch '10.x.x/release' into 10.x.x/dots-deformations/motion-ve…
Jan 29, 2021
b84ffcf
Keep vertex ID as optional when hybrid v2 is not used
Jan 29, 2021
6f3cbf1
Remove formatting from HDTarget
Jan 29, 2021
aa24bcf
Updated changelogs to be more descriptive.
Jan 29, 2021
7ac5ee9
Rename material property
Jan 29, 2021
3c2a52c
Add dots skinning function to URP passes PBR-Forward/GBuffer, Lit-For…
Jan 29, 2021
808bf70
Remove modulus from deform vertex function
Feb 1, 2021
a3c3a8e
Remove modulus, change to uints
Feb 11, 2021
b70a82a
Remove documentation for Compute Deformation Node
Feb 11, 2021
5d3abda
Update Core/ShaderLibrary/DotsDeformation.hlsl.meta file with newly g…
pastasfuture Mar 16, 2021
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
81 changes: 81 additions & 0 deletions com.unity.render-pipelines.core/ShaderLibrary/DotsDeformation.hlsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#if defined(DOTS_INSTANCING_ON)
struct DeformedVertexData
{
float3 Position;
float3 Normal;
float3 Tangent;
};

int _HybridDeformedVertexStreamIndex;
uniform StructuredBuffer<DeformedVertexData> _DeformedMeshData;
uniform StructuredBuffer<DeformedVertexData> _PreviousFrameDeformedMeshData;

// Reads vertex data for compute skinned meshes in Hybdrid Renderer
void FetchComputeVertexData(inout float3 pos, inout float3 nrm, inout float4 tan, in uint vertexID)
{
// x,y = current and previous frame indices
// z = deformation check (0 = no deformation, 1 = has deformation)
// w = skinned motion vectors
const int4 deformProperty = asint(unity_DOTSDeformationParams);
const int doSkinning = deformProperty.z;
if (doSkinning == 1)
{
const int streamIndex = _HybridDeformedVertexStreamIndex;
const int startIndex = deformProperty[streamIndex];
const DeformedVertexData vertexData = _DeformedMeshData[startIndex + vertexID];

pos = vertexData.Position;
nrm = vertexData.Normal;
tan = float4(vertexData.Tangent, 0);
}
}

void FetchComputeVertexPosNrm(inout float3 pos, inout float3 nrm, in uint vertexID)
{
// x,y = current and previous frame indices
// z = deformation check (0 = no deformation, 1 = has deformation)
// w = skinned motion vectors
const int4 deformProperty = asint(unity_DOTSDeformationParams);
const int doSkinning = deformProperty.z;
if (doSkinning == 1)
{
const int streamIndex = _HybridDeformedVertexStreamIndex;
const int startIndex = deformProperty[streamIndex];
const DeformedVertexData vertexData = _DeformedMeshData[startIndex + vertexID];

pos = vertexData.Position;
nrm = vertexData.Normal;
}
}

void FetchComputeVertexNormal(inout float3 normal, in uint vertexID)
{
const int4 deformProperty = asint(unity_DOTSDeformationParams);
const int doSkinning = deformProperty.z;
if (doSkinning == 1)
{
const int streamIndex = _HybridDeformedVertexStreamIndex;
const int startIndex = deformProperty[streamIndex];

normal = _DeformedMeshData[startIndex + vertexID].Normal;
}
}

void FetchComputeVertexPosition(inout float3 position, in uint vertexID)
{
const int4 deformProperty = asint(unity_DOTSDeformationParams);
const int doSkinning = deformProperty.z;
if (doSkinning == 1)
{
const int streamIndex = _HybridDeformedVertexStreamIndex;
const int startIndex = deformProperty[streamIndex];

position = _DeformedMeshData[startIndex + vertexID].Position;
}
}

void FetchComputeVertexPosition(inout float4 position, in uint vertexID)
{
FetchComputeVertexPosition(position.xyz, vertexID);
}
#endif

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

2 changes: 2 additions & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The version number for this package has increased due to a version update of a r
- Added light unit slider for automatic and automatic histrogram exposure limits.
- Added View Bias for mesh decals.
- Added support for the PlayStation 5 platform.
- Added support for skinned motionvectors when using Hybrid Renderer V2.

### Fixed
- Fixed computation of geometric normal in path tracing (case 1293029).
Expand Down Expand Up @@ -113,6 +114,7 @@ The version number for this package has increased due to a version update of a r
- Transparent materials created by the Model Importer are set to not cast shadows. ( case 1295747)
- Change some light unit slider value ranges to better reflect the lighting scenario.
- Change the tooltip for color shadows and semi-transparent shadows (case 1307704).
- Compute Deformation Node no longer needs to be added manually in Shader Graph for skinning to work with Hybrid Renderer V2.

## [10.2.1] - 2020-11-30

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ public struct AttributesMesh
"COLOR", subscriptOptions : StructFieldOptions.Optional);
public static FieldDescriptor instanceID = new FieldDescriptor(AttributesMesh.name, "instanceID", "", ShaderValueType.Uint,
"INSTANCEID_SEMANTIC", "UNITY_ANY_INSTANCING_ENABLED");
#if ENABLE_HYBRID_RENDERER_V2
public static FieldDescriptor vertexID = new FieldDescriptor(AttributesMesh.name, "vertexID", "", ShaderValueType.Uint,
"SV_VertexID", "DOTS_INSTANCING_ON");
#else
public static FieldDescriptor vertexID = new FieldDescriptor(AttributesMesh.name, "vertexID", "ATTRIBUTES_NEED_VERTEXID", ShaderValueType.Uint,
"SV_VertexID", subscriptOptions: StructFieldOptions.Optional);
#endif
}

public struct VaryingsMeshToPS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,8 @@ void UpdateShaderVariablesGlobalCB(HDCamera hdCamera, CommandBuffer cmd)
m_ShaderVariablesGlobalCB._EnableRecursiveRayTracing = 0;
m_ShaderVariablesGlobalCB._SpecularOcclusionBlend = 1.0f;
}

m_ShaderVariablesGlobalCB._HybridDeformedVertexStreamIndex = UnityEngine.Time.frameCount & 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to use
UnityEngine.Time.frameCount here. we have get so many issue with it (#3173)

We have a FrameCount per Camera. So I guess here we should use camera.GetCameraFrameCount();
cc @adrien-de-tocqueville / @JulienIgnace-Unity for confirmation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, UnityEngine.Time.frameCount is not always incremented in the editor


ConstantBuffer.PushGlobal(cmd, m_ShaderVariablesGlobalCB, HDShaderIDs._ShaderVariablesGlobal);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#if defined(DOTS_INSTANCING_ON)
struct DeformedVertexData
{
float3 Position;
float3 Normal;
float3 Tangent;
};

uniform StructuredBuffer<DeformedVertexData> _DeformedMeshData;
uniform StructuredBuffer<DeformedVertexData> _PreviousFrameDeformedMeshData;

// Reads vertex data for compute skinned meshes in Hybdrid Renderer
void FetchComputeVertexData(inout AttributesMesh input)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same below FetchComputeVertexPosition. Or maybe the question is more, why do we have code in Core package if it need to be rewrite per pipeline anyway?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah now I read more code I udnerstand that the Core version is the URP version. Core shouldn't be use as URP code, Core is also use for custom SRP. So the code specific to pipeline must in in pipeline.

{
// x,y = current and previous frame indices
// z = deformation check (0 = no deformation, 1 = has deformation)
// w = skinned motion vectors
const int4 deformProperty = asint(unity_DOTSDeformationParams);
const int doSkinning = deformProperty.z;
if (doSkinning == 1)
{
const uint streamIndex = _HybridDeformedVertexStreamIndex;
const uint startIndex = deformProperty[streamIndex];
const DeformedVertexData vertexData = _DeformedMeshData[startIndex + input.vertexID];

input.positionOS = vertexData.Position;
#ifdef ATTRIBUTES_NEED_NORMAL
input.normalOS = vertexData.Normal;
#endif
#ifdef ATTRIBUTES_NEED_TANGENT
input.tangentOS = float4(vertexData.Tangent, 0);
#endif
}
}

// Reads vertex position for compute skinned meshes in Hybdrid Renderer
// and also previous frame position if skinned motion vectors are used
void FetchComputeVertexPosition(inout float3 currPos, inout float3 prevPos, uint vertexID)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why inout float3 currPos, inout float3 prevPos are currently inout? they should be out only no ?

{
// x,y = current and previous frame indices
// z = deformation check (0 = no deformation, 1 = has deformation)
// w = skinned motion vectors
const int4 deformProperty = asint(unity_DOTSDeformationParams);
const int computeSkin = deformProperty.z;
const uint streamIndex = _HybridDeformedVertexStreamIndex;
if (computeSkin == 1)
{
const uint currMeshStart = deformProperty[streamIndex];
const uint currStreamIndex = _HybridDeformedVertexStreamIndex;
currPos = _DeformedMeshData[currMeshStart + vertexID].Position;
}

const int skinMotionVec = deformProperty.w;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't deformProperty.w; be dependent on deformProperty.z; ?

i.e we can have skinMotionVector only if computeSkin is true. Right now the code allow to have skin motion vector without skin which seems weird.

if (skinMotionVec == 1)
{
const uint prevStreamIndex = streamIndex ^ 1;
const int prevMeshStart = deformProperty[prevStreamIndex];

if(prevMeshStart == -1)
prevPos = _DeformedMeshData[prevMeshStart + vertexID].Position;
Copy link
Contributor

@sebastienlagarde sebastienlagarde Feb 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggetsion / Remark. It could be more efficient to have a single StructuredBuffer with both the previous and current position and dealing with and offset instead of branching on buffer read like this which waste VGPR.

i.e

StructuredBuffer _FrameDeformedMeshData

int offset = (prevMeshStart == -1) ? 0 : nextStart;
offset += vertexID;
prevPos = _FrameDeformedMeshData[offset].Position;

=> no branch, less sgpr/vgpr use to store the two uniform structureBuffer.

thought?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm currently I am confuse by the code, it looks like you alrady do that. with prevMeshStart and currMeshStart , so why is there a different _PreviousFrameDeformedMeshData structure buffer?

sorry if my question is stupid I don't know the underlaying of DOTS skinning

else
prevPos = _PreviousFrameDeformedMeshData[prevMeshStart + vertexID].Position;

}
}
#endif

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 @@ -87,7 +87,6 @@ void MotionVectorPositionZBias(VaryingsToPS input)

PackedVaryingsType MotionVectorVS(inout VaryingsType varyingsType, AttributesMesh inputMesh, AttributesPass inputPass)
{

#if !defined(TESSELLATION_ON)
MotionVectorPositionZBias(varyingsType);
#endif
Expand All @@ -107,15 +106,21 @@ PackedVaryingsType MotionVectorVS(inout VaryingsType varyingsType, AttributesMes
{
bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target

float3 effectivePositionOS = (hasDeformation ? inputPass.previousPositionOS : inputMesh.positionOS);
float3 deformedPrevPos = inputPass.previousPositionOS;

#if defined(DOTS_INSTANCING_ON)
FetchComputeVertexPosition(inputMesh.positionOS, deformedPrevPos, inputMesh.vertexID);
Copy link
Contributor

@sebastienlagarde sebastienlagarde Feb 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: is dots skinning cumulative with regular skinning?

inputPass.previousPositionOS contain the previous skinned mesh if any otherwise it is empty, so I am curious.

Also not all DOTS instancing object have skin right? And in this case there is no need to call FetchComputeVertexPosition?

I have the feeling that we should rather have a code like this:

#if defined(DOTS_INSTANCING_ON)
bool hasDeformation = asint(unity_DOTSDeformationParams).z; // DOTS skinning
if (hasDeformation)
FetchComputeVertexPosition(inputMesh.positionOS, inputPass.previousPositionOS, inputMesh.vertexID);
#else
bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target
#endif

float3 effectivePositionOS = (hasDeformation ? inputPass.previousPositionOS: inputMesh.positionOS);

Thought?

#endif
float3 effectivePositionOS = (hasDeformation) ? deformedPrevPos : inputMesh.positionOS;

#if defined(_ADD_PRECOMPUTED_VELOCITY)
effectivePositionOS -= inputPass.precomputedVelocity;
#endif

// Need to apply any vertex animation to the previous worldspace position, if we want it to show up in the motion vector buffer
#if defined(HAVE_MESH_MODIFICATION)
AttributesMesh previousMesh = inputMesh;
previousMesh.positionOS = effectivePositionOS ;
previousMesh.positionOS = effectivePositionOS;

previousMesh = ApplyMeshModification(previousMesh, _LastTimeParameters.xyz);
float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.positionOS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ struct AttributesMesh
#ifdef ATTRIBUTES_NEED_COLOR
float4 color : COLOR;
#endif

#ifdef DOTS_INSTANCING_ON
uint vertexID : SV_VertexID;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: be sure this compile on DX12 / PS4 / Xbox. We have get various surprise with system sematic ordering on those platform (with double sided, instance id etc...)

also we need to use VERTEXID_SEMANTIC and not SV_VertexID

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Guess for now Vertex_ID is only used with skinned mesh right?
so it should not be define when DOTS_INSTANCING_ON is on, but when DOTS_SKINNING_INSTANCING_ON ? (which doesnt exist but you get the idea). Just wondering :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok reading more code it seems that we can only know dynamically if we use skinning or not, so fine.

#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ VaryingsToDS InterpolateWithBaryCoordsToDS(VaryingsToDS input0, VaryingsToDS inp
#define PackVaryingsType PackVaryingsToPS
#endif

#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/DotsDeformation.hlsl"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

surround with dots instancing on define?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes


// TODO: Here we will also have all the vertex deformation (GPU skinning, vertex animation, morph target...) or we will need to generate a compute shaders instead (better! but require work to deal with unpacking like fp16)
// Make it inout so that MotionVectorPass can get the modified input values later.
VaryingsMeshType VertMesh(AttributesMesh input, float3 worldSpaceOffset)
Expand All @@ -135,6 +137,10 @@ VaryingsMeshType VertMesh(AttributesMesh input, float3 worldSpaceOffset)
UNITY_SETUP_INSTANCE_ID(input);
UNITY_TRANSFER_INSTANCE_ID(input, output);

#if defined(DOTS_INSTANCING_ON)
FetchComputeVertexData(input);
#endif

#if defined(HAVE_MESH_MODIFICATION)
input = ApplyMeshModification(input, _TimeParameters.xyz);
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ UNITY_DOTS_INSTANCING_START(BuiltinPropertyMetadata)
UNITY_DOTS_INSTANCED_PROP(float4, unity_ProbesOcclusion)
UNITY_DOTS_INSTANCED_PROP(float3x4, unity_MatrixPreviousM)
UNITY_DOTS_INSTANCED_PROP(float3x4, unity_MatrixPreviousMI)
UNITY_DOTS_INSTANCED_PROP(float4, unity_MotionVectorsParams)
UNITY_DOTS_INSTANCED_PROP(float4, unity_DOTSDeformationParams)
UNITY_DOTS_INSTANCING_END(BuiltinPropertyMetadata)

// Note: Macros for unity_ObjectToWorld and unity_WorldToObject are declared elsewhere
Expand All @@ -391,7 +393,8 @@ UNITY_DOTS_INSTANCING_END(BuiltinPropertyMetadata)
#define unity_ProbesOcclusion UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float4, Metadata_unity_ProbesOcclusion)
#define unity_MatrixPreviousM LoadDOTSInstancedData_float4x4_from_float3x4(UNITY_DOTS_INSTANCED_METADATA_NAME_FROM_MACRO(float3x4, Metadata_unity_MatrixPreviousM))
#define unity_MatrixPreviousMI LoadDOTSInstancedData_float4x4_from_float3x4(UNITY_DOTS_INSTANCED_METADATA_NAME_FROM_MACRO(float3x4, Metadata_unity_MatrixPreviousMI))

#define unity_MotionVectorsParams UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float4, Metadata_unity_MotionVectorsParams)
#define unity_DOTSDeformationParams UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float4, Metadata_unity_DOTSDeformationParams)
#endif

// Define View/Projection matrix macro
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,6 @@ unsafe struct ShaderVariablesGlobal
public float _GlobalTessellationFactorMultiplier;

public float _SpecularOcclusionBlend;
public float _Pad9;
public int _HybridDeformedVertexStreamIndex;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ GLOBAL_CBUFFER_START(ShaderVariablesGlobal, b0)
int _TransparentCameraOnlyMotionVectors;
float _GlobalTessellationFactorMultiplier;
float _SpecularOcclusionBlend;
float _Pad9;
int _HybridDeformedVertexStreamIndex;
CBUFFER_END


Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
#ifndef SG_DEPTH_ONLY_PASS_INCLUDED
#define SG_DEPTH_ONLY_PASS_INCLUDED

#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DotsDeformation.hlsl"

PackedVaryings vert(Attributes input)
{
Varyings output = (Varyings)0;
output = BuildVaryings(input);

#if defined(DOTS_INSTANCING_ON)
FetchComputeVertexPosNrm(input.positionOS, input.normalOS, input.vertexID);
#endif
PackedVaryings packedOutput = (PackedVaryings)0;
packedOutput = PackVaryings(output);
return packedOutput;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#ifndef SG_DEPTH_ONLY_PASS_INCLUDED
#define SG_DEPTH_ONLY_PASS_INCLUDED

#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DotsDeformation.hlsl"

PackedVaryings vert(Attributes input)
{
Varyings output = (Varyings)0;
#if defined(DOTS_INSTANCING_ON)
FetchComputeVertexPosition(input.positionOS, input.vertexID);
#endif
output = BuildVaryings(input);
PackedVaryings packedOutput = (PackedVaryings)0;
packedOutput = PackVaryings(output);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ void BuildInputData(Varyings input, SurfaceDescription surfaceDescription, out I
inputData.shadowMask = SAMPLE_SHADOWMASK(input.lightmapUV);
}

#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DotsDeformation.hlsl"

PackedVaryings vert(Attributes input)
{
Varyings output = (Varyings)0;
#if defined(DOTS_INSTANCING_ON)
FetchComputeVertexData(input.positionOS, input.normalOS, input.tangentOS, input.vertexID);
#endif
output = BuildVaryings(input);
PackedVaryings packedOutput = (PackedVaryings)0;
packedOutput = PackVaryings(output);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ void BuildInputData(Varyings input, SurfaceDescription surfaceDescription, out I
inputData.shadowMask = SAMPLE_SHADOWMASK(input.lightmapUV);
}

#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DotsDeformation.hlsl"

PackedVaryings vert(Attributes input)
{
Varyings output = (Varyings)0;
#if defined(DOTS_INSTANCING_ON)
FetchComputeVertexData(input.positionOS, input.normalOS, input.tangentOS, input.vertexID);
#endif
output = BuildVaryings(input);
PackedVaryings packedOutput = (PackedVaryings)0;
packedOutput = PackVaryings(output);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#ifndef SG_SHADOW_PASS_INCLUDED
#define SG_SHADOW_PASS_INCLUDED

#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DotsDeformation.hlsl"

PackedVaryings vert(Attributes input)
{
Varyings output = (Varyings)0;
#if defined(DOTS_INSTANCING_ON)
FetchComputeVertexData(input.positionOS, input.normalOS, input.tangentOS, input.vertexID);
#endif
output = BuildVaryings(input);
PackedVaryings packedOutput = (PackedVaryings)0;
packedOutput = PackVaryings(output);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
PackedVaryings vert(Attributes input)
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DotsDeformation.hlsl"

PackedVaryings vert(Attributes input)
{
Varyings output = (Varyings)0;

#if defined(DOTS_INSTANCING_ON)
FetchComputeVertexData(input.positionOS, input.normalOS, input.tangentOS, input.vertexID);
#endif
output = BuildVaryings(input);
PackedVaryings packedOutput = PackVaryings(output);
return packedOutput;
Expand Down
Loading