2
\$\begingroup\$

I am few years behind in terms of browser capabilities. I plan to combine 3D with pixel art, and I am going to use Unity to make a browser based game.

I have made a stage that is one model and has around 1k poly's. Then I made a large 2048x2048 texture for it. Lots of that texture is tileable, I'd say that I could fit unrepeated parts on a 256x256 texture while the rest is just repeated content. This looks like a huge waste when I just tile it manually in photoshop on a big texture file and I feel like I am doing something "dirty".

But when I would split that one model into 100 models and tile them separately with 32x32 textures, that would make more sense, but would increase model count from 1 to 100.

What is the correct way to do this? Lots of models with tiled textures, or screw it and make one big model with one large texture? Or maybe performance now is so great I don't even need to care and just do whatever?

Thanks

\$\endgroup\$
  • \$\begingroup\$ is the texture periodic or just has similar regions? If it's periodic you could leave it at one model and just make this texture with wrapping uvs. \$\endgroup\$ – Sopel Dec 8 '17 at 11:04
1
\$\begingroup\$

It's almost always better to have one model; that's mostly because GPUs are optimized for pushing lots of polygons in a small number of draw calls. Indeed, a common optimization when there are lots of little models in a scene is to combine them all into one (generally referred to as "batching" or "baking" the meshes).

I do want to respond to this:

Lots of that texture is tileable, I'd say that I could fit unrepeated parts on a 256x256 texture while the rest is just repeated content

Assuming the mesh is tessellated in areas where the texture repeats, you simply arrange the UVs so those polygons share the same space on the texture. Boom, that portion of the texture is now tiled over the mesh.

In other words, tiling the texture is about manipulating the UVs on a single model, not making lots of separate models. Now you get a smaller texture and it's still only 1 object.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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