Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-08-10 19:31:54 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-10 19:31:54 +0400
commitb84c1dd59240560a6d681a3853c82eeac3b0d350 (patch)
tree07bd750bc7ed34ade4b3eec0969547d9199d644c /source/blender/compositor/operations/COM_OpenCLKernels.cl
parent2a1b7f7f8eaef4fd66d9031f8e906f5ba8a9a5b2 (diff)
compositor: bokeh blur size input can now be an image, in this case it uses VariableSizeBokehBlurOperation class internally.
updated opencl too.
Diffstat (limited to 'source/blender/compositor/operations/COM_OpenCLKernels.cl')
-rw-r--r--source/blender/compositor/operations/COM_OpenCLKernels.cl14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/compositor/operations/COM_OpenCLKernels.cl b/source/blender/compositor/operations/COM_OpenCLKernels.cl
index 9a89fe21414..7366db19444 100644
--- a/source/blender/compositor/operations/COM_OpenCLKernels.cl
+++ b/source/blender/compositor/operations/COM_OpenCLKernels.cl
@@ -78,7 +78,7 @@ __kernel void bokehBlurKernel(__read_only image2d_t boundingBox, __read_only ima
__kernel void defocusKernel(__read_only image2d_t inputImage, __read_only image2d_t bokehImage,
__read_only image2d_t inputSize,
__write_only image2d_t output, int2 offsetInput, int2 offsetOutput,
- int step, int maxBlur, float threshold, int2 dimension, int2 offset)
+ int step, int maxBlurScalar, float threshold, int2 dimension, int2 offset, float scalar)
{
float4 color = {1.0f, 0.0f, 0.0f, 1.0f};
int2 coords = {get_global_id(0), get_global_id(1)};
@@ -92,14 +92,14 @@ __kernel void defocusKernel(__read_only image2d_t inputImage, __read_only image2
float4 multiplier_accum = {1.0f, 1.0f, 1.0f, 1.0f};
float4 color_accum;
- int minx = max(realCoordinate.s0 - maxBlur, 0);
- int miny = max(realCoordinate.s1 - maxBlur, 0);
- int maxx = min(realCoordinate.s0 + maxBlur, dimension.s0);
- int maxy = min(realCoordinate.s1 + maxBlur, dimension.s1);
+ int minx = max(realCoordinate.s0 - maxBlurScalar, 0);
+ int miny = max(realCoordinate.s1 - maxBlurScalar, 0);
+ int maxx = min(realCoordinate.s0 + maxBlurScalar, dimension.s0);
+ int maxy = min(realCoordinate.s1 + maxBlurScalar, dimension.s1);
{
int2 inputCoordinate = realCoordinate - offsetInput;
- float size_center = read_imagef(inputSize, SAMPLER_NEAREST, inputCoordinate).s0;
+ float size_center = read_imagef(inputSize, SAMPLER_NEAREST, inputCoordinate).s0 * scalar;
color_accum = read_imagef(inputImage, SAMPLER_NEAREST, inputCoordinate);
readColor = color_accum;
@@ -111,7 +111,7 @@ __kernel void defocusKernel(__read_only image2d_t inputImage, __read_only image2
float dx = nx - realCoordinate.s0;
if (dx != 0 || dy != 0) {
inputCoordinate.s0 = nx - offsetInput.s0;
- size = read_imagef(inputSize, SAMPLER_NEAREST, inputCoordinate).s0;
+ size = read_imagef(inputSize, SAMPLER_NEAREST, inputCoordinate).s0 * scalar;
if (size > threshold) {
if (size >= fabs(dx) && size >= fabs(dy)) {
float2 uv = {256.0f + dx * 255.0f / size,