• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Transparency Help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Best approach to write an uninstaller for osx
  • Next by Date: Re: Best approach to write an uninstaller for osx
  • Previous by thread: Re: Transparency Help
  • Next by thread: NIB/XIB created objects, should they be released in -[dealloc]?
  • Index(es):
    • Date
    • Thread