Re: Transparency Help
Re: Transparency Help
- Subject: Re: Transparency Help
- From: Greg Guerin <email@hidden>
- Date: Mon, 23 Nov 2009 14:02:09 -0700
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 (email@hidden)
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:
This email sent to email@hidden