using Godot;

namespace Rokojori
{  
  [Tool]
  [GlobalClass]
  public partial class TextureFlareFading:FlareFading
  {
    // [Export( PropertyHint.Range, "0,1" ) ]
    // public float fading = 0.1f;
    [Export]
    public Texture2D fadingTexture;


    // [Export( PropertyHint.Range, "0,1" ) ]
    // public float opacity = 1f;
    [Export]
    public Texture2D opacityTexture;


    // [Export( PropertyHint.Range, "0,1" ) ]
    // public float sizeX = 1f;
    [Export]
    public Texture2D sizeXTexture;


    // [Export( PropertyHint.Range, "0,1" ) ]
    // public float sizeY = 1f;
    [Export]
    public Texture2D sizeYTexture;


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

      BaseFlareShader.fadingMode.Set( material, 2 );

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

      BaseFlareShader.fading.Set( material, fadingTexture );
      BaseFlareShader.opacityFading.Set( material, opacityTexture );
      BaseFlareShader.sizeXfading.Set( material, sizeXTexture );
      BaseFlareShader.sizeYfading.Set( material, sizeYTexture );
    }
  }
}