You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
Check if screen space reflection has passed far clip
Before "accepting" the reflection, check if it's within our view (prevent tracing environment and creating artifacts).
This commit is contained in:
@@ -159,8 +159,8 @@ void main() {
|
|||||||
|
|
||||||
if (depth > z_to) {
|
if (depth > z_to) {
|
||||||
// if depth was surpassed
|
// if depth was surpassed
|
||||||
if (depth <= max(z_to, z_from) + depth_tolerance) {
|
if ((depth <= max(z_to, z_from) + depth_tolerance) && (-depth < camera_z_far)) {
|
||||||
// check the depth tolerance
|
// check the depth tolerance and far clip
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user