initial commit
This commit is contained in:
parent
6715289efe
commit
788c3389af
37645 changed files with 2526849 additions and 80 deletions
|
@ -0,0 +1,59 @@
|
|||
using System;
|
||||
using UnityEditor.Graphing;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityEditor.ShaderGraph
|
||||
{
|
||||
[Serializable]
|
||||
class Texture3DMaterialSlot : MaterialSlot
|
||||
{
|
||||
public Texture3DMaterialSlot()
|
||||
{ }
|
||||
|
||||
public Texture3DMaterialSlot(
|
||||
int slotId,
|
||||
string displayName,
|
||||
string shaderOutputName,
|
||||
SlotType slotType,
|
||||
ShaderStageCapability shaderStageCapability = ShaderStageCapability.All,
|
||||
bool hidden = false)
|
||||
: base(slotId, displayName, shaderOutputName, slotType, shaderStageCapability, hidden)
|
||||
{ }
|
||||
|
||||
[SerializeField]
|
||||
bool m_BareResource = false;
|
||||
internal override bool bareResource
|
||||
{
|
||||
get { return m_BareResource; }
|
||||
set { m_BareResource = value; }
|
||||
}
|
||||
|
||||
public override void AppendHLSLParameterDeclaration(ShaderStringBuilder sb, string paramName)
|
||||
{
|
||||
if (m_BareResource)
|
||||
{
|
||||
sb.Append("TEXTURE3D(");
|
||||
sb.Append(paramName);
|
||||
sb.Append(")");
|
||||
}
|
||||
else
|
||||
base.AppendHLSLParameterDeclaration(sb, paramName);
|
||||
}
|
||||
|
||||
public override SlotValueType valueType { get { return SlotValueType.Texture3D; } }
|
||||
public override ConcreteSlotValueType concreteValueType { get { return ConcreteSlotValueType.Texture3D; } }
|
||||
public override bool isDefaultValue => true;
|
||||
|
||||
public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode)
|
||||
{ }
|
||||
|
||||
public override void CopyValuesFrom(MaterialSlot foundSlot)
|
||||
{
|
||||
var slot = foundSlot as Texture3DMaterialSlot;
|
||||
if (slot != null)
|
||||
{
|
||||
m_BareResource = slot.m_BareResource;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue