Differential D16990 Diff 60050 source/blender/compositor/realtime_compositor/shaders/compositor_blur.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/compositor/realtime_compositor/shaders/compositor_blur.glsl
| Show All 29 Lines | |||||
| * of the weights texture, hence the need for inversion. */ | * of the weights texture, hence the need for inversion. */ | ||||
| vec4 load_weight(ivec2 texel) | vec4 load_weight(ivec2 texel) | ||||
| { | { | ||||
| /* Add the radius to transform the texel into the range [0, radius * 2], with an additional 0.5 | /* Add the radius to transform the texel into the range [0, radius * 2], with an additional 0.5 | ||||
| * to sample at the center of the pixels, then divide by the upper bound plus one to transform | * to sample at the center of the pixels, then divide by the upper bound plus one to transform | ||||
| * the texel into the normalized range [0, 1] needed to sample the weights sampler. Finally, | * the texel into the normalized range [0, 1] needed to sample the weights sampler. Finally, | ||||
| * invert the textures coordinates by subtracting from 1 to maintain the shape of the weights as | * invert the textures coordinates by subtracting from 1 to maintain the shape of the weights as | ||||
| * mentioned in the function description. */ | * mentioned in the function description. */ | ||||
| return texture(weights_tx, 1.0 - ((texel + vec2(radius + 0.5)) / (radius * 2 + 1))); | return texture(weights_tx, 1.0 - ((vec2(texel) + vec2(radius + 0.5)) / (radius * 2.0 + 1.0))); | ||||
| } | } | ||||
| void main() | void main() | ||||
| { | { | ||||
| ivec2 texel = ivec2(gl_GlobalInvocationID.xy); | ivec2 texel = ivec2(gl_GlobalInvocationID.xy); | ||||
| /* The mask input is treated as a boolean. If it is zero, then no blurring happens for this | /* The mask input is treated as a boolean. If it is zero, then no blurring happens for this | ||||
| * pixel. Otherwise, the pixel is blurred normally and the mask value is irrelevant. */ | * pixel. Otherwise, the pixel is blurred normally and the mask value is irrelevant. */ | ||||
| Show All 20 Lines | |||||