Differential D16243 Diff 58431 source/blender/draw/engines/eevee/shaders/effect_reflection_trace_frag.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/shaders/effect_reflection_trace_frag.glsl
| Show All 11 Lines | |||||
| * by Tomasz Stachowiak. | * by Tomasz Stachowiak. | ||||
| * https://www.ea.com/frostbite/news/stochastic-screen-space-reflections | * https://www.ea.com/frostbite/news/stochastic-screen-space-reflections | ||||
| * and | * and | ||||
| * "Stochastic all the things: raytracing in hybrid real-time rendering" | * "Stochastic all the things: raytracing in hybrid real-time rendering" | ||||
| * by Tomasz Stachowiak. | * by Tomasz Stachowiak. | ||||
| * https://media.contentapi.ea.com/content/dam/ea/seed/presentations/dd18-seed-raytracing-in-hybrid-real-time-rendering.pdf | * https://media.contentapi.ea.com/content/dam/ea/seed/presentations/dd18-seed-raytracing-in-hybrid-real-time-rendering.pdf | ||||
| */ | */ | ||||
| uniform sampler2D normalBuffer; | |||||
| uniform sampler2D specroughBuffer; | |||||
| uniform vec2 targetSize; | |||||
| uniform float randomScale; | |||||
| in vec4 uvcoordsvar; | |||||
| layout(location = 0) out vec4 hitData; | |||||
| layout(location = 1) out float hitDepth; | |||||
| void main() | void main() | ||||
| { | { | ||||
| vec4 rand = texelfetch_noise_tex(gl_FragCoord.xy); | vec4 rand = texelfetch_noise_tex(gl_FragCoord.xy); | ||||
| /* Decorrelate from AA. */ | /* Decorrelate from AA. */ | ||||
| /* TODO(@fclem): we should use a more general approach for more random number dimensions. */ | /* TODO(@fclem): we should use a more general approach for more random number dimensions. */ | ||||
| vec2 random_px = floor(fract(rand.xy * 2.2074408460575947536) * 1.99999) - 0.5; | vec2 random_px = floor(fract(rand.xy * 2.2074408460575947536) * 1.99999) - 0.5; | ||||
| rand.xy = fract(rand.xy * 3.2471795724474602596); | rand.xy = fract(rand.xy * 3.2471795724474602596); | ||||
| ▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines | |||||