Skip to content

Commit 325612d

Browse files
Merge pull request #893 from Unity-Technologies/HDRP/factor-template-shader-graph-code
HDRP - Refactor template code in shader graph to share it
2 parents 2d2c2e0 + d5dc0bf commit 325612d

File tree

113 files changed

+1313
-1899
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+1313
-1899
lines changed

com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalSubTarget.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ sealed partial class DecalSubTarget : HDSubTarget, ILegacyTarget, IRequiresData<
1818
public DecalSubTarget() => displayName = "Decal";
1919

2020
public static string passTemplatePath => $"{HDUtils.GetHDRenderPipelinePath()}Editor/Material/Decal/ShaderGraph/DecalPass.template";
21+
public static string passTemplateMaterialDirectory => $"{HDUtils.GetHDRenderPipelinePath()}Editor/Material/ShaderGraph/Templates";
2122

2223
protected override string templatePath => passTemplatePath;
24+
protected override string templateMaterialDirectory => passTemplateMaterialDirectory;
2325
protected override string subTargetAssetGuid => "3ec927dfcb5d60e4883b2c224857b6c2";
2426
protected override string customInspector => "Rendering.HighDefinition.DecalGUI";
2527
protected override string renderType => HDRenderTypeTags.Opaque.ToString();
@@ -141,7 +143,7 @@ public static class DecalPasses
141143

142144
// Template
143145
passTemplatePath = passTemplatePath,
144-
sharedTemplateDirectory = HDTarget.sharedTemplateDirectory,
146+
sharedTemplateDirectory = passTemplateMaterialDirectory,
145147

146148
// Port mask
147149
validPixelBlocks = DecalBlockMasks.FragmentDefault,
@@ -165,7 +167,7 @@ public static class DecalPasses
165167

166168
// Template
167169
passTemplatePath = passTemplatePath,
168-
sharedTemplateDirectory = HDTarget.sharedTemplateDirectory,
170+
sharedTemplateDirectory = passTemplateMaterialDirectory,
169171

170172
// Port mask
171173
validPixelBlocks = DecalBlockMasks.FragmentDefault,
@@ -191,7 +193,7 @@ public static class DecalPasses
191193

192194
// Template
193195
passTemplatePath = passTemplatePath,
194-
sharedTemplateDirectory = HDTarget.sharedTemplateDirectory,
196+
sharedTemplateDirectory = passTemplateMaterialDirectory,
195197

196198
// Port mask
197199
validPixelBlocks = DecalBlockMasks.FragmentEmissive,
@@ -216,7 +218,7 @@ public static class DecalPasses
216218

217219
// Template
218220
passTemplatePath = passTemplatePath,
219-
sharedTemplateDirectory = HDTarget.sharedTemplateDirectory,
221+
sharedTemplateDirectory = passTemplateMaterialDirectory,
220222

221223
// Port mask
222224
validPixelBlocks = DecalBlockMasks.FragmentDefault,
@@ -243,7 +245,7 @@ public static class DecalPasses
243245

244246
// Template
245247
passTemplatePath = passTemplatePath,
246-
sharedTemplateDirectory = HDTarget.sharedTemplateDirectory,
248+
sharedTemplateDirectory = passTemplateMaterialDirectory,
247249

248250
// Port mask
249251
validPixelBlocks = DecalBlockMasks.FragmentDefault,
@@ -270,7 +272,7 @@ public static class DecalPasses
270272

271273
// Template
272274
passTemplatePath = passTemplatePath,
273-
sharedTemplateDirectory = HDTarget.sharedTemplateDirectory,
275+
sharedTemplateDirectory = passTemplateMaterialDirectory,
274276

275277
// Port mask
276278
validPixelBlocks = DecalBlockMasks.FragmentMeshEmissive,
@@ -296,7 +298,7 @@ public static class DecalPasses
296298

297299
// Template
298300
passTemplatePath = passTemplatePath,
299-
sharedTemplateDirectory = HDTarget.sharedTemplateDirectory,
301+
sharedTemplateDirectory = passTemplateMaterialDirectory,
300302

301303
// Port mask
302304
validPixelBlocks = DecalBlockMasks.FragmentMeshEmissive,

com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyePass.template

Lines changed: 0 additions & 290 deletions
This file was deleted.

com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyePass.template.meta

Lines changed: 0 additions & 7 deletions
This file was deleted.

com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyeSubTarget.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ sealed partial class EyeSubTarget : LightingSubTarget, ILegacyTarget, IRequiresD
1717
{
1818
public EyeSubTarget() => displayName = "Eye";
1919

20-
protected override string templatePath => $"{HDUtils.GetHDRenderPipelinePath()}Editor/Material/Eye/ShaderGraph/EyePass.template";
20+
protected override string templateMaterialDirectory => $"{HDUtils.GetHDRenderPipelinePath()}Editor/Material/Eye/ShaderGraph/";
2121
protected override string customInspector => "Rendering.HighDefinition.EyeGUI";
2222
protected override string subTargetAssetGuid => "864e4e09d6293cf4d98457f740bb3301";
2323
protected override ShaderID shaderID => HDShaderUtils.ShaderID.SG_Eye;

0 commit comments

Comments
 (0)