Skip to content

[Feature] Compute Deformation Node #166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 43 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
1fdc616
[Feature] Create node for compute deformations.
Apr 6, 2020
52dc535
[Feature] Adding some missing files for Compute Deformation node
Apr 6, 2020
ad6e50d
Fix skinning nodes
svens-unity Apr 14, 2020
64c2b28
Clean-up of LBS & Deform Compute SG nodes.
svens-unity Apr 15, 2020
77068bc
Moved LinearBlendSkinning node into Mesh Deformations folder
svens-unity Apr 15, 2020
fea2f6d
Both nodes add the shader properties automatically.
svens-unity Apr 15, 2020
886311e
Add sub graph support for both nodes.
svens-unity Apr 15, 2020
fde6b2c
Add vertexID, bone weights and indices to AttributeData
Apr 16, 2020
ee378ae
Add correct semantic for vertexID
Apr 16, 2020
f3eb6fd
Add setup error to compute deform node if compute define is not enabled.
Apr 17, 2020
8eea6cc
Remove warning about vector truncation from Compute Deform Node
Apr 17, 2020
d783334
[Documentation] Added documentation for LBS and Compute node
Apr 17, 2020
91ae952
Get objects to visualize in gameobject mode.
svens-unity Apr 17, 2020
dc5e924
Merge branch 'dots-deformations' of github.com:Unity-Technologies/Gra…
svens-unity Apr 17, 2020
f27c5db
Add setup error to CD and LBS nodes if Hybrid Renderer package is not…
Apr 17, 2020
f94e60c
Merge remote-tracking branch 'origin/dots-deformations' into dots-def…
Apr 17, 2020
9cee664
Merge branch 'master' into dots-deformations
svens-unity Apr 17, 2020
0602112
Update shadergraph changelog
Apr 17, 2020
443fb31
Updated Compute-Deformation-Node and Linear-Blend-Skinning-Node
sharlenet Apr 17, 2020
3804528
Add defines to SG nodes to remove supported features in Hybrid V1.
svens-unity Apr 20, 2020
20724cd
Merge branch 'dots-deformations' of github.com:Unity-Technologies/Gra…
svens-unity Apr 20, 2020
71aa8c4
Updated Linear Blend Skinning Node
sharlenet Apr 20, 2020
601fd24
Add defines for LBS node to work with Hybrid Renderer prior to data p…
Apr 21, 2020
a90ab12
Added link to Hybrid Renderer. Updated Ports table.
svens-unity Apr 21, 2020
8e9099b
Added missing input port entries in Ports table
svens-unity Apr 21, 2020
67b6805
Move LinearBlendSkinning node into 'Mesh Deformation' group.
svens-unity Apr 21, 2020
4cadeee
Add defines for material property to work with hybrid renderer v2 pre…
Apr 21, 2020
c32ecaa
Update shader graph define to 0.5.0
Apr 21, 2020
94d1fc1
Update compute deformation node define to be hybrid renderer 0.5.0
Apr 21, 2020
bc0b8bc
Merge remote-tracking branch 'origin/dots-deformations' into dots-def…
Apr 21, 2020
07a2e04
Merge remote-tracking branch 'origin/master' into dots-deformations
svens-unity Apr 21, 2020
ab77a3e
Bump ShaderGraph importer version
svens-unity Apr 21, 2020
5a37915
Update hybrid renderer version define to include preview version 4 an…
Apr 21, 2020
b4089d2
Added punctuation.
sharlenet Apr 21, 2020
bc7b6f4
Updated TableOfContents.md
sharlenet Apr 22, 2020
75972ad
Update Node error messages
svens-unity Apr 23, 2020
ede321b
Add 'package' to error message.
svens-unity Apr 23, 2020
3afee37
Merge branch 'master' into dots-deformations
Apr 28, 2020
cfb9a28
Use float3 for deformed mesh tangents instead of float4
Apr 29, 2020
f55325a
[Clean Up] Rename Input and Output slots for LBS and Compute Deform node
Apr 30, 2020
4c76690
Merge branch 'master' of github.com:Unity-Technologies/Graphics into …
svens-unity May 12, 2020
b42c201
Update guid to objectId
svens-unity May 12, 2020
38f0bfb
Update hybrid renderer assembly define for Shader Graph
May 13, 2020
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using UnityEditor.ShaderGraph;
using UnityEditor.ShaderGraph;

namespace UnityEditor.Rendering.HighDefinition.ShaderGraph
{
Expand Down Expand Up @@ -28,6 +28,8 @@ public struct AttributesMesh
"COLOR", subscriptOptions : StructFieldOptions.Optional);
public static FieldDescriptor instanceID = new FieldDescriptor(AttributesMesh.name, "instanceID", "", ShaderValueType.Uint,
"INSTANCEID_SEMANTIC", "UNITY_ANY_INSTANCING_ENABLED");
public static FieldDescriptor vertexID = new FieldDescriptor(AttributesMesh.name, "vertexID", "ATTRIBUTES_NEED_VERTEXID", ShaderValueType.Uint,
"SV_VertexID", subscriptOptions: StructFieldOptions.Optional);
}

public struct VaryingsMeshToPS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using UnityEditor.ShaderGraph;
using UnityEditor.ShaderGraph;

namespace UnityEditor.Rendering.HighDefinition.ShaderGraph
{
Expand All @@ -21,6 +21,7 @@ static class HDStructs
HDStructFields.AttributesMesh.instanceID,
HDStructFields.AttributesMesh.weights,
HDStructFields.AttributesMesh.indices,
HDStructFields.AttributesMesh.vertexID,
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ static class CoreFieldDependencies

new FieldDependency(StructFields.VertexDescriptionInputs.BoneWeights, HDStructFields.AttributesMesh.weights),
new FieldDependency(StructFields.VertexDescriptionInputs.BoneIndices, HDStructFields.AttributesMesh.indices),
new FieldDependency(StructFields.VertexDescriptionInputs.VertexID, HDStructFields.AttributesMesh.vertexID),
};

public static DependencyCollection SurfaceDescription = new DependencyCollection
Expand Down Expand Up @@ -212,6 +213,10 @@ static class CoreFieldDependencies
new FieldDependency(StructFields.SurfaceDescriptionInputs.FaceSign, HDStructFields.FragInputs.IsFrontFace),

new FieldDependency(HDFields.DepthOffset, HDStructFields.FragInputs.positionRWS),

new FieldDependency(StructFields.SurfaceDescriptionInputs.BoneWeights, StructFields.SurfaceDescriptionInputs.BoneIndices),
new FieldDependency(StructFields.SurfaceDescriptionInputs.BoneIndices, StructFields.SurfaceDescriptionInputs.BoneWeights),
new FieldDependency(StructFields.SurfaceDescriptionInputs.VertexID, StructFields.SurfaceDescriptionInputs.VertexID),
Comment on lines +217 to +219
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally we would not have these be part of surface descriptions? However, they are required to have the nodes work in subgraphs...

};

public static DependencyCollection Default = new DependencyCollection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ VertexDescriptionInputs AttributesMeshToVertexDescriptionInputs(AttributesMesh i
$VertexDescriptionInputs.VertexColor: output.VertexColor = input.color;
$VertexDescriptionInputs.BoneWeights: output.BoneWeights = input.weights;
$VertexDescriptionInputs.BoneIndices: output.BoneIndices = input.indices;
$VertexDescriptionInputs.VertexID: output.VertexID = input.vertexID;

return output;
}
Expand Down
3 changes: 3 additions & 0 deletions com.unity.shadergraph/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Added AlphaToMask render state.
- Added a field to the Master Nodes that overrides the generated shader's ShaderGUI, which determines how a Material that uses a Shader Graph looks.
- Added Redirect Nodes. You can now double-click an edge to add a control point that allows you to route edges around other nodes and connect multiple output edges.
- Added `Compute Deformation` Node to read deformed vertex data from Dots Deformations.
- Added new graph nodes that allow sampling Virtual Textures
- Shader Graph now uses a new file format that is much friendlier towards version control systems and humans. Existing Shader Graphs and will use the new format next time they are saved.

Expand All @@ -37,6 +38,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Updated the functions in the `Normal From Height` node to avoid NaN outputs.
- Changed the Voronoi Node algorithm to increase the useful range of the input values and to always use float values internally to avoid clipping.
- Changed the `Reference Suffix` of Keyword Enum entries so that you cannot edit them, which ensures that material keywords compile properly.
- Added support for `Linear Blend Skinning` Node to Universal Render Pipeline.

### Fixed
- Edges no longer produce errors when you save a Shader Graph.
Expand Down Expand Up @@ -109,6 +111,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed an issue where `Keywords` on the Blackboard would not duplicate with the same `Default` value.
- Shader Graph now requests preview shader compilation asynchronously. [1209047](https://issuetracker.unity3d.com/issues/shader-graph-unresponsive-editor-when-using-large-graphs)
- Fixed an issue where Shader Graph would not compile master previews after an assembly reload.
- Fixed issue where `Linear Blend Skinning` node could not be converted to Sub Graph [1227087](https://issuetracker.unity3d.com/issues/shadergraph-linear-blend-skinning-node-reports-an-error-and-prevents-shader-compilation-when-used-within-a-sub-graph)
- Fixed a compilation error in preview shaders for nodes requiring view direction.
- Fixed undo not being recorded properly for setting active master node, graph precision, and node defaults.
- Fixed an issue where Custum Function nodes and Sub Graph Output nodes could no longer rename slots.
Expand Down
12 changes: 12 additions & 0 deletions com.unity.shadergraph/Documentation~/Compute-Deformation-Node.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Compute Deformation Node

## Description

This node lets you pass compute deformed vertex data to a vertex shader, and only works with the [DOTS Hybrid Renderer](https://docs.unity3d.com/Packages/com.unity.rendering.hybrid@latest/). You must provide `DeformedVertexData` in the `_DeformedMeshData` buffer. The node uses the `_ComputeMeshIndex` property to calculate where the `DeformedVertexData` associated with the current mesh are located in the `_DeformedMeshData` buffer. To output data, you must either install both the DOTS Hybrid Renderer and DOTS Animation packages, or use a custom solution.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there anything specific inside of the DOTS Hyrbid or Animation packages that goes in depth on how to use the Deformed Mesh Data buffer, or in what case this node would be useful?
I'm just thinking of the case where a user stumbles across this node, having more information is better. We previously had some confusion regarding the linear blend skinning node.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes we do :) It can be found here. Please let us know if you think there is anything missing from the docs.

Copy link
Contributor

Choose a reason for hiding this comment

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

That page looks good, can you make a note to add a link to it once it's public to users? I see it's in a private repo, but I would like the pages for skinning to have something along the lines of These nodes work with the [DOTS Mesh Deformation](link to mesh deform page) system.
Being that it's currently private I'm okay to approve without the link but I do want the public link added when it's available. c:


## Ports
| Name | Direction | Type | Stage | Description |
|:--------- |:-----------|:--------|:-------|:------------|
| Position | Output | Vector3 | Vertex | Outputs the deformed vertex position. |
| Normal | Output | Vector3 | Vertex | Outputs the deformed vertex normal. |
| Tangent | Output | Vector3 | Vertex | Outputs the deformed vertex tangent. |
15 changes: 15 additions & 0 deletions com.unity.shadergraph/Documentation~/Linear-Blend-Skinning-Node.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Linear Blend Skinning Node

## Description

This node lets you apply Linear Blend Vertex Skinning, and only works with the [DOTS Hybrid Renderer](https://docs.unity3d.com/Packages/com.unity.rendering.hybrid@latest/). You must provide skinned matrices in the `_SkinMatrices` buffer. The node uses the `_SkinMatrixIndex` property to calculate where the matrices associated with the current mesh are located in the `_SkinMatrices` buffer.
Copy link
Contributor

Choose a reason for hiding this comment

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

Just going to echo what I noted for the Compute Deformation Node, if there's any specific external documentation for DOTS Hybrid that provides more context for this data and the use cases, that would be good to add here.


## Ports
| Name | Direction | Type | Stage | Description |
|:--------- |:-----------|:--------|:-------|:------------|
| Position | Input | Vector3 | Vertex | Position of the vertex in object space. |
| Normal | Input | Vector3 | Vertex | Normal of the vertex in object space. |
| Tangent | Input | Vector3 | Vertex | Tangent of the vertex in object space. |
| Position | Output | Vector3 | Vertex | Outputs the skinned vertex position. |
| Normal | Output | Vector3 | Vertex | Outputs the skinned vertex normal. |
| Tangent | Output | Vector3 | Vertex | Outputs the skinned vertex tangent. |
3 changes: 3 additions & 0 deletions com.unity.shadergraph/Documentation~/TableOfContents.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@
* [Sawtooth Wave](Sawtooth-Wave-Node)
* [Square Wave](Square-Wave-Node)
* [Triangle Wave](Triangle-Wave-Node)
* Mesh Deformation
* [Compute Deformation](Compute-Deformation-Node)
* [Linear Blend Skinning](Linear-Blend-Skinning-Node)
* [Procedural](Procedural-Nodes)
* Noise
* [Gradient Noise](Gradient-Noise-Node)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public struct ShaderGraphRequirements
[SerializeField] bool m_RequiresCameraOpaqueTexture;
[SerializeField] bool m_RequiresTime;
[SerializeField] bool m_RequiresVertexSkinning;
[SerializeField] bool m_RequiresVertexID;

internal static ShaderGraphRequirements none
{
Expand Down Expand Up @@ -111,6 +112,12 @@ public bool requiresVertexSkinning
internal set { m_RequiresVertexSkinning = value; }
}

public bool requiresVertexID
{
get { return m_RequiresVertexID; }
internal set { m_RequiresVertexID = value; }
}

internal bool NeedsTangentSpace()
{
var compoundSpaces = m_RequiresBitangent | m_RequiresNormal | m_RequiresPosition
Expand All @@ -135,6 +142,7 @@ internal ShaderGraphRequirements Union(ShaderGraphRequirements other)
newReqs.m_RequiresCameraOpaqueTexture = other.m_RequiresCameraOpaqueTexture | m_RequiresCameraOpaqueTexture;
newReqs.m_RequiresTime = other.m_RequiresTime | m_RequiresTime;
newReqs.m_RequiresVertexSkinning = other.m_RequiresVertexSkinning | m_RequiresVertexSkinning;
newReqs.m_RequiresVertexID = other.m_RequiresVertexID | m_RequiresVertexID;

newReqs.m_RequiresMeshUVs = new List<UVChannel>();
if (m_RequiresMeshUVs != null)
Expand All @@ -159,6 +167,7 @@ internal static ShaderGraphRequirements FromNodes<T>(List<T> nodes, ShaderStageC
bool requiresCameraOpaqueTexture = nodes.OfType<IMayRequireCameraOpaqueTexture>().Any(x => x.RequiresCameraOpaqueTexture());
bool requiresTime = nodes.Any(x => x.RequiresTime());
bool requiresVertexSkinning = nodes.OfType<IMayRequireVertexSkinning>().Any(x => x.RequiresVertexSkinning(stageCapability));
bool requiresVertexID = nodes.OfType<IMayRequireVertexID>().Any(x => x.RequiresVertexID(stageCapability));

var meshUV = new List<UVChannel>();
for (int uvIndex = 0; uvIndex < ShaderGeneratorNames.UVCount; ++uvIndex)
Expand Down Expand Up @@ -200,6 +209,7 @@ internal static ShaderGraphRequirements FromNodes<T>(List<T> nodes, ShaderStageC
m_RequiresCameraOpaqueTexture = requiresCameraOpaqueTexture,
m_RequiresTime = requiresTime,
m_RequiresVertexSkinning = requiresVertexSkinning,
m_RequiresVertexID = requiresVertexID,
};

return reqs;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using UnityEditor.Graphing;

namespace UnityEditor.ShaderGraph
{
interface IMayRequireVertexID
{
bool RequiresVertexID(ShaderStageCapability stageCapability = ShaderStageCapability.All);
}

static class MayRequireVertexIDExtensions
{
public static bool RequiresVertexID(this MaterialSlot slot)
{
var mayRequireVertexID = slot as IMayRequireVertexID;
return mayRequireVertexID != null && mayRequireVertexID.RequiresVertexID();
}
}
}

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
@@ -0,0 +1,155 @@
using UnityEngine;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Internal;

namespace UnityEditor.ShaderGraph
{
[Title("Mesh Deformation", "Compute Deformation")]
class ComputeDeformNode : AbstractMaterialNode, IGeneratesBodyCode, IGeneratesFunction, IMayRequirePosition, IMayRequireNormal, IMayRequireTangent, IMayRequireVertexID
{
public const int kPositionOutputSlotId = 0;
public const int kNormalOutputSlotId = 1;
public const int kTangentOutputSlotId = 2;

public const string kOutputSlotPositionName = "Deformed Position";
public const string kOutputSlotNormalName = "Deformed Normal";
public const string kOutputSlotTangentName = "Deformed Tangent";

public ComputeDeformNode()
{
name = "Compute Deformation";
UpdateNodeAfterDeserialization();
}

public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector3MaterialSlot(kPositionOutputSlotId, kOutputSlotPositionName, kOutputSlotPositionName, SlotType.Output, Vector3.zero, ShaderStageCapability.Vertex));
AddSlot(new Vector3MaterialSlot(kNormalOutputSlotId, kOutputSlotNormalName, kOutputSlotNormalName, SlotType.Output, Vector3.zero, ShaderStageCapability.Vertex));
AddSlot(new Vector3MaterialSlot(kTangentOutputSlotId, kOutputSlotTangentName, kOutputSlotTangentName, SlotType.Output, Vector3.zero, ShaderStageCapability.Vertex));
RemoveSlotsNameNotMatching(new[] { kPositionOutputSlotId, kNormalOutputSlotId, kTangentOutputSlotId });
}

protected override void CalculateNodeHasError()
{
#if !HYBRID_RENDERER_0_6_0_OR_NEWER
owner.AddSetupError(objectId, "Could not find version 0.6.0 or newer of the Hybrid Renderer package installed in the project.");
hasError = true;
#endif
#if !ENABLE_COMPUTE_DEFORMATIONS
owner.AddSetupError(objectId, "For the Compute Deformation node to work, you must go to Project Settings>Player>Other Settings and add the ENABLE_COMPUTE_DEFORMATIONS define to Scripting Define Symbols.");
hasError = true;
#endif
}

public bool RequiresVertexID(ShaderStageCapability stageCapability = ShaderStageCapability.All)
{
return true;
}

public NeededCoordinateSpace RequiresPosition(ShaderStageCapability stageCapability = ShaderStageCapability.All)
{
if (stageCapability == ShaderStageCapability.Vertex || stageCapability == ShaderStageCapability.All)
return NeededCoordinateSpace.Object;
else
return NeededCoordinateSpace.None;
}

public NeededCoordinateSpace RequiresNormal(ShaderStageCapability stageCapability = ShaderStageCapability.All)
{
if (stageCapability == ShaderStageCapability.Vertex || stageCapability == ShaderStageCapability.All)
return NeededCoordinateSpace.Object;
else
return NeededCoordinateSpace.None;
}

public NeededCoordinateSpace RequiresTangent(ShaderStageCapability stageCapability = ShaderStageCapability.All)
{
if (stageCapability == ShaderStageCapability.Vertex || stageCapability == ShaderStageCapability.All)
return NeededCoordinateSpace.Object;
else
return NeededCoordinateSpace.None;
}

public override void CollectShaderProperties(PropertyCollector properties, GenerationMode generationMode)
{
properties.AddShaderProperty(new Vector1ShaderProperty()
{
displayName = "Compute Mesh Buffer Index Offset",
overrideReferenceName = "_ComputeMeshIndex",
gpuInstanced = true,
#if ENABLE_HYBRID_RENDERER_V2
hidden = true,
#endif
value = 0
});

base.CollectShaderProperties(properties, generationMode);
}

public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode)
{
#if ENABLE_HYBRID_RENDERER_V2
sb.AppendLine("#if defined(UNITY_DOTS_INSTANCING_ENABLED)");
#endif
sb.AppendLine("$precision3 {0} = 0;", GetVariableNameForSlot(kPositionOutputSlotId));
sb.AppendLine("$precision3 {0} = 0;", GetVariableNameForSlot(kNormalOutputSlotId));
sb.AppendLine("$precision3 {0} = 0;", GetVariableNameForSlot(kTangentOutputSlotId));
if (generationMode == GenerationMode.ForReals)
{
sb.AppendLine($"{GetFunctionName()}(" +
$"IN.VertexID, " +
$"{GetVariableNameForSlot(kPositionOutputSlotId)}, " +
$"{GetVariableNameForSlot(kNormalOutputSlotId)}, " +
$"{GetVariableNameForSlot(kTangentOutputSlotId)});");
}
#if ENABLE_HYBRID_RENDERER_V2
sb.AppendLine("#else");
sb.AppendLine("$precision3 {0} = IN.ObjectSpacePosition;", GetVariableNameForSlot(kPositionOutputSlotId));
sb.AppendLine("$precision3 {0} = IN.ObjectSpaceNormal;", GetVariableNameForSlot(kNormalOutputSlotId));
sb.AppendLine("$precision3 {0} = IN.ObjectSpaceTangent;", GetVariableNameForSlot(kTangentOutputSlotId));
sb.AppendLine("#endif");
#endif
}

public void GenerateNodeFunction(FunctionRegistry registry, GenerationMode generationMode)
{
registry.ProvideFunction("DeformedMeshData", sb =>
{
sb.AppendLine("struct DeformedVertexData");
sb.AppendLine("{");
using (sb.IndentScope())
{
sb.AppendLine("float3 Position;");
sb.AppendLine("float3 Normal;");
sb.AppendLine("float3 Tangent;");
}
sb.AppendLine("};");
sb.AppendLine("uniform StructuredBuffer<DeformedVertexData> _DeformedMeshData : register(t1);");
});

registry.ProvideFunction(GetFunctionName(), sb =>
{
sb.AppendLine($"void {GetFunctionName()}(" +
"uint vertexID, " +
"out $precision3 positionOut, " +
"out $precision3 normalOut, " +
"out $precision3 tangentOut)");

sb.AppendLine("{");
using (sb.IndentScope())
{
sb.AppendLine("const DeformedVertexData vertexData = _DeformedMeshData[asuint(_ComputeMeshIndex) + vertexID];");
sb.AppendLine("positionOut = vertexData.Position;");
sb.AppendLine("normalOut = vertexData.Normal;");
sb.AppendLine("tangentOut = vertexData.Tangent;");
}
sb.AppendLine("}");
});
}

string GetFunctionName()
{
return $"Unity_ComputeDeformedVertex_{concretePrecision.ToShaderString()}";
}
}
}

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

Loading