Matt Dean
7 年前
当前提交
ad13e4b0
共有 15 个文件被更改,包括 132 次插入 和 4 次删除
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/ShaderGraph/HDPBRPass.template
-
7com.unity.render-pipelines.high-definition/HDRP/Editor/ShaderGraph/HDSubShaderUtilities.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/ShaderGraph/HDUnlitPassForward.template
-
12com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/LightWeightPBRSubShader.cs
-
12com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/LightWeightUnlitSubShader.cs
-
2com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/lightweightPBRForwardPass.template
-
2com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/lightweightUnlitPass.template
-
4com.unity.shadergraph/Editor/Data/Graphs/ShaderGraphRequirements.cs
-
5com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs
-
14com.unity.shadergraph/Editor/Data/Util/ShaderGenerator.cs
-
1com.unity.shadergraph/Editor/Data/Util/ShaderGeneratorNames.cs
-
18com.unity.shadergraph/Editor/Data/Interfaces/IMayRequireFaceSign.cs
-
3com.unity.shadergraph/Editor/Data/Interfaces/IMayRequireFaceSign.cs.meta
-
41com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/FaceSignNode.cs
-
11com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/FaceSignNode.cs.meta
|
|||
using UnityEditor.Graphing; |
|||
|
|||
namespace UnityEditor.ShaderGraph |
|||
{ |
|||
public interface IMayRequireFaceSign |
|||
{ |
|||
bool RequiresFaceSign(ShaderStageCapability stageCapability = ShaderStageCapability.Fragment); |
|||
} |
|||
|
|||
public static class IMayRequireFaceSignExtensions |
|||
{ |
|||
public static bool RequiresFaceSign(this ISlot slot) |
|||
{ |
|||
var mayRequireFaceSign = slot as IMayRequireFaceSign; |
|||
return mayRequireFaceSign != null && mayRequireFaceSign.RequiresFaceSign(); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 23f5d9c2f1ec442a7b8c59e893a6724d |
|||
timeCreated: 1512469767 |
|
|||
using UnityEngine; |
|||
using UnityEditor.Graphing; |
|||
|
|||
namespace UnityEditor.ShaderGraph |
|||
{ |
|||
[Title("Input", "Geometry", "Face Sign")] |
|||
public class FaceSignNode : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireFaceSign |
|||
{ |
|||
public FaceSignNode() |
|||
{ |
|||
name = "Face Sign"; |
|||
UpdateNodeAfterDeserialization(); |
|||
} |
|||
|
|||
public override string documentationURL |
|||
{ |
|||
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Face-Sign-Node"; } |
|||
} |
|||
|
|||
public override bool hasPreview { get { return false; } } |
|||
|
|||
public const int OutputSlotId = 0; |
|||
private const string kOutputSlotName = "Out"; |
|||
|
|||
public override void UpdateNodeAfterDeserialization() |
|||
{ |
|||
AddSlot(new BooleanMaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, true, ShaderStageCapability.Fragment)); |
|||
RemoveSlotsNameNotMatching(new[] { OutputSlotId }); |
|||
} |
|||
|
|||
public void GenerateNodeCode(ShaderGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
visitor.AddShaderChunk(string.Format("{0} {1} = IN.{2};", precision, GetVariableNameForSlot(OutputSlotId), ShaderGeneratorNames.FaceSign), true); |
|||
} |
|||
|
|||
public bool RequiresFaceSign(ShaderStageCapability stageCapability = ShaderStageCapability.Fragment) |
|||
{ |
|||
return true; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: ef4bc985732ff4564a13393509c3c7cd |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue