Merge pull request #45326 from clayjohn/VULKAN-ign-shadows
Use Interleaved gradient noise for shadow samples
This commit is contained in:
commit
32dec4accd
@ -799,13 +799,11 @@ LIGHT_SHADER_CODE
|
|||||||
|
|
||||||
#ifndef USE_NO_SHADOWS
|
#ifndef USE_NO_SHADOWS
|
||||||
|
|
||||||
// Produces cheap white noise, optimized for window-space
|
// Interleaved Gradient Noise
|
||||||
// Comes from: https://www.shadertoy.com/view/4djSRW
|
// http://www.iryoku.com/next-generation-post-processing-in-call-of-duty-advanced-warfare
|
||||||
// Copyright: Dave Hoskins, MIT License
|
|
||||||
float quick_hash(vec2 pos) {
|
float quick_hash(vec2 pos) {
|
||||||
vec3 p3 = fract(vec3(pos.xyx) * .1031);
|
const vec3 magic = vec3(0.06711056f, 0.00583715f, 52.9829189f);
|
||||||
p3 += dot(p3, p3.yzx + 33.33);
|
return fract(magic.z * fract(dot(pos, magic.xy)));
|
||||||
return fract((p3.x + p3.y) * p3.z);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float sample_directional_pcf_shadow(texture2D shadow, vec2 shadow_pixel_size, vec4 coord) {
|
float sample_directional_pcf_shadow(texture2D shadow, vec2 shadow_pixel_size, vec4 coord) {
|
||||||
|
Loading…
Reference in New Issue
Block a user