public static void SetStandardEffect(ref Effect effect, LightMaterial material, Matrix world) { effect.Parameters["enableFog"].SetValue(true); effect.Parameters["fogStart"].SetValue(450f - FogThickness); effect.Parameters["fogEnd"].SetValue(700f - FogThickness); effect.Parameters["fogColor"].SetValue(FogColor); effect.Parameters["ViewPosition"].SetValue(Camera.Position); effect.Parameters["LightDir"].SetValue(SunPosition); effect.Parameters["LightColor"].SetValue(SunColor); effect.Parameters["materialEmissive"].SetValue(material.Emissive); effect.Parameters["materialAmbient"].SetValue(material.Ambient); effect.Parameters["materialDiffuse"].SetValue(material.Diffuse); effect.Parameters["materialSpecular"].SetValue(material.Specular); effect.Parameters["materialSpecPower"].SetValue(material.Power); effect.Parameters["World"].SetValue(world); effect.Parameters["WorldIT"].SetValue(Matrix.Transpose(Matrix.Invert(world))); effect.Parameters["ViewProjection"].SetValue(Camera.View * Camera.Projection); }