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 );
    }
  }
}