UnderwareDESIGN

PlayBASIC => Resources => Source Codes => Topic started by: kevin on March 19, 2010, 06:59:02 AM

Title: Dirty Rectangle (Combined Video & Fx Rendering)
Post by: kevin on March 19, 2010, 06:59:02 AM
 Dirty Rectangles  (Combined Video & Fx Rendering)

   This demo make simple scrolling backdrop with overlaid alpha blended circle over the top.   Rather than drawing the entire scene to an FX buffer, then copying this down to the PB screen,  we're drawing everything to the Pb screen, then overlaying the transparent circle.    This greatly reduces the work load the program has to do and is obviously quicker.     So the moral of the day is "think then act!"


   Press SPACE to toggle the frame rate cap.


Video:





Related To

 A Crash Course In Optimization (http://www.underwaredesign.com/forums/index.php?topic=2548.0)


Download:

    Attached
Title: Re: Dirty Rectangle (Combined Video & Fx Rendering)
Post by: stevmjon on April 02, 2010, 01:05:45 AM
thanks kev,

this makes an amazing difference. how do you come up with these ideas?

stevmjon
Title: Re: Dirty Rectangle (Combined Video & Fx Rendering)
Post by: kevin on April 02, 2010, 01:09:20 AM

it's not my idea, it's been used in game engines for decades
Title: Re: Dirty Rectangle (Combined Video & Fx Rendering)
Post by: stevmjon on April 02, 2010, 01:28:35 AM
well, i am certainly glad you are sharing these ideas, and many others, to the playbasic community.

stevmjon
Title: Re: Dirty Rectangle (Combined Video & Fx Rendering)
Post by: kevin on April 02, 2010, 01:35:44 AM
  There's nothing new here, as all the technical info can be found in ->   Economizing Image Blitting (drawing!) (http://www.underwaredesign.com/forums/index.php?topic=1799.0) - How well you understand it, will directly impact on the solutions you write.