This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Dissolve effect source?


Dissolve effect source?

Postby fzammetti » Sep 27, 2003 @ 3:04am

...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby mlepage » Sep 27, 2003 @ 3:09am

www.scalenesoftware.com
Great games for your Palm and Pocket PC!
User avatar
mlepage
pm Insider
 
Posts: 1050
Joined: Aug 3, 2003 @ 4:47am
Location: Canada


Postby DillRye » Sep 27, 2003 @ 7:44am

User avatar
DillRye
pm Insider
 
Posts: 477
Joined: Apr 25, 2002 @ 7:28am
Location: Iowa State University of Eng


Postby fzammetti » Sep 27, 2003 @ 1:47pm

...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby mlepage » Sep 27, 2003 @ 3:57pm

DillRye's approach also would work, although you'd want to ensure that you actually make steady progress from one image to another.

My approach has the property of making 64 equal steps toward the other image, each step being 1/64 closer.

There's probably smarter ways to do it, but that's off the top of my head.
www.scalenesoftware.com
Great games for your Palm and Pocket PC!
User avatar
mlepage
pm Insider
 
Posts: 1050
Joined: Aug 3, 2003 @ 4:47am
Location: Canada


Postby vic » Sep 28, 2003 @ 12:18am

vic.
vic
pm Member
 
Posts: 56
Joined: Nov 28, 2002 @ 1:57pm
Location: PT


Postby mlepage » Sep 28, 2003 @ 2:15am

www.scalenesoftware.com
Great games for your Palm and Pocket PC!
User avatar
mlepage
pm Insider
 
Posts: 1050
Joined: Aug 3, 2003 @ 4:47am
Location: Canada


Postby fzammetti » Sep 28, 2003 @ 5:04am

...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby fzammetti » Sep 28, 2003 @ 5:06am

...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby mlepage » Sep 28, 2003 @ 6:19am

www.scalenesoftware.com
Great games for your Palm and Pocket PC!
User avatar
mlepage
pm Insider
 
Posts: 1050
Joined: Aug 3, 2003 @ 4:47am
Location: Canada


Postby vic » Sep 28, 2003 @ 11:49pm

if you're willing to waste memory just load a non grayscale image which is still a grayscale image on a higher bitdepth and just load a color channel to compare values with..

i just made a working example here. ill put up a example, meanwhile just follow this code:

/////////////////////////////////////////////////////////////
// Dissolve effect
/////////////////////////////////////////////////////////////

WORD *texdata = (WORD *)pTex->GetData();
BYTE *b_mapdata = (BYTE *)pHeightMap->byteData;
WORD *w_mapdata = (WORD *)pHeightMap->GetData();

if( bDissolve )
{
int map_index = 0;
for( j=0; j<backbuf.dwHeight; j++ )
{
WORD *line = buffer;
for( i=0; i<backbuf.dwWidth; i++ )
{
if( b_mapdata[map_index] > h )
{
WORD pixel = *(texdata + i + j*pTex->GetWidth());
*line = pixel;
}

line += xpitch;
map_index++;
}

buffer += ypitch;
}

// effect is over
h++;
if( h == 255 ) bDissolve = FALSE;
}
vic.
vic
pm Member
 
Posts: 56
Joined: Nov 28, 2002 @ 1:57pm
Location: PT


Postby vic » Sep 29, 2003 @ 2:06am

vic.
vic
pm Member
 
Posts: 56
Joined: Nov 28, 2002 @ 1:57pm
Location: PT


Postby fzammetti » Sep 29, 2003 @ 2:11am

...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby vic » Sep 29, 2003 @ 3:06am

vic.
vic
pm Member
 
Posts: 56
Joined: Nov 28, 2002 @ 1:57pm
Location: PT


Postby Presto » Sep 29, 2003 @ 3:09pm

You might want to check this out too... It's a disintigration effect.

Say you use 30 FPS, and you want to disintegrate the entire screen over 3 seconds. That gives us 90 frames to work with.

[pseudocode]
Create an integer "scrn_array" for the number of pixels/blocks you want to dissolve.

Assign every integer in the array a random number from 1-90.

Take a snapshot of the current screen.

Start the frame_counter at 1.

Loop through the scrn_array.

If our "scrn_array[x][y] == frame_counter", blank out that pixel/block in the snapshot.

Next

Increment frame_counter.

Update the screen with the modified snapshot.
[/pseudocode]

Looping through per pixel would be about 853 pixel changes per frame (76,800/90). That's a lot, but if we use 2x2 blocks, it's only 213 changes (19200/90). 4x4 blocks would be 53 changes (4800/90) per frame. And 8x8 blocks would yield 13 changes per frame (1200/90).

So, as always it's a speed vs. quality decision.

I'll have to try this myself sometime.
User avatar
Presto
pm Insider
 
Posts: 763
Joined: Jan 20, 2003 @ 5:51am
Location: Kalesian Archipelago


Next

Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum