Discuss Scratch

TheMonsterOfTheDeep
Scratcher
1000+ posts

Atlas Support

20btheilmanngohr wrote:

TheMonsterOfTheDeep wrote:

20btheilmanngohr wrote:

TheMonsterOfTheDeep wrote:

-snip-
-snoop-
The reason the “show section” block is kind of confusing is because I don't understand what would happen if multiple sections where shown at once.

But I'm still not sure of the best wording - here's a new option I thought of based on my previous ones:
focus on section [section v] :: looks
“focus on” is the best description I could come up with for only displaying part of the sprite - can anyone think of something better? Because I don't think the blocks should be analogous to costume blocks as the sections are rather different and are in fact parts of costumes.
set shown section to [A1 v] :: looks
A1 being rows (a) and columns (1)
That would probably be the best… and then the section size could be set in the editor
Znapi
Scratcher
500+ posts

Atlas Support

I think it is a little complicated for Scratch. I'm not sure exactly how it would be like in the editor either. How would you make an atlas rather than a normal costume? If you have multipltle atlases, do you switch between them with a switch costume block? How about a sprite with normal costumes and atlases? I think it would make making fonts harder, because you have to keep track of the size of your sections, and what if you all of a sudden need to change the size of each section? Not all texture atlases have same sized sections either. Also, most of the time artists make textures as separate images anyways, and they are combined(called stitching) in an atlas later.

The reason professional games(like Minecraft) stitch all of their textures together into atlases is for technical reasons involving that Scratchers should not have to think about. Basically, it is to improve rendering speed and to save a little bit of GPU memory.

On the GPU, without atlases, every time you want to render with a different texture, you have to swap to that texture(somewhat similar to switching costumes). It is a little faster(depending on how many swaps being done) to have all of the textures in one atlas. As far as a GPU is concerned, an atlas is just one normal texture. Because it is one texture, you don't have to do any swapping. You just specify a different region of it to draw(the section switching like you suggest). One big texture also takes up less memory on the GPU than multiple small ones.

The placement of textures in an atlas is also complicated and important, and I don't even want to try to explain it. It has to do with this thing called memory alignment. Basically, the exact size of each section(30px wide vs 32px) can make rendering faster or slower. If you do it wrong, it slows things down. The ST wouldn't want to burden Scratchers with this concern.

What I'm trying to say is that I don't think texture atlases fit in with Scratch, because their purpose is so technical, and it has to be done a certain way. They aren't just a fancy thing just to have. Explaining to Scratchers how to properly make them to actually see speed improvements could get complicated. Most projects don't even switch costumes so much that this would be beneficial.

What would be interesting though is if costumes were automatically together into atlases with proper alignment(not necessarily perfect, but the best that can be done) when the project loads. Scratchers wouldn't need to think about it, and there could be small speed improvements in projects that like to switch costumes a lot.

Last edited by Znapi (June 22, 2015 06:54:14)

20btheilmanngohr
Scratcher
100+ posts

Atlas Support

Znapi wrote:

I think it is a little complicated for Scratch. How do you say what is an atlas and what isn't? Can you have both atlases and normal costumes in one sprite? Multiple atlases in one sprite? I think it would make making fonts harder, because you have to keep track of the size of your sections, and what if you all of a sudden need to change the size of each section? Not all texture atlases have same sized sections either. Also, most of the time artists make each texture as a separate image anyways, and they are stitched together in an atlas later. Making an atlas by hand is kinda weird.

The reason professional games(like Minecraft) stitch all of their textures together into atlases, either during runtime or pre-stitched in the distribution, is for technical reasons involving the GPU that Scratchers should not have to think about. Basically, it is to improve speed by reducing texture swaps and to save a little bit of GPU memory. As far as a GPU is concerned, an atlas is just one normal texture. In a game where many different textures are used in one frame, every time you want to render a different texture, you have to swap to that texture. It is a little faster(depending on how many swaps being done) to have all of the textures in one atlas, because instead of swapping textures, you just specify a different region of it to use for rendering.

The placement of textures in an atlas is also technical, and I don't even want to try to explain it. It has to do with memory alignment. Where you place the sections can make rendering faster or slower. The ST wouldn't want to burden Scratchers with this concern.

What would be interesting though is if the player automatically stitched the costumes together into atlases with proper alignment(not necessarily perfect, but the best that can be done) when the project loads. Stage3D uses hardware acceleration, so there could be small speed improvements in projects that like to switch costumes a lot.
kind of ironic your post was complicated, but that's not the point
When you say what's an atlas, and what's not, I think of an atlas as a costume sheet, with each costume having an equal perimeter as the other costumes. As for atlas size, re-size it with size. I didn't necessarily think about size. As for the rest, I've really no clue. I'm not that good of a programmer
Znapi
Scratcher
500+ posts

Atlas Support

20btheilmanngohr wrote:

kind of ironic your post was complicated, but that's not the point
When you say what's an atlas, and what's not, I think of an atlas as a costume sheet, with each costume having an equal perimeter as the other costumes. As for atlas size, re-size it with size. I didn't necessarily think about size. As for the rest, I've really no clue. I'm not that good of a programmer
Sorry it was hard to understand, I'm usually terrible at explaining things. I tried changing it a little, but it is probably not better. I did add a kinda summary paragraph though to trybto help(second to last one).

What I meant by size changing is what if you wanted to change the size of the sections so you could add more detail? Like they are 10 pixels but now you want 20?
20btheilmanngohr
Scratcher
100+ posts

Atlas Support

Znapi wrote:

Sorry it was hard to understand, I'm usually terrible at explaining things. I tried changing it a little, but it is probably not better. I did add a kinda summary paragraph though to trybto help(second to last one).

What I meant by size changing is what if you wanted to change the size of the sections so you could add more detail? Like they are 10 pixels but now you want 20?
It's okay. I at least had some idea of what you were saying. As for your question, are you referring for a resize tool in the paint editor? Maybe you could set the dimension size to 20x20 or something. I don't know how that'd be possibly, especially with how scratch has limited costume size. Perhaps there could be a dimesion resizer…I don't know.
20btheilmanngohr
Scratcher
100+ posts

Atlas Support

___________
/————–\
|—-BUMP—|
\___________/






20btheilmanngohr
Scratcher
100+ posts

Atlas Support

Nuther' Bump

Powered by DjangoBB