Differential D13910 Diff 47464 source/blender/draw/engines/workbench/shaders/workbench_effect_taa_frag.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/shaders/workbench_effect_taa_frag.glsl
| uniform sampler2D colorBuffer; | |||||
| uniform float samplesWeights[9]; | |||||
| out vec4 fragColor; | |||||
| void main() | void main() | ||||
| { | { | ||||
| vec2 texel_size = 1.0 / vec2(textureSize(colorBuffer, 0)); | vec2 texel_size = 1.0 / vec2(textureSize(colorBuffer, 0)); | ||||
| vec2 uv = gl_FragCoord.xy * texel_size; | vec2 uv = gl_FragCoord.xy * texel_size; | ||||
| fragColor = vec4(0.0); | fragColor = vec4(0.0); | ||||
| int i = 0; | int i = 0; | ||||
| for (int x = -1; x <= 1; x++) { | for (int x = -1; x <= 1; x++) { | ||||
| for (int y = -1; y <= 1; y++, i++) { | for (int y = -1; y <= 1; y++, i++) { | ||||
| /* Use log2 space to avoid highlights creating too much aliasing. */ | /* Use log2 space to avoid highlights creating too much aliasing. */ | ||||
| vec4 color = log2(texture(colorBuffer, uv + vec2(x, y) * texel_size) + 0.5); | vec4 color = log2(texture(colorBuffer, uv + vec2(x, y) * texel_size) + 0.5); | ||||
| fragColor += color * samplesWeights[i]; | fragColor += color * samplesWeights[i]; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||