Jump to content

Optimizing textures for thousands of sprite sheets


visgotti
 Share

Recommended Posts

I’m working on an RPG type game and plan on having eventually thousands of skins for bodies, heads, weapons, etc.

If there’s 20 people on the screen at the same time it can be up to 100 different textures being rendered at once. That’s just from the player model.

would dynamically combining textures based on who is in your screen be a good solution to this problem? That seems too intensive to do on the fly though especially if new people are constantly moving in and out of your view. 

Link to comment
Share on other sites

Lets assume that 200 drawcalls on PC, 50 on mobiles are fine.

100 different textures + multitexturing x16 pr x32, its only 8 drawcalls. Its nothing for PC. Ok, mobiles, x4 - 25 drawcalls. Good enough.
Dynamically combining textures

1. pixi-tilemap does it for tilemaps , its used in RMMV and relatively easy to understand code. (google pixi-tilemap tutorial)
2. pixi-super-atlas is very heavy solution, only a few people use it, it doesnt have documentation except "test/check.ts" 

You can measure number of drawcalls by hijacking "renderer.gl.drawElements" call, like here: https://github.com/eXponenta/gstatsjs



 

Link to comment
Share on other sites

Quote

would dynamically combining textures based on who is in your screen be a good solution to this problem

This technique is called "Virtual Textures" or "Mega Textures" and is very common in PC games, though can be a bit harder on embedded devices depending on GPU space. Remember that the GPU can only handle up to a certain size of texture, and it isn't all that big :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...