You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
2.3 KiB
60 lines
2.3 KiB
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
using UnityEngine;
|
|
|
|
namespace UnityEditor.VFX
|
|
{
|
|
[VFXHelpURL("Context-OutputForwardDecal")]
|
|
[VFXInfo(name = "Output Particle Forward Decal", category = "Output")]
|
|
class VFXDecalOutput : VFXAbstractParticleOutput
|
|
{
|
|
public override string name { get { return "Output Particle Forward Decal"; } }
|
|
public override string codeGeneratorTemplate { get { return RenderPipeTemplate("VFXParticleDecal"); } }
|
|
public override VFXTaskType taskType { get { return VFXTaskType.ParticleHexahedronOutput; } }
|
|
public override bool supportsUV { get { return true; } }
|
|
public override CullMode defaultCullMode { get { return CullMode.Back; } }
|
|
public override bool hasShadowCasting { get { return false; } }
|
|
public override bool supportSoftParticles { get { return false; } }
|
|
protected override IEnumerable<VFXPropertyWithValue> inputProperties
|
|
{
|
|
get
|
|
{
|
|
foreach (var input in base.inputProperties)
|
|
yield return input;
|
|
|
|
yield return new VFXPropertyWithValue(new VFXProperty(GetFlipbookType(), "mainTexture", new TooltipAttribute("Specifies the base color (RGB) and opacity (A) of the particle.")), (usesFlipbook ? null : VFXResources.defaultResources.particleTexture));
|
|
}
|
|
}
|
|
|
|
public override void OnEnable()
|
|
{
|
|
base.OnEnable();
|
|
cullMode = CullMode.Back;
|
|
zTestMode = ZTestMode.LEqual;
|
|
zWriteMode = ZWriteMode.Off;
|
|
}
|
|
|
|
protected override IEnumerable<string> filteredOutSettings
|
|
{
|
|
get
|
|
{
|
|
foreach (var setting in base.filteredOutSettings)
|
|
yield return setting;
|
|
|
|
yield return "cullMode";
|
|
yield return "zWriteMode";
|
|
yield return "zTestMode";
|
|
yield return "castShadows";
|
|
}
|
|
}
|
|
|
|
protected override IEnumerable<VFXNamedExpression> CollectGPUExpressions(IEnumerable<VFXNamedExpression> slotExpressions)
|
|
{
|
|
foreach (var exp in base.CollectGPUExpressions(slotExpressions))
|
|
yield return exp;
|
|
|
|
yield return slotExpressions.First(o => o.name == "mainTexture");
|
|
}
|
|
}
|
|
}
|