public override void SetSunLight(SunLight light) { if (!isLightingAlreadySet) { device.ShaderEffect.AmbientLightColor = Vector3.One * AmbientLightIntensity; isLightingAlreadySet = true; } device.ShaderEffect.DirectionalLight0.DiffuseColor = new Vector3(light.Color.RedValue, light.Color.GreenValue, light.Color.BlueValue); device.ShaderEffect.DirectionalLight0.Direction = new Vector3(-light.Direction.X, -light.Direction.Y, -light.Direction.Z); }
public override void SetSunLight(SunLight light) { shaderValues.LightDirection = new[] { light.Direction.X, light.Direction.Y, light.Direction.Z, 0.0f }; shaderValues.LightColor = new[] { light.Color.RedValue, light.Color.GreenValue, light.Color.BlueValue, light.Color.AlphaValue }; }
public override void SetSunLight(SunLight light) {}
public abstract void SetSunLight(SunLight light);
public override void SetSunLight(SunLight light) { device.SetUniformValue(viewMatrixLocation, viewMatrix); device.SetUniformValue(normalMatrixLocation, Matrix.InverseTranspose(modelViewMatrix)); SetUniformColorValue(lightColorUniformLocation, light.Color); device.SetUniformValue(lightDirectionUniformLocation, light.Direction); }