|
Mosaic effect |
ngiacomelli
Member #5,114
October 2004
|
I would like to use a mosaic effect in my game, but am frankly at a loss as to how to implement such an effect. Has anyone implemented a mosaic effect before? Do you have any suggestions?
|
Onewing
Member #6,152
August 2005
|
No idea, but here's how I would take a stab at it (changing a graphic to mosaic) 1) Define how your mosaic pieces should look. Typically, a single piece is dark on the border and the same color elsewhere (the middle). Of course, there's plenty of gotcha's in the above algorithm, but I did say, "no idea" at the beginning of the post. Actually, I did the above method for a game I was making earlier this year called Cosmos. Only, instead of grouping by color difference, I grouped by height difference. To see the progress of that, you can look at the pictures in this thread. Hope I've been of some help... ------------ |
X-G
Member #856
December 2000
|
What kind of mosaic are we talking here? If you mean the pixelation thing, that should be very straightforward. -- |
kentl
Member #2,905
November 2002
|
Or do you mean something a bit more advanced? |
CGamesPlay
Member #2,559
July 2002
|
Or do you want a real collage-style mosaic? -- Ryan Patterson - <http://cgamesplay.com/> |
Kris Asick
Member #1,424
July 2001
|
Here's some mock-up code I just wrote. There's probably much more efficient ways to do this, but since I've never done this before I figured this was the simplest method:
If your game only uses one colour depth you could make this routine a little faster by replacing getpixel() with one of the _getpixel() commands. Or another change could be to add a second bitmap reference to the prototype which would become the target bitmap. (And the first would be the source.) Presuming that's the effect you want. I've heard people call trails left by objects a mosaic effect. If that's what you mean then the process is obviously entirely different and can be done in a number of ways depending on exactly the effect you're going for. --- Kris Asick (Gemini) --- Kris Asick (Gemini) |
|