Differential D16990 Diff 60050 source/blender/compositor/realtime_compositor/shaders/compositor_glare_ghost_base.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/compositor/realtime_compositor/shaders/compositor_glare_ghost_base.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(small_ghost_tx); | ivec2 input_size = texture_size(small_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); | ||||
| /* The small ghost is scaled down with the origin as the center of the image by a factor of 2.13, | /* The small ghost is scaled down with the origin as the center of the image by a factor of 2.13, | ||||
| * while the big ghost is flipped and scaled up with the origin as the center of the image by a | * while the big ghost is flipped and scaled up with the origin as the center of the image by a | ||||
| * factor of 0.97. Note that 1) The negative scale implements the flipping. 2) Factors larger | * factor of 0.97. Note that 1) The negative scale implements the flipping. 2) Factors larger | ||||
| * than 1 actually scales down the image since the factor multiplies the coordinates and not the | * than 1 actually scales down the image since the factor multiplies the coordinates and not the | ||||
| * images itself. 3) The values are arbitrarily chosen using visual judgement. */ | * images itself. 3) The values are arbitrarily chosen using visual judgement. */ | ||||
| float small_ghost_scale = 2.13; | float small_ghost_scale = 2.13; | ||||
| float big_ghost_scale = -0.97; | float big_ghost_scale = -0.97; | ||||
| Show All 19 Lines | |||||