Example #1
0
 /// <summary>
 /// Creates a dynamic parameter key for texel size updated from the texture size.
 /// </summary>
 /// <param name="textureKey">Key of the texture to take the size from</param>
 /// <returns>A dynamic TexelSize parameter key updated according to the specified texture</returns>
 public static ParameterKey <Vector2> CreateDynamicTexelSizeParameterKey(ParameterKey <Texture> textureKey)
 {
     if (textureKey == null)
     {
         throw new ArgumentNullException("textureKey");
     }
     return(ParameterKeys.NewDynamic(ParameterDynamicValue.New <Vector2, Texture>(textureKey, UpdateTexelSize)));
 }
Example #2
0
 static TransformationKeys()
 {
     View                = ParameterKeys.Value(Matrix.Identity);
     Projection          = ParameterKeys.Value(Matrix.Identity);
     World               = ParameterKeys.Value(Matrix.Identity);
     ViewProjection      = ParameterKeys.Value(ParameterDynamicValue.New <Matrix, Matrix, Matrix>(View, Projection, Matrix.Multiply));
     WorldView           = ParameterKeys.Value(ParameterDynamicValue.New <Matrix, Matrix, Matrix>(World, View, Matrix.Multiply));
     WorldViewProjection = ParameterKeys.Value(ParameterDynamicValue.New <Matrix, Matrix, Matrix>(World, ViewProjection, Matrix.Multiply));
     ProjScreenRay       = ParameterKeys.Value(ParameterDynamicValue.New <Vector2, Matrix>(Projection, ExtractProjScreenRay));
     Eye              = ParameterKeys.Value(ParameterDynamicValue.New <Vector4, Matrix>(View, ViewToEye));
     ViewInverse      = ParameterKeys.Value(ParameterDynamicValue.New <Matrix, Matrix>(View, InvertMatrix));
     WorldViewInverse = ParameterKeys.Value(ParameterDynamicValue.New <Matrix, Matrix>(WorldView, InvertMatrix));
 }
Example #3
0
 static CameraKeys()
 {
     ZProjection = ParameterKeys.NewDynamic(ParameterDynamicValue.New <Vector2, float, float>(NearClipPlane, FarClipPlane, ZProjectionACalculate));
 }
Example #4
0
 static MaterialKeys()
 {
     SpecularPowerScaled = ParameterKeys.NewDynamic(ParameterDynamicValue.New <float, float>(SpecularPower, ScaleSpecularPower));
 }