Mailing Lists: Apple Mailing Lists

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

Re: 2000 Sprites @ 60 Hz tops ? / Core Kernel slowed down by Inputs ?



I fell into the same pitfall. The ternary (? :) operator does not work properly for vector values, and the GL-slang compiler does not give you an error, just inconsistent results. The kernel might work better if you use:
color = compare(xy.x - x, color, bgColor);


The function "A = compare(B, C, D);" is like saying "if (B < 0) A = C else A = D" for vector values.
--Sam


On May 29, 2005, at 6:55 AM, Nat! wrote:


Well... this Core Kernel stuff appears to be also broken in a different way. At least on my hardware combination, this code produces false colors


kernel vec4   slider( sampler image, float x, __color bgColor)
{
   vec2    xy;
   vec4    color;

   xy = samplerCoord(image);
   color = sample( image, xy);
   color = (xy.x < x) ? color : bgColor;
   return( color);
}

if you substitute (xy.x < x) with (xy.x < 216.6), it looks right (the 216.6 has no special meaning).

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

References: 
 >2000 Sprites @ 60 Hz tops ? / Core Kernel slowed down by Inputs ? (From: Nat! <email@hidden>)
 >Re: 2000 Sprites @ 60 Hz tops ? / Core Kernel slowed down by Inputs ? (From: Pierre-Olivier Latour <email@hidden>)
 >Re: 2000 Sprites @ 60 Hz tops ? / Core Kernel slowed down by Inputs ? (From: Nat! <email@hidden>)
 >Re: 2000 Sprites @ 60 Hz tops ? / Core Kernel slowed down by Inputs ? (From: Pierre-Olivier Latour <email@hidden>)
 >Re: 2000 Sprites @ 60 Hz tops ? / Core Kernel slowed down by Inputs ? (From: Nat! <email@hidden>)
 >Re: 2000 Sprites @ 60 Hz tops ? / Core Kernel slowed down by Inputs ? (From: Pierre-Olivier Latour <email@hidden>)
 >Re: 2000 Sprites @ 60 Hz tops ? / Core Kernel slowed down by Inputs ? (From: Nat! <email@hidden>)
 >Re: 2000 Sprites @ 60 Hz tops ? / Core Kernel slowed down by Inputs ? (From: Nat! <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.