diff --git a/objects/OMain/Create_0.gml b/objects/OMain/Create_0.gml index c37c59f..4f8698b 100644 --- a/objects/OMain/Create_0.gml +++ b/objects/OMain/Create_0.gml @@ -23,23 +23,32 @@ renderer.add(global.terrain); // Call terrain's `render` automatically // Add post-processing effects // postProcessor = new BBMOD_PostProcessor(); -// Note: This is a small bias and it's going to cause fireflies! -postProcessor.add_effect(new BBMOD_LightBloomEffect(new BBMOD_Vec3(-0.2))); +renderer.PostProcessor = postProcessor; + +directionalBlur = new BBMOD_DirectionalBlurEffect(); +postProcessor.add_effect(directionalBlur); + +radialBlur = new BBMOD_RadialBlurEffect(); +postProcessor.add_effect(radialBlur); + postProcessor.add_effect(new BBMOD_ExposureEffect()); -postProcessor.add_effect(new BBMOD_GammaCorrectEffect()); +postProcessor.add_effect(new BBMOD_LightBloomEffect(new BBMOD_Vec3(-1))); postProcessor.add_effect(new BBMOD_ReinhardTonemapEffect()); +postProcessor.add_effect(new BBMOD_GammaCorrectEffect()); postProcessor.add_effect(new BBMOD_LensFlaresEffect()); postProcessor.add_effect(new BBMOD_ColorGradingEffect(sprite_get_texture(SprColorGrading, 0))); +postProcessor.add_effect(new BBMOD_LumaSharpenEffect(2)); +postProcessor.add_effect(new BBMOD_FilmGrainEffect(0.05)); postProcessor.add_effect(new BBMOD_ChromaticAberrationEffect(4)); postProcessor.add_effect(new BBMOD_VignetteEffect(1)); postProcessor.add_effect(new BBMOD_FXAAEffect()); -renderer.PostProcessor = postProcessor; //////////////////////////////////////////////////////////////////////////////// // // Create camera // z = 0; +zprevious = z; camera = new BBMOD_Camera(); camera.Exposure = 2; camera.FollowObject = self; @@ -150,6 +159,7 @@ physicsWorld.align_terrain(global.terrain, terrainCollider); // Create jeep // steering = 0; +velocity = new BBMOD_Vec3(); wheelInContact = array_create(4, false); // diff --git a/objects/OMain/Step_0.gml b/objects/OMain/Step_0.gml index 01905cd..eb14054 100644 --- a/objects/OMain/Step_0.gml +++ b/objects/OMain/Step_0.gml @@ -67,6 +67,11 @@ jeepLight2.Direction.Set(_lightDir.X, _lightDir.Y, _lightDir.Z).NormalizeSelf(); jeepLensFlare2.Position = jeepLight2.Position.Clone(); jeepLensFlare2.Direction = jeepLight2.Direction.Clone(); +// Remember previous position +xprevious = x; +yprevious = y; +zprevious = z; + // Move this object to the jeep's position x = _matrix[12]; y = _matrix[13]; @@ -112,3 +117,19 @@ if (camera.Position.Z < _cameraHeight) // target after we call its update method. camera.update_matrices(); } + +//////////////////////////////////////////////////////////////////////////////// +// +// Update blur strength +// +if (global.gameSpeed > 0) +{ + velocity.Set(x - xprevious, y - yprevious, z - zprevious); +} + +var _cam = camera.get_forward(); +var _strength = clamp(velocity.Length() / 10, 0, 1); +var _absDot = abs(_cam.Dot(velocity.Normalize())); + +directionalBlur.Vector.Set((1 - _absDot) * _strength * 64, 0); +radialBlur.Strength = _absDot * _strength;