-
Notifications
You must be signed in to change notification settings - Fork 1
Counters and tiling objects
Objects like counters and tables in The Sims have modified depth values which allow them to take up an entire tile and match the surrounding ones without clipping through eachother or the walls. This tutorial explains 2 ways to modify the depth of your object in Blender.
The back of the object needs to have depth added, so that it will always appear in front of anything that is behind it. To do this we can add some geometry to it, and set it to use a material with an alpha of 0. This will affect the depth and nothing else. In the case of something square like a counter, you can set up all rotations at the same time by creating geometry that can be seen at the back, but not at the front.

The vertical planes are at a 45 degree angle, and the horizontal planes are sqrt(2/3) times as high as they are wide.
The front side of our object needs depth to be removed, so that it will not extend out through walls from behind. This can be done by adding geometry to another view layer in blender, and then using compositor nodes to choose only the furthest depth values. For cutting off the depth of both front facing sides of a cube, you need a plane in a view layer per side. Set up your view layers so that they're the only thing rendering in them. Make sure they're in the right position for the currently active rotation, and then parent them to "The Sims Rotation Origin" object, so that they will move with the camera.

You only need to cut off a small amount for it to work.
Now in the compositor nodes you can modify the depth. If you want to modify the depth in any way, you need to do it between the "The Sims Renderer Pre Depth" and "The Sims Renderer" nodes. You'll need to create a mask for the depth and use it to mask out the depth coming from the other view layers, or you can get bad results. This is done by the absolute and multiply nodes. Then take the maximum of both view layers and the original depth.

The end result is an object that can tile seamlessly in-game, without clipping through anything.
