6 using SiliconStudio.Core.Mathematics;
7 using SiliconStudio.Paradox.Graphics;
9 namespace SiliconStudio.
Paradox.Effects.Modules
11 public partial class TexturingKeys
13 static TexturingKeys()
15 Texture0TexelSize = CreateDynamicTexelSizeParameterKey(Texture0);
16 Texture1TexelSize = CreateDynamicTexelSizeParameterKey(Texture1);
17 Texture2TexelSize = CreateDynamicTexelSizeParameterKey(Texture2);
18 Texture3TexelSize = CreateDynamicTexelSizeParameterKey(Texture3);
19 Texture4TexelSize = CreateDynamicTexelSizeParameterKey(Texture4);
20 Texture5TexelSize = CreateDynamicTexelSizeParameterKey(Texture5);
21 Texture6TexelSize = CreateDynamicTexelSizeParameterKey(Texture6);
22 Texture7TexelSize = CreateDynamicTexelSizeParameterKey(Texture7);
23 Texture8TexelSize = CreateDynamicTexelSizeParameterKey(Texture8);
24 Texture9TexelSize = CreateDynamicTexelSizeParameterKey(Texture9);
34 if (textureKey == null)
throw new ArgumentNullException(
"textureKey");
35 return ParameterKeys.NewDynamic(ParameterDynamicValue.New<
Vector2,
Texture>(textureKey, UpdateTexelSize));
43 private static void UpdateTexelSize(ref
Texture param1, ref
Vector2 output)
45 output = (param1 != null) ?
new Vector2(param1.Width, param1.Height) : Vector2.Zero;
Key of an effect parameter.
SiliconStudio.Paradox.Games.Mathematics.Vector2 Vector2
static ParameterKey< Vector2 > CreateDynamicTexelSizeParameterKey(ParameterKey< Texture > textureKey)
Creates a dynamic parameter key for texel size updated from the texture size.
Represents a two dimensional mathematical vector.
Base class for texture resources.