When going through the source code of some platform games I have noticed they use .png and .jpeg images in their source code for the sprites and various animations. I was curious if modern first person shooter games use the same strategy or do they just rely on a game engine such as Unreal or Rockstar Game Engine to render their graphics.

  • 1
    \$\begingroup\$ Hi, could you be a little more precise with your question. Are you in particular asking about how assets such as sprites and textures are managed or produced. All game engines be it 3d or 2d require assets to assist in presenting the game on screen, be it a custom engine or a more widely available engine such as Unreal/Unity. \$\endgroup\$ – ErnieDingo Jan 28 '19 at 21:14
  • \$\begingroup\$ What kind of game are you making? Have you experienced any difficulty using the kinds of assets you want to use in your game? We generally don't answer questions of curiosity about what "other games" do - if you're curious, the best way to find out is to ask the developers of those games directly. But we can help you achieve your goals in the game or mod that you yourself are making - that's what we're here for. :) \$\endgroup\$ – DMGregory Jan 28 '19 at 21:19
  • \$\begingroup\$ Are you asking if all modern games made with fancy engines only use procedurally generated textures instead of image files? \$\endgroup\$ – Vaillancourt Jan 28 '19 at 21:28
  • \$\begingroup\$ *.jpg = solidly filled rectangles only and *.png can have transparency. Beyond that it's up to the engine... \$\endgroup\$ – Patrick Hughes Jan 28 '19 at 21:55
  • \$\begingroup\$ yes @AlexandreVaillancourt \$\endgroup\$ – Cody Rutscher Jan 28 '19 at 22:17

You may have looked at the install directory of a major 3D game and wondered where all of the texture files are.

Almost all 3D games do come with image files that are loaded from the game data, just like a 2D game engine could load a PNG image; But there are some major differences between how 2D and 3D game engines work that lead to PNG files being less useful than other formats to store the image data in.

Some of the reasons that 3D games do not use PNG or JPEG files in particular:

  • Number of textures used:
    In a 3D perspective, you have the potential to display hundreds of textures in one frame. Loading all of these textures from a PNG file and then copying them to the GPU can take a long time. It is quicker to load a compressed image that the GPU can directly use.
  • Textures can have additional "layers":
    Bump maps, Normal maps, Specular Maps, etc. All of these are additional images that have to be lined up and combined properly to render a surface. Since these textures need to be bundled together, the file type they are stored in takes care of this too.
  • To prevent user tampering/modding:
    This is especially true for multiplayer games; Imagine if you could simply replace a wall texture with a transparent PNG image!
  • To save space:
    Even if there were PNG files included in the game data, games often ship with a compressed resource library that contains all of the game assets in a single or handful of files.

Despite these reasons to not use regular image files, game engines usually support loading these types of files and engines with resource managers such as Unity and Unreal will convert them automatically to the format that is optimal for that engine when you build the game.

|improve this answer|||||

Not the answer you're looking for? Browse other questions tagged or ask your own question.