Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
NodeParameter.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System.ComponentModel;
4 
5 using SiliconStudio.Core;
6 using SiliconStudio.Core.Mathematics;
7 using SiliconStudio.Paradox.Effects;
8 using SiliconStudio.Paradox.Graphics;
9 
10 namespace SiliconStudio.Paradox.Assets.Materials
11 {
12  public interface INodeParameter
13  {
14  }
15 
16  public interface ITextureNodeReference
17  {
18  string Reference { get; set; }
19  }
20 
21  [DataContract("NodeParameter")]
23  {
24  [DataMember(10)]
25  public string Reference { get; set; }
26 
27  public NodeParameter()
28  {
29  Reference = "";
30  }
31  }
32 
33  [DataContract("NodeParameterTexture")]
35  {
36  }
37 
38  [DataContract("")]
39  public abstract class NodeParameterValue<T> : INodeParameter
40  {
41  [DataMember(10)]
42  public T Value { get; set; }
43 
44  protected NodeParameterValue()
45  {
46  }
47  }
48 
49  [DataContract("NodeParameterFloat")]
50  public class NodeParameterFloat : NodeParameterValue<float>
51  {
53  : base()
54  {
55  Value = 0.0f;
56  }
57  }
58 
59  [DataContract("NodeParameterInt")]
60  public class NodeParameterInt : NodeParameterValue<int>
61  {
63  : base()
64  {
65  Value = 0;
66  }
67  }
68 
69  [DataContract("NodeParameterFloat2")]
70  public class NodeParameterFloat2 : NodeParameterValue<Vector2>
71  {
73  : base()
74  {
75  Value = Vector2.Zero;
76  }
77  }
78 
79  [DataContract("NodeParameterFloat3")]
80  public class NodeParameterFloat3 : NodeParameterValue<Vector3>
81  {
83  : base()
84  {
85  Value = Vector3.Zero;
86  }
87  }
88 
89  [DataContract("NodeParameterFloat4")]
90  public class NodeParameterFloat4 : NodeParameterValue<Vector4>
91  {
93  : base()
94  {
95  Value = Vector4.Zero;
96  }
97  }
98 
99  [DataContract("NodeParameterSampler")]
101  {
102  /// <summary>
103  /// The texture filtering mode.
104  /// </summary>
105  [DataMember(10)]
106  [DefaultValue(TextureFilter.Linear)]
107  public TextureFilter Filtering { get; set; }
108 
109  /// <summary>
110  /// The texture address mode.
111  /// </summary>
112  [DataMember(20)]
113  [DefaultValue(TextureAddressMode.Wrap)]
114  public TextureAddressMode AddressModeU { get; set; }
115 
116  /// <summary>
117  /// The texture address mode.
118  /// </summary>
119  [DataMember(30)]
120  [DefaultValue(TextureAddressMode.Wrap)]
121  public TextureAddressMode AddressModeV { get; set; }
122 
123  /// <summary>
124  /// The sampler key used in the shader.
125  /// </summary>
126  [DataMemberIgnore]
127  public ParameterKey<SamplerState> SamplerParameterKey { get; set; }
128 
130  {
131  Filtering = TextureFilter.Linear;
132  AddressModeU = TextureAddressMode.Wrap;
133  AddressModeV = TextureAddressMode.Wrap;
134  }
135  }
136 }
Key of an effect parameter.
Definition: ParameterKey.cs:15
TextureAddressMode
Identify a technique for resolving texture coordinates that are outside of the boundaries of a textur...
TextureFilter
Filtering options during texture sampling.