Difference Between 2D Images And Textures?

Started by
22 comments, last by Sabit Merah 7 years, 11 months ago
I keep reading about how 2D assets, like sprites and prerendered backgrounds take up a lot of memory and space but how are they different than textures used on 3D models?

Please note that I have no programming experience.
My only involvement in games are making browser stuff and I do sprite animations.

Asking out of curiosity.
Advertisement

Generally they are the same thing.

In some contexts, such as that of a specific API, a "2D image" may be a different thing (as in, a different language type or for a different purpose) than a "texture," but in general both are just picture data. The most common difference will likely be that that things called "textures" generally may have multiple mip levels (which are, effectively, successfully lower-detail smaller versions of the picture) associated with them, whereas a "2d image" is usually just the one image.

Generally they are the same thing.

In some contexts, such as that of a specific API, a "2D image" may be a different thing (as in, a different language type or for a different purpose) than a "texture," but in general both are just picture data. The most common difference will likely be that that things called "textures" generally may have multiple mip levels (which are, effectively, successfully lower-detail smaller versions of the picture) associated with them, whereas a "2d image" is usually just the one image.

Thanks for the quick response.

Is mipmaps the only difference between textures and images?

Is mipmaps the only difference between textures and images?

As he wrote, it depends on the context.

For some contexts they are the same thing.

For other contexts they refer to data formats. Highly compressed formats like png and jpg need much memory and space to be decoded before going to the video card, some formats such as S3/DXTC and PVRTC are supported directly by different video cards, so some systems call one pictures and the other textures.

For other contexts it is the contents of the data, already mentioned were the presence of mipmaps.

Generally textures are images, you can open them in Photoshop or your other favorite image editor and do with them whatever you will.

For other contexts they refer to data formats. Highly compressed formats like png and jpg need much memory and space to be decoded before going to the video card, some formats such as S3/DXTC and PVRTC are supported directly by different video cards, so some systems call one pictures and the other textures.

Thanks, this is informative.

Is mipmaps the only difference between textures and images?

As he wrote, it depends on the context.

For some contexts they are the same thing.

For other contexts they refer to data formats. Highly compressed formats like png and jpg need much memory and space to be decoded before going to the video card, some formats such as S3/DXTC and PVRTC are supported directly by different video cards, so some systems call one pictures and the other textures.

Building on this, and on Josh's previous reply, the compression format or lack thereof is often driven by the image content itself. Textures representing real-life images or "material" textures used in games often compress very well, even to lossy compression formats without a great deal of apparent visual fidelity loss. However, what you might typically call a "sprite" -- such as an animated character in a 2D fighting game, or any sort of "retro" look -- usually suffers too much quality loss from being converted to those kinds of compressed formats; instead, they might be left in an uncompressed format where their exact, pixel-perfect representation is preserved. On-disk formats like GIF or PNG can serve those images well, but GPUs don't understand them; so its common to see those formats on disk, with a conversion to raw (A)RGB before hitting the GPU. An 8.8.8.8 ARGB image is 32bits/pixel, while a highly-compressed textrue format can get as low as 2bits/pixel if the image content is suitable.

throw table_exception("(? ???)? ? ???");

I keep reading about how 2D assets, like sprites and prerendered backgrounds take up a lot of memory and space but how are they different than textures used on 3D models?


Just for clarity, in case it was why you're asking: 3D models' textures also take up a lot of space, typically the most space (by far!) of all the data that accompanies a game.

Sean Middleditch – Game Systems Engineer – Join my team!

Building on this, and on Josh's previous reply, the compression format or lack thereof is often driven by the image content itself. Textures representing real-life images or "material" textures used in games often compress very well, even to lossy compression formats without a great deal of apparent visual fidelity loss. However, what you might typically call a "sprite" -- such as an animated character in a 2D fighting game, or any sort of "retro" look -- usually suffers too much quality loss from being converted to those kinds of compressed formats; instead, they might be left in an uncompressed format where their exact, pixel-perfect representation is preserved. On-disk formats like GIF or PNG can serve those images well, but GPUs don't understand them; so its common to see those formats on disk, with a conversion to raw (A)RGB before hitting the GPU. An 8.8.8.8 ARGB image is 32bits/pixel, while a highly-compressed textrue format can get as low as 2bits/pixel if the image content is suitable.

Aside from 2D sprites vs 3D character models,

What about fully-rendered environments vs prerendered backgrounds? (e.g., Resident Evil 2, Final Fantasy VII)

First of all, I'm aware that you can't turn the camera around in prerendered backgrounds but what about how it runs?
Like how it's compressed, streamed and so on.

For reference, let's say the prerendered backgrounds are formatted for 1080p.

For Resident Evil 2 and Final Fantasy 7? Yes, even they likely had more data in models than environments. But that is not a product today, that was hardware and software from 1997, not 2016. The games that worked 20 years ago on the 33 MHz playstation will run just fine on a 4x4GHz machine today.

For Resident Evil 2 and Final Fantasy 7? Yes, even they likely had more data in models than environments. But that is not a product today, that was hardware and software from 1997, not 2016. The games that worked 20 years ago on the 33 MHz playstation will run just fine on a 4x4GHz machine today.

What if someone were to make new games with prerendered backgrounds today, using current hardware (1080p resolution)?

From time to time, I come across comments from people who really want to see newer games to have prerendered backgrounds because they couldn't get enough of the novelty, so I got curious and wonder about the pros and cons of fully rendered environment vs prerendered.

As I mentioned, I'm fully aware of the part where you can't turn the camera if your character is in a prerendered environment but some people don't care about that.

This topic is closed to new replies.

Advertisement