Oh OK, cool, thanks.
@slicer: I've thought about that and hopefully I won't need to hand touch-up any. I'll have to review it carefully though.
Use a Pixel Shader or Make More Textures?
One thing to bear in mind when making these decisions is whether your GPU has sufficient bandwidth to access the textures. Spritesheets, in particular, tend to be large and randomly accessed and this can cause texture cache thrashing. Adding mip-map levels to entire sheets can make that worse.
In some circumstances, (particularly mobile) maths operations on simpler pixel data can be cheaper than extra texture lookups because GPU <-> memory bandwidth is often constrained by power requirements (driving the offchip memory controllers at higher frequencies would use too much power) while maths operations are relatively power cheaper (because they take place entirely on-chip) and hence more available.
In some circumstances, (particularly mobile) maths operations on simpler pixel data can be cheaper than extra texture lookups because GPU <-> memory bandwidth is often constrained by power requirements (driving the offchip memory controllers at higher frequencies would use too much power) while maths operations are relatively power cheaper (because they take place entirely on-chip) and hence more available.
@slicer: I've thought about that and hopefully I won't need to hand touch-up any. I'll have to review it carefully though.
However that isn't really a problem; instead of generating the mipmap levels at runtime they are generated off-line instead and combined into a single file by a pipeline for the game to consume.
You could still do the initial generation of the mipmaps via some autogeneration process, then save them out to disk for the artists to work with.
[quote name='Cornstalks' timestamp='1321168857' post='4883411']
@slicer: I've thought about that and hopefully I won't need to hand touch-up any. I'll have to review it carefully though.
However that isn't really a problem; instead of generating the mipmap levels at runtime they are generated off-line instead and combined into a single file by a pipeline for the game to consume.
You could still do the initial generation of the mipmaps via some autogeneration process, then save them out to disk for the artists to work with.
[/quote]
I actually have a question about that now that I've thought about it more. I'd like to pack my sprite animations into a single image file for each character (so as to avoid lots of texture switching, which I hear can slow things down? or is that not a good idea?). If I packed the high-quality ones into a single sprite sheet and then automatically generated several mipmaps from it, I'm worried that the downsampling would cause some frames to bleed into the other neighboring frames. So I don't think I'd like to do it automatically at runtime for the entire spritesheet.
How is this process you describe of generating mipmaps off-line and combining them into a single file different from what I talked about as one of my ideas in my OP? Originally I thought of packing all the frames into a sprite sheet, but then for each frame generating pixelated version as well (which I guess would essentially be a mipmap, by definition), and packing all the pixelated/mipmap frames with the sprite sheet as well.
I've never really worked with graphics that much (most of my programming is non-visual stuff), so this is new territory for me. I understand the basics about what a texture, mipmap, shader, etc are, but I've never really dealt with them much so I'm not sure how to work with them exactly or how to best reach my desired end result with them.
@Katie: how would you recommend doing this? It sounds like you're suggesting something more procedurally done, which is what I was thinking when I thought about pixel shaders (though pixel shaders may be far from the right answer). I thought about manipulating the texture, but that would mess it up for any other sprites that might be referencing the same spritesheet, wouldn't it?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement