- Home /
Floor tiles - one big texture or many different prefabs?
So, this is nothing serious, just a school project, but i can't find any comprehensive answer to that question.
I want to make a sci-fi styled floor, which supposed to consist of cubic tiles. For performance, what is the best way to approach creating a 3d tiles like that? Create tiles in gimp/photoshop and apply them on one big texture, or create different materials (with normal map, albedo, ect) and apply them to individual prefabs in the scene?
Answer by whisp · Feb 20, 2017 at 01:11 PM
Performance-wise, best is using one big texture (a texture atlas or, if you want, tile atlas) AND one big mesh for the floor AND a shader that is specialized on placing the specific parts of the texture atlas (the single tile textures) on the floor mesh where you want them to be.
Much more flexible and performance-wise pretty good is using one big texture AND one big mesh with 4 vertices per tile. That way you can set the uv-coordinates for each vertex separately (in order to pick the right tile from the texture atlas) and thus use most shaders without the need to alter them, e.g. the unity metallic or specular shaders.
I find these two articles very helpful, since they also handle details such as tile atlas specific problems like texture bleeding:
Daggerfall Workshop: http://www.dfworkshop.net/improved-terrain-tiling/
GPU gems: http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter12.html
Answer by ThisGuyThatsHere · Feb 20, 2017 at 12:20 PM
@IgorAherne is right, tho if you want to make it even better you can generate custom mesh covering every place you need (or simply make it in 3D program) instead of basic tilling and even further you can controll triangles based on player distance, but in the end it all depends on how much optimized you want it to be, on view distance and many more.
Answer by IgorAherne · Feb 19, 2017 at 11:41 PM
Create tiles in gimp/photoshop and apply them on one big texture, unless texture size is important
This saves drawcalls if you use the same instance of material
Answer by Ragequit0605 · Feb 21, 2017 at 05:04 AM
For performance, you can create a flat plane and apply a tile texture to it with things like normalmaps to it. You could even take a stab at parallax mapping for a 3D effect and DirectX11 tesselation is not out of the question either.
However, it wouldn't be too demanding to create 3D tiles (if you keep the polygon count low) and if you use LODs to switch it to a flat face after a certain distance.
EDIT: On a more obvious note, make the texture seamless if you do go down that route and tile it to make it look clearer than it actually is. For creating normal and height maps, use something like Crazybump or InsaneBump (a free alternative)
Your answer
Follow this Question
Related Questions
What is a reasonable number of draw calls relative to one hardware configuration ? 6 Answers
what's the best way to reduce draw calls? 9 Answers
How do you properly let unity resize texture tiling? 0 Answers
Will unity sort Drawcalls to reduce overhead ? 0 Answers
Fixing fill rate issue on Android - best approach? 0 Answers