private void CacheEffectParams(GraphicsDevice device) { ShaderProfile maxPixelShaderProfile = device.GraphicsDeviceCapabilities.MaxPixelShaderProfile; this.hasPS20 = (((maxPixelShaderProfile == ShaderProfile.PS_2_0) || (maxPixelShaderProfile == ShaderProfile.PS_2_A)) || ((maxPixelShaderProfile == ShaderProfile.PS_2_B) || (maxPixelShaderProfile == ShaderProfile.PS_3_0))) || (maxPixelShaderProfile == ShaderProfile.XPS_3_0); this.basicShaderTechnique = _effect.Techniques["BasicEffect"]; this.basicTextureParam = _effect.Parameters["BasicTexture"]; this.fogEnabledParam = _effect.Parameters["FogEnabled"]; this.fogStartParam = _effect.Parameters["FogStart"]; this.fogEndParam = _effect.Parameters["FogEnd"]; this.fogColorParam = _effect.Parameters["FogColor"]; this.worldParam = _effect.Parameters["World"]; this.viewParam = _effect.Parameters["View"]; this.projectionParam = _effect.Parameters["Projection"]; this.diffuseColorParam = _effect.Parameters["DiffuseColor"]; this.specularColorParam = _effect.Parameters["SpecularColor"]; this.emissiveColorParam = _effect.Parameters["EmissiveColor"]; this.specularPowerParam = _effect.Parameters["SpecularPower"]; this.alphaParam = _effect.Parameters["Alpha"]; this.ambientLightColorParam = _effect.Parameters["AmbientLightColor"]; this.eyePositionParam = _effect.Parameters["EyePosition"]; this.shaderIndexParam = _effect.Parameters["ShaderIndex"]; texCoordsOffsetParam = _effect.Parameters["TexCoordsOffset"]; texCoordsMultiplierParam = _effect.Parameters["TexCoordsMultiplier"]; this.light0 = new BasicDirectionalLight2(_effect.Parameters["DirLight0Direction"], _effect.Parameters["DirLight0DiffuseColor"], _effect.Parameters["DirLight0SpecularColor"]); this.light1 = new BasicDirectionalLight2(_effect.Parameters["DirLight1Direction"], _effect.Parameters["DirLight1DiffuseColor"], _effect.Parameters["DirLight1SpecularColor"]); this.light2 = new BasicDirectionalLight2(_effect.Parameters["DirLight2Direction"], _effect.Parameters["DirLight2DiffuseColor"], _effect.Parameters["DirLight2SpecularColor"]); }
internal void Copy(BasicDirectionalLight2 from) { this.enabled = from.enabled; this.cachedDiffuseColor = from.cachedDiffuseColor; this.cachedSpecularColor = from.cachedSpecularColor; this.diffuseColorParam.SetValue(this.cachedDiffuseColor); this.specularColorParam.SetValue(this.cachedSpecularColor); }