mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +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:
parent
8cf450c16b
commit
48ffd3d157
1 changed files with 2 additions and 2 deletions
|
@ -159,8 +159,8 @@ void main() {
|
|||
|
||||
if (depth > z_to) {
|
||||
// if depth was surpassed
|
||||
if (depth <= max(z_to, z_from) + depth_tolerance) {
|
||||
// check the depth tolerance
|
||||
if ((depth <= max(z_to, z_from) + depth_tolerance) && (-depth < camera_z_far)) {
|
||||
// check the depth tolerance and far clip
|
||||
found = true;
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue