Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can anyone see what I'm doing wrong here? (CI Kernel)



Gentlemen,

In this composition:

Attachment: Possible Bug.zip
Description: Zip archive


PNG image


I'm using the following kernel program to generate the plot you see on the right, from the gradient patch output that you see on the left.


kernel vec4 ramp(sampler image, float height)
{
    vec4 inputColor = sample(image, samplerCoord(image));
    vec4 result;

    float yLocation = destCoord()[1]/height;

    result.r = (yLocation < inputColor.r) ? 1.0 : 0.0;
    result.g = (yLocation < inputColor.g) ? 1.0 : 0.0;
    result.b = (yLocation < inputColor.b) ? 1.0 : 0.0;
    result.a = inputColor.a;

return result;
}


If you try moving the sliders, you'll see a couple of unexpected results.. the first and most obvious one is that the red curve is affected by the green value. The second is that if I set any of the inputs to 0.5, the peak of the corresponding curve is apparently lower than the midpoint of the output image.


Did I botch my code in some way that I'm just not seeing, or is this a bona fide CI bug?

Any ideas?

-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.