using Godot;

namespace Rokojori
{  
  [Tool]
  [GlobalClass]
  public partial class ParametricFlareFading:FlareFading
  {
    [Export( PropertyHint.Range, "0,3" ) ]
    public float fading = 0.1f;

    [Export( PropertyHint.Range, "0,3" ) ]
    public float opacity = 0.1f;

    [Export( PropertyHint.Range, "0,3" ) ]
    public float sizeX = 0.1f;

    [Export( PropertyHint.Range, "0,3" ) ]
    public float sizeY = 0.1f;

    public override void ApplyFading( FlareLayer.Data data )
    {
      var material = data.material;

      BaseFlareShader.fadingMode.Set( material, 1 );

      BaseFlareShader.fadingPower.Set( material, fading );
      BaseFlareShader.opacityFadingPower.Set( material, opacity );
      BaseFlareShader.sizeXfadingPower.Set( material, sizeX );
      BaseFlareShader.sizeYfadingPower.Set( material, sizeY );
    }
  }
}