Oh good, I'm not missing my brains then.kikito wrote: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".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.
Textured sprites
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: Textured sprites
Re: Textured sprites
Right, let me attempt to explain a little better, haha.
At the moment it's taking RGB values from the 'model' image and using them to 'grab' pixels from the 'texture' image. Instead of grabbing pixels from a loaded image, you could create a new one and write pixels to a new imageData, then output that to a file, thus you will have created a template texture map for your model.
The model is fairly simple to create. It's just a silhouette with a depth-map of sorts. If you have talent using Photoshop or something similar and are confident in your artistic ability, then it should be obvious that creating the model is easy.
Is that better?
At the moment it's taking RGB values from the 'model' image and using them to 'grab' pixels from the 'texture' image. Instead of grabbing pixels from a loaded image, you could create a new one and write pixels to a new imageData, then output that to a file, thus you will have created a template texture map for your model.
The model is fairly simple to create. It's just a silhouette with a depth-map of sorts. If you have talent using Photoshop or something similar and are confident in your artistic ability, then it should be obvious that creating the model is easy.
Is that better?
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: Textured sprites
So let me get this straight. You're creating a texture based off the map? How would you then specify what colours go where on the texture? I'm pretty confused; as I said before, a code sample would help a lot. But anyway, it doesn't really matter, I get how the texturing part works.
Re: Textured sprites
I'm too busy to sit down and write the code right now, but basically, replace all the [read pixel] commands with [set pixel] commands so that it would draw a template map for you. It's pretty obvious/simple, I must be explaining it really terribly haha
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: Textured sprites
No worries. I think I get what you're saying now, it creates the separate areas of the texture for you and then you color them in or something? But that still doesn't eliminate the tediousness/difficultly of creating a proper placement map.
Re: Textured sprites
After creating a few, I'm pretty sure you'd start to figure it out and be able to work efficiently with them. Practice man, practice.BlackBulletIV wrote:No worries. I think I get what you're saying now, it creates the separate areas of the texture for you and then you color them in or something? But that still doesn't eliminate the tediousness/difficultly of creating a proper placement map.
EDIT: Alternatively, you could make a Löve drawing app, or even one that loads a bunch of images and allows you create composites with a 'live preview' sort of thing. Perhaps if you tried enough you could even manipulate an existing sprite and stretch/morph it to fit, although that would be heavy stuff given the current functionality of Löve.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
Re: Textured sprites
Lafolie wrote: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.
OMFG, man, you are genius! At this weekend I will try a reverse algorithm. Thank you for suggestion!backwards
EDIT: second look - hmm, but the texture will be distorted - on rendered sprite we don't have a correct texture coordinates.
Re: Textured sprites
Wow this is awesome. I still can't completely wrap my head around it though.
I made an animated version of lizard's example.
I made an animated version of lizard's example.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: Textured sprites
Looks good mate!Kadoba wrote:Wow this is awesome. I still can't completely wrap my head around it though.
I made an animated version of lizard's example.
Re: Textured sprites
Thanks! And yeah, it will be distorted. It would take some experimenting to get it right, but at least you have a template to work from, better than a blank canvas eh?lizard wrote:Lafolie wrote: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.OMFG, man, you are genius! At this weekend I will try a reverse algorithm. Thank you for suggestion!backwards
EDIT: second look - hmm, but the texture will be distorted - on rendered sprite we don't have a correct texture coordinates.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
Who is online
Users browsing this forum: Ahrefs [Bot] and 3 guests