diff --git a/Migration.md b/Migration.md index c02192894..d65899954 100644 --- a/Migration.md +++ b/Migration.md @@ -37,6 +37,9 @@ release will remove the deprecated code. `Node::UserData` now returns no data for keys that don't exist (prior to Rendering 6.x, if `Visual::UserData` was called with a key that doesn't exist, an `int` was returned by default). +1. **depth_camera_fs.glsl** and **depth_camera_final_fs.glsl** + + Far clipping changed from clipping by depth to clipping by range, i.e. distance to point, so that the data generated will never exceed the specified max range of the camera. + ## Ignition Rendering 4.0 to 4.1 ## ABI break diff --git a/ogre2/src/media/materials/programs/depth_camera_final_fs.glsl b/ogre2/src/media/materials/programs/depth_camera_final_fs.glsl index ef5eec270..fd5ad7db2 100644 --- a/ogre2/src/media/materials/programs/depth_camera_final_fs.glsl +++ b/ogre2/src/media/materials/programs/depth_camera_final_fs.glsl @@ -50,7 +50,7 @@ void main() // to be outside of min/max range // clamp xyz - if (point.x > far - tolerance) + if (!isinf(point.x) && length(point) > far - tolerance) { if (isinf(max)) { diff --git a/ogre2/src/media/materials/programs/depth_camera_fs.glsl b/ogre2/src/media/materials/programs/depth_camera_fs.glsl index dd9a894ca..6163b43c3 100644 --- a/ogre2/src/media/materials/programs/depth_camera_fs.glsl +++ b/ogre2/src/media/materials/programs/depth_camera_fs.glsl @@ -139,7 +139,7 @@ void main() } // clamp xyz and set rgb to background color - if (point.x > far - tolerance) + if (length(point) > far - tolerance) { if (isinf(max)) {