2 using System.Collections.Generic;
3 using System.Collections.Specialized;
4 using System.ComponentModel;
6 using ScriptShader.Effects;
7 using SiliconStudio.Paradox.Engine;
9 namespace SiliconStudio.
Paradox.Effects
16 LightShaderType = light.LightShaderType;
36 PerPixelDiffuseDirectionalLights = lightBindings.Where(IsDirectionalDiffusePixel).ToArray();
37 PerPixelDirectionalLights = lightBindings.Where(IsDirectionalDiffuseSpecularPixel).ToArray();
38 PerVertexDirectionalLights = lightBindings.Where(IsDirectionalDiffuseVertex).ToArray();
39 PerVertexDiffusePixelSpecularDirectionalLights = lightBindings.Where(IsDirectionalDiffuseVertexPixelSpecular).ToArray();
42 public LightBinding[] PerPixelDiffuseDirectionalLights {
get; set; }
45 public LightBinding[] PerVertexDiffusePixelSpecularDirectionalLights {
get; set; }
51 PerPixelDiffuseDirectionalLightCount = PerPixelDiffuseDirectionalLights.Length,
52 PerPixelDirectionalLightCount = PerPixelDirectionalLights.Length,
53 PerVertexDirectionalLightCount = PerVertexDirectionalLights.Length,
54 PerVertexDiffusePixelSpecularDirectionalLightCount = PerVertexDiffusePixelSpecularDirectionalLights.Length,
60 return (x.
LightShaderType & LightShaderType.DiffuseVertexSpecularPixel) == LightShaderType.DiffuseVertexSpecularPixel;
65 return (x.
LightShaderType & LightShaderType.DiffuseVertex) == LightShaderType.DiffuseVertex;
75 return (x.
LightShaderType & LightShaderType.DiffuseSpecularPixel) == LightShaderType.DiffuseSpecularPixel;
78 public class KeyInfo : IEquatable<KeyInfo>
87 if (ReferenceEquals(null, other))
return false;
88 if (ReferenceEquals(
this, other))
return true;
89 return PerPixelDiffuseDirectionalLightCount == other.PerPixelDiffuseDirectionalLightCount
90 && PerPixelDirectionalLightCount == other.PerPixelDirectionalLightCount
91 && PerVertexDirectionalLightCount == other.PerVertexDirectionalLightCount
92 && PerVertexDiffusePixelSpecularDirectionalLightCount == other.PerVertexDiffusePixelSpecularDirectionalLightCount;
95 public override bool Equals(
object obj)
97 if (ReferenceEquals(null, obj))
return false;
98 if (ReferenceEquals(
this, obj))
return true;
99 if (obj.GetType() != this.GetType())
return false;
107 int hashCode = PerPixelDiffuseDirectionalLightCount;
108 hashCode = (hashCode * 397) ^ PerPixelDirectionalLightCount;
109 hashCode = (hashCode * 397) ^ PerVertexDirectionalLightCount;
110 hashCode = (hashCode * 397) ^ PerVertexDiffusePixelSpecularDirectionalLightCount;
Key of an effect parameter.
static bool IsDirectionalDiffuseVertexPixelSpecular(LightBinding x)
int PerPixelDirectionalLightCount
bool Equals(KeyInfo other)
LightBinding(Light light)
int PerVertexDirectionalLightCount
override int GetHashCode()
override object GenerateKey()
int PerVertexDiffusePixelSpecularDirectionalLightCount
static bool IsDirectionalDiffusePixel(LightBinding x)
static bool IsDirectionalDiffuseSpecularPixel(LightBinding x)
override bool Equals(object obj)
LightShaderType LightShaderType
Specifies LightShaderType. Might be different than Light's one, since depending on Material or HW lim...
static bool IsDirectionalDiffuseVertex(LightBinding x)
int PerPixelDiffuseDirectionalLightCount
LightingPermutation(IEnumerable< LightBinding > lightBindings)