Page 1 of 4

Textured sprites

Posted: Tue May 17, 2011 8:20 pm
by lizard
Few weeks ago I found this article - http://habrahabr.ru/blogs/gdev/117420/ (sorry, russian only, but google translate can help ;) ).
Pro: for lots of 'skinned' sprites, only one animation sheet needed. Contra: I don't know how to create 'model map' without 3D-modelling :huh:
Here also a example with images from article (warning, map and resulting image is not po2-safe):

Re: Textured sprites

Posted: Tue May 17, 2011 11:48 pm
by Lafolie
Oh wow that's pretty incredible. I'd love to see a proper translation of that tutorial. Actually... google may have the answers.

EDIT: Studying the link a little more, it's pretty much explained by the images and source alone. This is really cool. I might use this in my next project.

Re: Textured sprites

Posted: Wed May 18, 2011 6:50 pm
by Taehl
I think I can guess what's going on there. If my guess is correct, HOLY CRAP THAT'S BRILLIANT. I sure wish I could read it!

But since Love doesn't have shader support yet, I don't think we could do this quick enough to be used in games, could we?

Re: Textured sprites

Posted: Wed May 18, 2011 10:43 pm
by vrld
Taehl wrote:If my guess is correct, HOLY CRAP THAT'S BRILLIANT.
I guess your guess is correct.
Taehl wrote:I don't think we could do this quick enough to be used in games, could we?
Not in realtime, for morphing effects or stuff, but you can have one "model" and different textures which you combine to create sprites at game start. Neat way to reduce the .love filesize.

Re: Textured sprites

Posted: Wed May 18, 2011 11:42 pm
by BlackBulletIV
It took me quite a while to figure out what the benefit of this is, but I've finally got it. And now that I have, all I can say is: THAT'S REALLY COOL! But, it would be pretty hard to construct a placement map like that one, wouldn't it?

Re: Textured sprites

Posted: Thu May 19, 2011 12:31 am
by Lafolie
BlackBulletIV wrote:It took me quite a while to figure out what the benefit of this is, but I've finally got it. And now that I have, all I can say is: THAT'S REALLY COOL! But, it would be pretty hard to construct a placement map like that one, wouldn't it?
Not at all. It's a matter of working backwards really. You could write a function that draws an input texture map template and you're all set.

Re: Textured sprites

Posted: Thu May 19, 2011 1:24 am
by BlackBulletIV
Working backwards? What do you mean? I was referring to having to set precisely the red and green values on the placement map to match the x/y coordinates on the texture.

Re: Textured sprites

Posted: Thu May 19, 2011 7:33 am
by Lafolie
BlackBulletIV wrote:Working backwards? What do you mean? I was referring to having to set precisely the red and green values on the placement map to match the x/y coordinates on the texture.
You could use no input texture but instead have a function that takes these values and draws a template texture and works this out for you.

Re: Textured sprites

Posted: Thu May 19, 2011 7:36 am
by BlackBulletIV
Ok, I'm still not getting it at all. :/ I think a code example my help my brain to figure it out.

Hey by the way, congratulations on 200 posts!

Re: Textured sprites

Posted: Thu May 19, 2011 7:38 am
by kikito
Lafolie wrote: You could use no input texture but instead have a function that takes these values and draws a template texture and works this out for you.
I'm sorry, but this doesn't help me to understand what you were saying neither. Right now it sounds to me like BlackBulletIV asked "how do I do xx?" and you answered "you have a function that does xx".