57 lines
3.0 KiB
C#
57 lines
3.0 KiB
C#
using Godot;
|
|
|
|
namespace Rokojori
|
|
{
|
|
public class FadeWipe
|
|
{
|
|
public static readonly CachedResource<Shader> shader = new CachedResource<Shader>(
|
|
"res://addons/rokojori_action_library/Runtime/Shading/Shaders/Wipes/FadeWipe/FadeWipe.gdshader"
|
|
);
|
|
|
|
public static readonly FloatPropertyName wipeState = FloatPropertyName.Create( "wipeState" );
|
|
public static readonly Vector2PropertyName outputViewSize = Vector2PropertyName.Create( "outputViewSize" );
|
|
public static readonly Vector2PropertyName wipeTextureSize = Vector2PropertyName.Create( "wipeTextureSize" );
|
|
public static readonly ColorPropertyName wipeTextureTint = ColorPropertyName.Create( "wipeTextureTint" );
|
|
public static readonly FloatPropertyName uvRotation = FloatPropertyName.Create( "uvRotation" );
|
|
public static readonly Vector2PropertyName uvRotationCenter = Vector2PropertyName.Create( "uvRotationCenter" );
|
|
public static readonly FloatPropertyName uvScale = FloatPropertyName.Create( "uvScale" );
|
|
public static readonly Vector2PropertyName uvScaleCenter = Vector2PropertyName.Create( "uvScaleCenter" );
|
|
public static readonly Vector2PropertyName uvTranslation = Vector2PropertyName.Create( "uvTranslation" );
|
|
public static readonly Texture2DPropertyName wipeTexture = Texture2DPropertyName.Create( "wipeTexture" );
|
|
|
|
}
|
|
|
|
public partial class FadeWipeMaterial:CustomMaterial
|
|
{
|
|
|
|
|
|
public readonly CustomMaterialProperty<float> wipeState;
|
|
public readonly CustomMaterialProperty<Vector2> outputViewSize;
|
|
public readonly CustomMaterialProperty<Vector2> wipeTextureSize;
|
|
public readonly CustomMaterialProperty<Color> wipeTextureTint;
|
|
public readonly CustomMaterialProperty<float> uvRotation;
|
|
public readonly CustomMaterialProperty<Vector2> uvRotationCenter;
|
|
public readonly CustomMaterialProperty<float> uvScale;
|
|
public readonly CustomMaterialProperty<Vector2> uvScaleCenter;
|
|
public readonly CustomMaterialProperty<Vector2> uvTranslation;
|
|
public readonly CustomMaterialProperty<Texture2D> wipeTexture;
|
|
|
|
public FadeWipeMaterial()
|
|
{
|
|
Shader = FadeWipe.shader.Get();
|
|
|
|
wipeState = new CustomMaterialProperty<float>( this, FadeWipe.wipeState );
|
|
outputViewSize = new CustomMaterialProperty<Vector2>( this, FadeWipe.outputViewSize );
|
|
wipeTextureSize = new CustomMaterialProperty<Vector2>( this, FadeWipe.wipeTextureSize );
|
|
wipeTextureTint = new CustomMaterialProperty<Color>( this, FadeWipe.wipeTextureTint );
|
|
uvRotation = new CustomMaterialProperty<float>( this, FadeWipe.uvRotation );
|
|
uvRotationCenter = new CustomMaterialProperty<Vector2>( this, FadeWipe.uvRotationCenter );
|
|
uvScale = new CustomMaterialProperty<float>( this, FadeWipe.uvScale );
|
|
uvScaleCenter = new CustomMaterialProperty<Vector2>( this, FadeWipe.uvScaleCenter );
|
|
uvTranslation = new CustomMaterialProperty<Vector2>( this, FadeWipe.uvTranslation );
|
|
wipeTexture = new CustomMaterialProperty<Texture2D>( this, FadeWipe.wipeTexture );
|
|
}
|
|
|
|
}
|
|
|
|
} |