Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
34ddb7ac
Unverified
Commit
34ddb7ac
authored
Dec 21, 2019
by
Rémi Verschelde
Committed by
GitHub
Dec 21, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #34519 from MadEqua/fix-contact-shadows
Fix contact shadow when light is outside of viewport.
parents
58c07f27
d7f9d71b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
scene.glsl
drivers/gles3/shaders/scene.glsl
+14
-10
No files found.
drivers/gles3/shaders/scene.glsl
View file @
34ddb7ac
...
@@ -897,18 +897,22 @@ float contact_shadow_compute(vec3 pos, vec3 dir, float max_distance) {
...
@@ -897,18 +897,22 @@ float contact_shadow_compute(vec3 pos, vec3 dir, float max_distance) {
bias
+=
incr
*
2
.
0
;
bias
+=
incr
*
2
.
0
;
vec3
uv_depth
=
(
source
.
xyz
/
source
.
w
)
*
0
.
5
+
0
.
5
;
vec3
uv_depth
=
(
source
.
xyz
/
source
.
w
)
*
0
.
5
+
0
.
5
;
float
depth
=
texture
(
depth_buffer
,
uv_depth
.
xy
).
r
;
if
(
uv_depth
.
x
>
0
.
0
&&
uv_depth
.
x
<
1
.
0
&&
uv_depth
.
y
>
0
.
0
&&
uv_depth
.
y
<
1
.
0
)
{
float
depth
=
texture
(
depth_buffer
,
uv_depth
.
xy
).
r
;
if
(
depth
<
uv_depth
.
z
)
{
if
(
depth
>
(
bias
.
z
/
bias
.
w
)
*
0
.
5
+
0
.
5
)
{
if
(
depth
<
uv_depth
.
z
)
{
return
min
(
pow
(
ratio
,
4
.
0
),
1
.
0
);
if
(
depth
>
(
bias
.
z
/
bias
.
w
)
*
0
.
5
+
0
.
5
)
{
}
else
{
return
min
(
pow
(
ratio
,
4
.
0
),
1
.
0
);
return
1
.
0
;
}
else
{
return
1
.
0
;
}
}
}
}
ratio
+=
ratio_incr
;
ratio
+=
ratio_incr
;
steps
-=
1
.
0
;
steps
-=
1
.
0
;
}
else
{
return
1
.
0
;
}
}
}
return
1
.
0
;
return
1
.
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment