mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00:00
glsl: Properly implement shadow filtering when running emulated shadow compare
- Previous code was completely borked
This commit is contained in:
parent
e8274d5a59
commit
e9cdb248a0
1 changed files with 6 additions and 3 deletions
|
@ -691,10 +691,13 @@ namespace glsl
|
|||
OS <<
|
||||
"vec4 shadowCompare(sampler2D tex, const in vec3 p, const in uint func)\n"
|
||||
"{\n"
|
||||
" vec4 samples = textureGather(tex, p.xy).xxxx;\n"
|
||||
" vec4 ref = clamp(p.z, 0., 1.).xxxx;\n"
|
||||
" vec4 samples = textureGather(tex, p.xy, 0);\n"
|
||||
" float advance_x = dFdx(p).z;\n"
|
||||
" float advance_y = -dFdy(p).z;\n"
|
||||
" vec4 off = vec4(advance_y, (advance_x + advance_y), advance_x, 0.);\n"
|
||||
" vec4 ref = clamp(off + p.z, 0., 1.);\n"
|
||||
" vec4 filtered = vec4(comparison_passes(samples, ref, func));\n"
|
||||
" return filtered * dot(filtered, vec4(0.25f));\n"
|
||||
" return dot(filtered, vec4(0.25f)).xxxx;\n"
|
||||
"}\n\n"
|
||||
|
||||
"vec4 shadowCompareProj(sampler2D tex, const in vec4 p, const in uint func)\n"
|
||||
|
|
Loading…
Add table
Reference in a new issue