public override void Draw(DeviceContext context, int index) { CBPerFrame.Values.ViewProjection = Matrix.Transpose(_cameraManager.ActiveCamera.ViewProjection3D); CBPerFrame.IsDirty = true; CBPerFrame.Update(context); //Send updated data to Graphical Card }
public override void Draw(DeviceContext context, int index) { CBPerFrame.Values.ViewProjection_focused = Matrix.Transpose(_cameraManager.ActiveCamera.ViewProjection3D_focused); if (_playerManager.IsHeadInsideWater) { CBPerFrame.Values.SunColor = new Color3(_skydome.SunColor.Red / 3, _skydome.SunColor.Green / 3, _skydome.SunColor.Blue); } else { CBPerFrame.Values.SunColor = _skydome.SunColor; } CBPerFrame.Values.fogdist = ((_visualWorldParam.WorldVisibleSize.X) / 2) - 48; CBPerFrame.Values.BackBufferSize = _backBuffer.SolidStaggingBackBufferSize; CBPerFrame.Values.Various.X = _playerManager.IsHeadInsideWater ? 1.0f : 0.0f; CBPerFrame.Values.Various.Y = _animationValue; //Asign animation Value (From 0 => 1 in loop); CBPerFrame.Values.ViewProjection = Matrix.Transpose(_cameraManager.ActiveCamera.ViewProjection3D); CBPerFrame.Values.CameraWorldPosition = _cameraManager.ActiveCamera.WorldPosition.ValueInterp.AsVector3(); CBPerFrame.Values.InvertedOrientation = Matrix.Transpose(Matrix.RotationQuaternion(Quaternion.Invert(_cameraManager.ActiveCamera.Orientation.ValueInterp))); CBPerFrame.Values.WeatherGlobalOffset.X = _weather.MoistureOffset; CBPerFrame.Values.WeatherGlobalOffset.Y = _weather.TemperatureOffset; switch (ClientSettings.Current.Settings.GraphicalParameters.LandscapeFog) { case "SkyFog": CBPerFrame.Values.fogType = 0.0f; break; case "SimpleFog": CBPerFrame.Values.fogType = 1.0f; break; case "NoFog": default: CBPerFrame.Values.fogType = 2.0f; break; } CBPerFrame.IsDirty = true; CBPerFrame.Update(context); //Send updated data to Graphical Card }