1using System.Globalization;
108 throw new InvalidOperationException(
"Invalid instances count.");
114 public ModelShader(
string vsc,
string psc,
bool useAlphaThreshold,
int maxInstancesCount = 1) : base(
123 public ModelShader(
string vsc,
string psc,
bool useAlphaThreshold,
int maxInstancesCount = 1,
ShaderMacro[] shaderMacros =
null) : base(
159 List<ShaderMacro> list =
new();
160 if (useAlphaThreshold) {
163 list.Add(
new ShaderMacro(
"MAX_INSTANCES_COUNT", maxInstancesCount.ToString(CultureInfo.InvariantCulture)));
164 if (shaderMacros !=
null
165 && shaderMacros.Length > 0) {
166 foreach (
ShaderMacro shaderMacro
in shaderMacros) {
167 list.Add(shaderMacro);
170 return list.ToArray();
virtual ShaderParameter GetParameter(string name, bool allowNull=false)
Vector3 AmbientLightColor
ShaderParameter m_fogYMultiplierParameter
ShaderParameter m_ambientLightColorParameter
virtual void SetParameter()
ShaderParameter m_samplerStateParameter
ShaderParameter m_alphaThresholdParameter
ShaderParameter m_worldMatrixParameter
ShaderParameter m_fogColorParameter
SamplerState SamplerState
ShaderParameter m_diffuseLightColor1Parameter
ShaderParameter m_hazeStartDensityParameter
ShaderParameter m_directionToLight2Parameter
ShaderParameter m_directionToLight1Parameter
ShaderParameter m_emissionColorParameter
ShaderParameter m_textureParameter
static ShaderMacro[] PrepareShaderMacros(bool useAlphaThreshold, int maxInstancesCount, ShaderMacro[] shaderMacros=null)
Vector3 DiffuseLightColor1
ShaderParameter m_fogBottomTopDensityParameter
ModelShader(string vsc, string psc, bool useAlphaThreshold, int maxInstancesCount=1)
ShaderParameter m_materialColorParameter
ShaderParameter m_worldUpParameter
Vector3 DiffuseLightColor2
ShaderParameter m_diffuseLightColor2Parameter
override void PrepareForDrawingOverride()
ModelShader(string vsc, string psc, bool useAlphaThreshold, int maxInstancesCount=1, ShaderMacro[] shaderMacros=null)
Vector3 FogBottomTopDensity
ShaderParameter m_worldViewProjectionMatrixParameter