- Home /
Sims like building
I want to implement a sims like building phase. My question about the whole thing is how EA is solving the obvious performance problem? Example: The whole house is covered in different textures so Im not sure if its possible to just use one big quad and put 256 different textures on it?
My idea is to detect the outside of the house and to only render this part, after a player is nearby the inner house will be rendered.
Hope you guys can give me some comments on it.
Edit: As suggested I uploaded a picture, imagine a house like this but like 50 times. Im not sure how that works performance wise and whats the best approach to render the tiles like I said what happens if every tile has a different texture. Do I have to render each texture with a quad or is there some secret technique for it ?
Answer by MadDave · Oct 16, 2012 at 09:54 AM
Rendering a huge number of different textures is a bad thing since it requires a lot of draw calls (i.e. driver overhead, pipeline reconfiguration overhead...).
There are two possible solutions:
Combine as many textures as possible to large atlases. Try to render the whole house with one texture if possible. The size of an atlas is restricted by hardware, of course, usually you cannot go higher than 2048 or 4096
However, in most games you have too many textures to fit on a single atlas. "The Sims" has hundreds of furniture pieces and you don't know which ones the user is going to use. In that case you have to dynamically combine the textures that are acutally used to a big atlas. Every time something in the house changes you will have to update the atlas. That causes a little overhead, but afterwards you can render the house in a single draw call. Many games use that trick.
The second solution seems to be just fine, thank you very much :)
Your answer
Follow this Question
Related Questions
how to get nice building overlay textures 1 Answer
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers
Getting texture from project files and placing in script 1 Answer
The Sims-like movement script? 1 Answer
Change textures at runtime on object with multiple textures? 1 Answer