Best way to render hundreds of textures for flooring in an in-game editor?
I'm working on a project to recreate the build mode from The Sims 2, and I've been stuck for weeks trying to figure out what I need to do for the floor pattern placing system. I've built up my editor enough that I really can't put this feature off any longer.
I'll start by describing what I have and what I need to do.
- The world is called a Lot, and the Lot has multiple Levels, which are made up of Tiles.
- Every Tile has four Quadrants -- North, East, South, and West.
- Each Quadrant needs to be able to be "painted" with a floor pattern texture.
- A Quadrant is essentially a mesh triangle.
- Quadrants help facilitate things like terrain sculpting and diagonal walls.
- The maximum Lot size is 60x60 Tiles, which is 14400 Quadrants per Level, up to 16 Levels.
This is the structure of a Tile and its 4 Quadrants:
Because there are so many of these Quadrants, I currently have them all combined into a single mesh plane for each Level on the Lot, and I can just enable/disable certain triangles on the mesh based on a rule set for what is considered a valid floor location.
This works really well for performance, but now I have absolutely no idea how I can allow the player to place floor pattern textures on these individual triangles at runtime.
Here's a screenshot from The Sims 2, where every floor pattern has been placed: Image
That's about 670 unique 256x256 textures.
An impressive feat for a game from 2004, but can Unity do it?
My project is for modern PCs only, so no restrictions there.
I've worked with texture atlases before, but that doesn't seem like a viable solution.
Since keeping all the tiles in a single mesh seems necessary for performance, I'm stumped.
Is this a situation for shaders? Maybe even compute shaders?
I don't know enough about them to know really.
No real graphical work has been done yet, so I'm not restricted to a specific render pipeline.
I suspect such a system would be very complex and uniquely custom. I am 100% up for the challenge though, so any guidance on what I should begin researching is greatly appreciated. And of course if you think this is completely impossible to do with Unity, I'd like to know that as well. But I won't give up easily.
Your answer
Follow this Question
Related Questions
Problem with a transparent texture in an object that already has a material 0 Answers
Material Rendering Bug 0 Answers
material looks pink with "Tree creator bark" shader 0 Answers
Add alpha channel support to this shader? 0 Answers
Is there any way to make a custom written shader with hdrp? 0 Answers