R T wrote:

kernel vec4 whiteToTransparent(sampler source_image)
{

vec4 pixValue;
pixValue = sample(source_image, samplerCoord(source_image));
return  (pixValue == vec4(1,1,1,1) ? vec4(1,1,1,0) : vec4(pixValue));
}

I'm ignorant of GL shading, but something looks wrong here. If pixValue's type is vec4, then why is the third expression vec4 (pixValue), instead of just pixValue?

The other thing that comes to mind is you're testing for an exact match (== vec4(1,1,1,1)) in order to return white with transparent alpha (vec4(1,1,1,0)). Are you sure the result of sample() is exact? Instead of testing exactly for white, maybe you can test for not black.

  -- GG

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to