Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / create animated sprite

Author
Message
Twinsen
18
Years of Service
User Offline
Joined: 20th Jun 2006
Location: Romania
Posted: 26th Mar 2008 18:20 Edited at: 26th Mar 2008 23:12
hey there people !!! I have a small problem when I run the code below, I see the animated sprite playing BUT there's a small glitch: the top most line (just 1 pixel tall) seems to clip in a weird manner ... please tell me if the code works fine for you and keep an eye on the top line !!! I assure you the picture is coorect, as when I make a GIF out of it, it all works perfectly



Could you help me treat my injured Dino-Fly ?

Attachments

Login to view attachments
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 26th Mar 2008 23:19
Crikey - 2.5MB for a single sprite image!!

Anyway - works fine for me. No clipping or unwanted image artifacts at all.

TDK_Man

Twinsen
18
Years of Service
User Offline
Joined: 20th Jun 2006
Location: Romania
Posted: 26th Mar 2008 23:37
u kidding me ??? MANNN ........ why am I getting it then ??? I use 6.7 btw TDK

Could you help me treat my injured Dino-Fly ?
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 26th Mar 2008 23:47 Edited at: 26th Mar 2008 23:53
It's fine with 6.6.

Could be your gfx card struggling with such a big image (mine is a 512MB GeForce 8500 GT). Try resizing it and/or reducing the colours down to 256 just as a test...

It's just far too big at the moment.

TDK_Man

Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 27th Mar 2008 00:26 Edited at: 27th Mar 2008 00:35
twinsen, i get the same ill-effects as you. i know it's because my system is older (see sig) and the size of your .png is too big. i did a number of resizes on it and found 128x1176 to be the largest re-size i could make while keeping the "clipping" out of it.

yeah, stretching the sprite in-program causes pixelation but it's that or the top-edge clipping for the lower-end systems like mine (and, apparently, yours).

alternatively, you could "divide and conquer" the file by, say, dividing it into 1/4's and playing the 4 sprites in looping sequence to keep the quality up.

attached is the resized file. (~200k)

Virtual Nomad
AMD XP 1800+ (~1.6 Ghz) / 1.5 GB RAM
ATI Radeon 8700LE 128 MB / Windows XP

Attachments

Login to view attachments
Twinsen
18
Years of Service
User Offline
Joined: 20th Jun 2006
Location: Romania
Posted: 27th Mar 2008 07:32
hmmm but why would it clip just because of the size ??? I have a rather powerful computer : nVidia 6600, Pentium4 2800 MHz, 1 Gb DDRAM .... man this sucks

Could you help me treat my injured Dino-Fly ?
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 27th Mar 2008 10:36
i wouldn't have expected this issue with your video card as that's a pretty decent one. maybe someone else could shed some light on the subject?

Virtual Nomad
AMD XP 1800+ (~1.6 Ghz) / 1.5 GB RAM
ATI Radeon 8700LE 128 MB / Windows XP
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 27th Mar 2008 12:13
I slowed the code down considerably and it looks to me that the pic is indeed not correct (don't ask me how the .gif file worked). About every 3rd or 4th frame, it is correct, but the rest are off by one.

btw, My computer is 3.4 GHz P4 with a Radeon X600 and this runs at 847 FPS with sync set to 0 and the glitch is still there.

I am using 6.6.

LB
Twinsen
18
Years of Service
User Offline
Joined: 20th Jun 2006
Location: Romania
Posted: 27th Mar 2008 14:08
oh damn so there is no way I can solve this ??? PS: that is a lowres version .. the one I'm planning to use is twice the size ( I know, I'm crazy ) but there comes a time when a game demands such an animation and there's no other way I can achieve this effect

Could you help me treat my injured Dino-Fly ?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Mar 2008 20:03
Quote: "Crikey - 2.5MB for a single sprite image!!"

No, 10MB - the 2.5MB is its compressed format.

@Twinsen,
I think the problem may be due to you not using a power-of-2 value as your individual image height. If you can set each frame to be 64 pixels high instead of 56, then that may solve your problem.

Alternatively, it may be possible to generate the effect on the fly, depending on how much else your program is doing at the time

Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 27th Mar 2008 21:35
Quote: "so there is no way I can solve this ??? "


there are a number of ways to solve this. but, none of them include keeping the graphic and method used exactly how they are now. try some of the suggestions that have been posted. divide and conquer! especially if this is the "low-res" version of the plasma graphic. you shouldn't expect a (guesstimated) 40 meg image to be plug-and-play
Quote: "the one I'm planning to use is twice the size "

if you're doubling both the x and y, it'll become 4 times the size!

Virtual Nomad
AMD XP 1800+ (~1.6 Ghz) / 1.5 GB RAM
ATI Radeon 8700LE 128 MB / Windows XP
Twinsen
18
Years of Service
User Offline
Joined: 20th Jun 2006
Location: Romania
Posted: 27th Mar 2008 21:52
yeah I meant twice as a whole ... anyway, I've managed to fix it: I've tiled them onto many columns and rows, not only on a single one, so now it isn't beyond 4096 it works I forgot about the size limit of the GPU ... thanks guys

Could you help me treat my injured Dino-Fly ?
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 28th Mar 2008 02:33
kickazz

Virtual Nomad
AMD XP 1800+ (~1.6 Ghz) / 1.5 GB RAM
ATI Radeon 8700LE 128 MB / Windows XP

Login to post a reply

Server time is: 2024-09-27 12:24:06
Your offset time is: 2024-09-27 12:24:06