Josh @ Dreamland
|
|
Posted on: September 13, 2012, 10:43:25 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
The way I see it, there are two good ways to do sprite sheets. 1) Have a sprite sheet resource, and have sprites optionally refer to a sprite sheet. 2) Re-use the directory system. 3) Let ENIGMA just cram them together based on which fit together the best; the user can tell ENIGMA not to put the sprite in a sheet. 4) Use option 1, but provide an "Automatic" in addition to a "None" which lets ENIGMA decide.
I'm undecided on this one. I don't think I need to elaborate very much on it, as the concept is very simple. For those who are unclear, a sprite sheet is a big texture containing all the sprites. It is useful in that it saves render time due to not having to bind a new texture every time a sprite is drawn (only when sprites are on a new sheet).
The question is, how do we want the user to be able to specify that? Is it prudent to keep sprite sheets as a separate resource, or would it be too much work on the user's part?
This needs handled eventually if we want ENIGMA to make happy on mobile devices which just don't have the memory for 32,000 little tiny PO2 textures.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
Josh @ Dreamland
|
|
Reply #2 Posted on: September 13, 2012, 01:44:43 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
A sprite sheet would contain m subimages from n sprites, m >= n. Maybe the user wants one sprite sheet per sprite, maybe they want the entire world on one sheet (and maybe it's efficient to do so!). I believe the better word for what I am describing is a "texture map." I am not sure if they are genuinely synonymous, but I figured more people here would know what a sprite sheet looked like. What I'm really referring to looks something like this:
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
polygone
|
|
Reply #3 Posted on: September 13, 2012, 02:36:12 pm |
|
|
Location: England Joined: Mar 2009
Posts: 794
|
Texture sheet like that reminds me of level baking. I wonder if ENIGMA could help with baking at all. ie instead of using separate sprites (textures) you just use one texture sheet and change around the texture positions.
|
|
« Last Edit: September 13, 2012, 02:40:42 pm by polygone »
|
Logged
|
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
|
|
|
Josh @ Dreamland
|
|
Reply #4 Posted on: September 13, 2012, 02:41:12 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
That's the idea.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
polygone
|
|
Reply #5 Posted on: September 13, 2012, 02:45:18 pm |
|
|
Location: England Joined: Mar 2009
Posts: 794
|
Hmm I wonder what possibilities are actually open with it. I found that instead of a square texture sheet it's better to put all the textures in a row on one line.
|
|
|
Logged
|
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
|
|
|
|
Josh @ Dreamland
|
|
Reply #7 Posted on: September 13, 2012, 03:53:12 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
What appears in the dropdown list?
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
Josh @ Dreamland
|
|
Reply #9 Posted on: September 13, 2012, 04:08:06 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
The major points to having a resource for it would be 1) To allow the user to have a say in the placement within the texture map 2) To allow the user to fetch the texID of the texture map 3) To solidify the concept to something more precise than a page number 4) To demonstrate to the user how much space is wasted
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
Josh @ Dreamland
|
|
Reply #11 Posted on: September 13, 2012, 04:30:56 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Duly noted. The autopacker is coded and done with; we'll just reuse the one used to pack font glyphs.
Another benefit to a resource that I did not list earlier: An option can be given to separate sprite images by M pixels and dilate sprite edges by N pixels. (In addition to other benefits which may stem from having the map in front of you in a UI)
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|