rj-action-library/Runtime/Shading/Shaders/Effects/FresnelOverlay/FresnelOverlay.cs

49 lines
2.1 KiB
C#

using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Text;
using Godot;
namespace Rokojori
{
public class FresnelOverlay
{
public static readonly CachedResource<Shader> shader = new CachedResource<Shader>(
"res://addons/rokojori_action_library/Runtime/Shading/Shaders/Effects/FresnelOverlay/FresnelOverlay.gdshader"
);
public static readonly ColorPropertyName albedo = ColorPropertyName.Create( "albedo" );
public static readonly Texture2DPropertyName textureAlbedo = Texture2DPropertyName.Create( "texture_albedo" );
public static readonly FloatPropertyName grow = FloatPropertyName.Create( "grow" );
public static readonly FloatPropertyName fresnelSharpness = FloatPropertyName.Create( "fresnelSharpness" );
public static readonly FloatPropertyName fresnelMultiply = FloatPropertyName.Create( "fresnelMultiply" );
public static readonly FloatPropertyName fresnelOffset = FloatPropertyName.Create( "fresnelOffset" );
}
public partial class FresnelOverlayMaterial:CustomMaterial
{
public readonly CustomMaterialProperty<Color> albedo;
public readonly CustomMaterialProperty<Texture2D> textureAlbedo;
public readonly CustomMaterialProperty<float> grow;
public readonly CustomMaterialProperty<float> fresnelSharpness;
public readonly CustomMaterialProperty<float> fresnelMultiply;
public readonly CustomMaterialProperty<float> fresnelOffset;
public FresnelOverlayMaterial()
{
Shader = FresnelOverlay.shader.Get();
albedo = new CustomMaterialProperty<Color>( this, FresnelOverlay.albedo );
textureAlbedo = new CustomMaterialProperty<Texture2D>( this, FresnelOverlay.textureAlbedo );
grow = new CustomMaterialProperty<float>( this, FresnelOverlay.grow );
fresnelSharpness = new CustomMaterialProperty<float>( this, FresnelOverlay.fresnelSharpness );
fresnelMultiply = new CustomMaterialProperty<float>( this, FresnelOverlay.fresnelMultiply );
fresnelOffset = new CustomMaterialProperty<float>( this, FresnelOverlay.fresnelOffset );
}
}
}