26 lines
609 B
C#
26 lines
609 B
C#
|
|
using Godot;
|
||
|
|
|
||
|
|
namespace Rokojori
|
||
|
|
{
|
||
|
|
[Tool]
|
||
|
|
[GlobalClass]
|
||
|
|
public partial class OrientatedFlareChromaticAberation:FlareChromaticAberation
|
||
|
|
{
|
||
|
|
public enum FlareOrientation
|
||
|
|
{
|
||
|
|
Inside,
|
||
|
|
Outside
|
||
|
|
}
|
||
|
|
|
||
|
|
[Export]
|
||
|
|
public FlareOrientation orientation = FlareOrientation.Inside;
|
||
|
|
|
||
|
|
public override void ApplyChromaticAberation( FlareLayer.Data data )
|
||
|
|
{
|
||
|
|
ApplyChromaticAberationBase( data );
|
||
|
|
|
||
|
|
var material = data.material;
|
||
|
|
BaseFlareShader.chromaticAberationDirectionTowardsCenter.Set( material, orientation == FlareOrientation.Inside ? 1f : -1f );
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|