42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
|
|
using Godot;
|
||
|
|
using System.Reflection;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
|
||
|
|
using Rokojori.Extensions;
|
||
|
|
namespace Rokojori
|
||
|
|
{
|
||
|
|
/** The sampler2DArray counterpart to Sampler2DPropertyName.
|
||
|
|
|
||
|
|
Needed by the control-map terrain, which addresses its ground textures by
|
||
|
|
index rather than by slot - see Shading/Library/ControlMap.gdshaderinc.
|
||
|
|
*/
|
||
|
|
[Tool]
|
||
|
|
[GlobalClass]
|
||
|
|
public partial class Sampler2DArrayPropertyName : ShaderPropertyName
|
||
|
|
{
|
||
|
|
public override RenderingServer.GlobalShaderParameterType GetParameterType()
|
||
|
|
{
|
||
|
|
// Sampler2Darray, not Sampler2DArray - the binding generator reads
|
||
|
|
// SAMPLER2DARRAY as a single token, so only the first letter is capital.
|
||
|
|
return RenderingServer.GlobalShaderParameterType.Sampler2Darray;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void Set( Material material, Texture2DArray value )
|
||
|
|
{
|
||
|
|
_Set( material, value );
|
||
|
|
}
|
||
|
|
|
||
|
|
public Texture2DArray Get( Material material )
|
||
|
|
{
|
||
|
|
return _Get<Texture2DArray>( material, null );
|
||
|
|
}
|
||
|
|
|
||
|
|
public static Sampler2DArrayPropertyName Create( string name )
|
||
|
|
{
|
||
|
|
var t = new Sampler2DArrayPropertyName();
|
||
|
|
t.propertyName = name;
|
||
|
|
return t;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|