浏览代码
Merge pull request #1497 from Unity-Technologies/FalseColorMode
Merge pull request #1497 from Unity-Technologies/FalseColorMode
Added false color debug mode/main
GitHub
7 年前
当前提交
961e2a42
共有 10 个文件被更改,包括 134 次插入 和 60 次删除
-
2com.unity.render-pipelines.core/CoreRP/ShaderLibrary/Common.hlsl
-
1com.unity.render-pipelines.high-definition/CHANGELOG.md
-
5com.unity.render-pipelines.high-definition/HDRP/Debug/ColorPickerDebug.cs
-
24com.unity.render-pipelines.high-definition/HDRP/Debug/DebugColorPicker.shader
-
33com.unity.render-pipelines.high-definition/HDRP/Debug/DebugDisplay.cs
-
12com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDRenderPipeline.cs
-
3com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDStringConstants.cs
-
82com.unity.shadergraph/Editor/Data/Nodes/Utility/Logic/IsFrontFaceNode.cs
-
21com.unity.render-pipelines.high-definition/HDRP/Debug/FalseColorDebug.cs
-
11com.unity.render-pipelines.high-definition/HDRP/Debug/FalseColorDebug.cs.meta
|
|||
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; |
|||
} |
|||
} |
|||
} |
|||
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; |
|||
} |
|||
} |
|||
} |
|
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
using System; |
|||
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
[Serializable] |
|||
public class FalseColorDebugSettings |
|||
{ |
|||
public bool falseColor = false; |
|||
|
|||
public float colorThreshold0 = 0.0f; |
|||
public float colorThreshold1 = 2.0f; |
|||
public float colorThreshold2 = 10.0f; |
|||
public float colorThreshold3 = 20.0f; |
|||
|
|||
public void OnValidate() |
|||
{ |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 8fc313e69425fb44c8fa18af3761ec24 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue