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

50 lines
2.5 KiB
C#
Raw Normal View History

2025-01-03 12:09:23 +00:00
using Godot;
namespace Rokojori
{
public class TriPlanarOverlay
{
public static readonly CachedResource<Shader> shader = new CachedResource<Shader>(
"res://addons/rokojori_action_library/Runtime/Shading/Shaders/Effects/TriPlanarOverlay/TriPlanarOverlay.gdshader"
);
public static readonly ColorPropertyName albedo = ColorPropertyName.Create( "albedo" );
public static readonly FloatPropertyName uvBlendSharpness = FloatPropertyName.Create( "uv_blend_sharpness" );
public static readonly Vector3PropertyName uvScale = Vector3PropertyName.Create( "uv_scale" );
public static readonly Vector3PropertyName uvOffset = Vector3PropertyName.Create( "uv_offset" );
public static readonly Vector3PropertyName uvMovement = Vector3PropertyName.Create( "uvMovement" );
public static readonly Texture2DPropertyName textureAlbedo = Texture2DPropertyName.Create( "texture_albedo" );
}
public partial class TriPlanarOverlayMaterial:CustomMaterial
{
public static readonly CachedResource<TriPlanarOverlayMaterial> BlueShield = CustomMaterial.Cached<TriPlanarOverlayMaterial>(
"res://addons/rokojori_action_library/Runtime/Shading/Shaders/Effects/TriPlanarOverlay/TriPlanarOverlay BlueShield.material"
);
public static readonly CachedResource<TriPlanarOverlayMaterial> WhiteShield = CustomMaterial.Cached<TriPlanarOverlayMaterial>(
"res://addons/rokojori_action_library/Runtime/Shading/Shaders/Effects/TriPlanarOverlay/TriPlanarOverlay WhiteShield.material"
);
public readonly CustomMaterialProperty<Color> albedo;
public readonly CustomMaterialProperty<float> uvBlendSharpness;
public readonly CustomMaterialProperty<Vector3> uvScale;
public readonly CustomMaterialProperty<Vector3> uvOffset;
public readonly CustomMaterialProperty<Vector3> uvMovement;
public readonly CustomMaterialProperty<Texture2D> textureAlbedo;
public TriPlanarOverlayMaterial()
{
Shader = TriPlanarOverlay.shader.Get();
albedo = new CustomMaterialProperty<Color>( this, TriPlanarOverlay.albedo );
uvBlendSharpness = new CustomMaterialProperty<float>( this, TriPlanarOverlay.uvBlendSharpness );
uvScale = new CustomMaterialProperty<Vector3>( this, TriPlanarOverlay.uvScale );
uvOffset = new CustomMaterialProperty<Vector3>( this, TriPlanarOverlay.uvOffset );
uvMovement = new CustomMaterialProperty<Vector3>( this, TriPlanarOverlay.uvMovement );
textureAlbedo = new CustomMaterialProperty<Texture2D>( this, TriPlanarOverlay.textureAlbedo );
}
}
}