FateViewer/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/HelperFuncs/UnityObjToClipPosHlpNode.cs

35 lines
1.3 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
using System;
namespace AmplifyShaderEditor
{
[Serializable]
[NodeAttributes( "Object To Clip Pos", "Object Transform", "Transforms a point from object space to the cameras clip space in homogeneous coordinates" )]
public sealed class UnityObjToClipPosHlpNode : HelperParentNode
{
protected override void CommonInit( int uniqueId )
{
base.CommonInit( uniqueId );
m_funcType = "UnityObjectToClipPos";
//TODO: revisit this later
m_funcLWFormatOverride = "TransformWorldToHClip(TransformObjectToWorld({0}))";
m_funcHDFormatOverride = "TransformWorldToHClip(TransformObjectToWorld({0}))";
m_inputPorts[ 0 ].ChangeType( WirePortDataType.FLOAT3, false );
m_outputPorts[ 0 ].ChangeType( WirePortDataType.FLOAT4, false );
m_outputPorts[ 0 ].Name = "XYZW";
AddOutputPort( WirePortDataType.FLOAT, "X" );
AddOutputPort( WirePortDataType.FLOAT, "Y" );
AddOutputPort( WirePortDataType.FLOAT, "Z" );
AddOutputPort( WirePortDataType.FLOAT, "W" );
m_previewShaderGUID = "14ec765a147a53340877b489e73f1c9f";
}
protected override void OnUniqueIDAssigned()
{
base.OnUniqueIDAssigned();
m_localVarName = "unityObjectToClipPos" + OutputId;
}
}
}