Skip to content

Commit afa2270

Browse files
Lobotuerkiche033
andauthored
Changed calculation for range clipping (#325)
* changed calculation for depht Signed-off-by: Tomas Lorente <[email protected]> * Ian comments Signed-off-by: Tomas Lorente <[email protected]> * test fix Signed-off-by: Tomas Lorente <[email protected]> * fix test Signed-off-by: Tomas Lorente <[email protected]> * updated tests and migration Signed-off-by: Tomas Lorente <[email protected]> * tweak to migration guide Signed-off-by: Ian Chen <[email protected]> Co-authored-by: Ian Chen <[email protected]>
1 parent 16014e7 commit afa2270

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Migration.md

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ release will remove the deprecated code.
3737
`Node::UserData` now returns no data for keys that don't exist (prior to Rendering 6.x, if
3838
`Visual::UserData` was called with a key that doesn't exist, an `int` was returned by default).
3939
40+
1. **depth_camera_fs.glsl** and **depth_camera_final_fs.glsl**
41+
+ 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.
42+
4043
## Ignition Rendering 4.0 to 4.1
4144
4245
## ABI break

ogre2/src/media/materials/programs/depth_camera_final_fs.glsl

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void main()
5050
// to be outside of min/max range
5151

5252
// clamp xyz
53-
if (point.x > far - tolerance)
53+
if (!isinf(point.x) && length(point) > far - tolerance)
5454
{
5555
if (isinf(max))
5656
{

ogre2/src/media/materials/programs/depth_camera_fs.glsl

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void main()
139139
}
140140

141141
// clamp xyz and set rgb to background color
142-
if (point.x > far - tolerance)
142+
if (length(point) > far - tolerance)
143143
{
144144
if (isinf(max))
145145
{

0 commit comments

Comments
 (0)