Differential D16990 Diff 60050 source/blender/compositor/realtime_compositor/shaders/compositor_glare_ghost_accumulate.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/compositor/realtime_compositor/shaders/compositor_glare_ghost_accumulate.glsl
| #pragma BLENDER_REQUIRE(gpu_shader_compositor_texture_utilities.glsl) | #pragma BLENDER_REQUIRE(gpu_shader_compositor_texture_utilities.glsl) | ||||
| void main() | void main() | ||||
| { | { | ||||
| ivec2 texel = ivec2(gl_GlobalInvocationID.xy); | ivec2 texel = ivec2(gl_GlobalInvocationID.xy); | ||||
| ivec2 input_size = texture_size(input_ghost_tx); | ivec2 input_size = texture_size(input_ghost_tx); | ||||
| /* Add 0.5 to evaluate the input sampler at the center of the pixel and divide by the image size | /* Add 0.5 to evaluate the input sampler at the center of the pixel and divide by the image size | ||||
| * to get the coordinates into the sampler's expected [0, 1] range. */ | * to get the coordinates into the sampler's expected [0, 1] range. */ | ||||
| vec2 coordinates = (vec2(texel) + vec2(0.5)) / input_size; | vec2 coordinates = (vec2(texel) + vec2(0.5)) / vec2(input_size); | ||||
| /* We accumulate four variants of the input ghost texture, each is scaled by some amount and | /* We accumulate four variants of the input ghost texture, each is scaled by some amount and | ||||
| * possibly multiplied by some color as a form of color modulation. */ | * possibly multiplied by some color as a form of color modulation. */ | ||||
| vec4 accumulated_ghost = vec4(0.0); | vec4 accumulated_ghost = vec4(0.0); | ||||
| for (int i = 0; i < 4; i++) { | for (int i = 0; i < 4; i++) { | ||||
| float scale = scales[i]; | float scale = scales[i]; | ||||
| vec4 color_modulator = color_modulators[i]; | vec4 color_modulator = color_modulators[i]; | ||||
| Show All 19 Lines | |||||