Re: Can anyone see what I'm doing wrong here? (CI Kernel)
- Subject: Re: Can anyone see what I'm doing wrong here? (CI Kernel)
- From: "John C. Randolph" <email@hidden>
- Date: Tue, 9 Aug 2005 13:02:58 -0700
- Delivered-to: email@hidden
- Delivered-to: email@hidden
Well, it doesn't look like the problem is the ternary operator. I
changed my kernel to:
kernel vec4 ramp(sampler image, float height)
{
vec4 inputColor = sample(image, samplerCoord(image));
vec4 result;
float yLocation = destCoord()[1]/height;
result.r = compare((inputColor.r - yLocation), 0.0, 1.0);
result.g = compare((inputColor.g - yLocation), 0.0, 1.0);
result.b = compare((inputColor.b - yLocation), 0.0, 1.0);
result.a = inputColor.a;
return result;
}
and the resulting plot is the same. Then again, maybe the compare
function is using the ternary operator, too.
-jcr
John C. Randolph <email@hidden> (408) 914-0013
Roaming Cocoa Engineer,
Available for your projects at great Expense and Inconvenience.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden
This email sent to email@hidden
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.