visgotti Posted August 19, 2018 Share Posted August 19, 2018 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. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 20, 2018 Share Posted August 20, 2018 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 Quote Link to comment Share on other sites More sharing options...
xerver Posted August 20, 2018 Share Posted August 20, 2018 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.