GitHub
7 年前
当前提交
900da40e
共有 17 个文件被更改,包括 148 次插入 和 11 次删除
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/ShaderGraph/HDPBRPass.template
-
21com.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
-
6com.unity.shadergraph/CHANGELOG.md
-
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
-
3com.unity.shadergraph/.data/face_sign.png
-
18com.unity.shadergraph/Editor/Data/Interfaces/IMayRequireFaceSign.cs
-
3com.unity.shadergraph/Editor/Data/Interfaces/IMayRequireFaceSign.cs.meta
-
41com.unity.shadergraph/Editor/Data/Nodes/Utility/Logic/IsFrontFaceNode.cs
-
11com.unity.shadergraph/Editor/Data/Nodes/Utility/Logic/IsFrontFaceNode.cs.meta
|
|||
version https://git-lfs.github.com/spec/v1 |
|||
oid sha256:056f160ee81fcdeb3f3a26a0116846de50b68bafa0c65db8731f5aca37ee74e7 |
|||
size 43759 |
|
|||
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("Utility", "Logic", "Is Front Face")] |
|||
public class IsFrontFaceNode : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireFaceSign |
|||
{ |
|||
public IsFrontFaceNode() |
|||
{ |
|||
name = "Is Front Face"; |
|||
UpdateNodeAfterDeserialization(); |
|||
} |
|||
|
|||
public override string documentationURL |
|||
{ |
|||
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Is-Front-Face-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} = max(0, IN.{2});", precision, GetVariableNameForSlot(OutputSlotId), ShaderGeneratorNames.FaceSign), true); |
|||
} |
|||
|
|||
public bool RequiresFaceSign(ShaderStageCapability stageCapability = ShaderStageCapability.Fragment) |
|||
{ |
|||
return true; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: c7e3dd61523f54e52ade29765e299d3f |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue