• 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: fast cross fade effect between 2 full screen images
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fast cross fade effect between 2 full screen images


  • Subject: Re: fast cross fade effect between 2 full screen images
  • From: John Stiles <email@hidden>
  • Date: Mon, 8 Mar 2004 15:47:10 -0800

I did this before using OpenGL. It will take you a bit of effort to set up the first time, but the results look great and use almost no CPU. If you use NSImage and friends, you will be forever bound to the CPU (unless Apple does some real GPU magic in 10.4 :) ).

First, you have to break up your images into multiple textures if you want them to look just like the originals. Use 256x256 textures and you should be compatible just about everywhere (i.e. Rage 128 and up).

You also need to worry a little bit about seams between the textures; I forget all the details here, but if you are scaling your images, know that the texels on the edges of the polygon will only cover half as much space on the polygon as the texels that render in the middle of the polygon. If you aren't scaling at all, you may be able to cheat a little bit here and have it be unnoticeable. If you want to do it "right" without doing a ton of memory copying by hand, look into glPixelStorei( GL_UNPACK_ROW_LENGTH, stride ).

Once you've figured that stuff out, just draw picture 1 with glColor4f( 1.0, 1.0, 1.0, 1.0 ) and picture 2 on top of it with glColor4f( 1.0, 1.0, 1.0, opacity ). It'll work great.


On Mar 8, 2004, at 12:35 PM, Joao Da Silva Neves wrote:

I am trying to create a cross fade effect between 2 full screen images. I've tried using OpenGL bitmaps, glBlendColorEXT() is fast but not available on all drivers, I've also tried with -[NSImage dissolveToPoint...] but it is too slow on a low end machine such as G3 400Mhz.
I could use textures but i don't think they'll always be able to accomodate the size of my hires images resulting in pixelization...

Any ideas on how to implement this ? I know it is possible since iPhoto4 does it fast/smooth enough.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >fast cross fade effect between 2 full screen images (From: Joao Da Silva Neves <email@hidden>)

  • Prev by Date: Re: [OT] Apple Developer Certification
  • Next by Date: Re: [OT] Apple Developer Certification
  • Previous by thread: fast cross fade effect between 2 full screen images
  • Next by thread: Binding Custom Views: Code Sample
  • Index(es):
    • Date
    • Thread