I've not tried the openCL side yet (ati 2600 card :( ) but I've hit a
lot of these issues with CI/GLSL before.

First, you need floating point formats. The default is 8bit integer
(RGBA), which uses unsigned integers (0..255), so negatives won't be
handled.

The second big issue is with passing values between shaders. The
'expected range' of a pixel is 0..1. You can use numbers outside this
range (including negatives) within the shader, but passing these
values between shaders can cause issues (I can't remember the
specifics, but I've a feeling this behaviour is 'undefined', meaning
one vendor allows it and the other decides it gets clamped). Perhaps
that was windows-specific issues, but I was advised to always output
in the 0-1 range.

It's pretty trivial to scale the output at least as a worst case -
it's just 'pixel = (pixel / (maxValue * 2.0)) + 0.5;

Chris


2009/9/23 Stonewall Ballard <[email protected]>:
>
> On Sep 22, 2009, at 8:31 PM, Christopher Wright wrote:
>
>>> Aha! Turning on the Advanced Kernel Settings lets me set an OpenCL Kernel
>>> to 32 bits per pixel, which then passes negative pixel values through.
>>> 16-bit also works.
>>
>>
>> Ahh, good find.  Works here too.
>>
>> CoreImage with negatives to CL (in 32bit mode) also appears to work as
>> expected, as well as CL to CL.
>>
>> The only quirk I can find with this is CL (with negatives) to CoreImage --
>> that seems to clamp still (not sure why, since CI to CL is ok...).  can post
>> a sample composition if anyone wants to confirm this quirk.
>
> I did not see any clamping when I interposed a passthrough OpenCL kernel
> between your scaler and negative detector. Make sure you set the CL output
> to 32 bit and color space to Image Native or Absolute Linear. I got some odd
> artifacts when I set the output to Rendering Destination.
>
> Is there any documentation on this?
>
>  - Stoney
>
> --
> Stonewall Ballard
> [email protected]           http://stoney.sb.org/
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Quartzcomposer-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/quartzcomposer-dev/psonice%40gmail.com
>
> This email sent to [email protected]
>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to