Labels

Monday, August 2, 2021

Research Project: Trim Sheets

 So this semester I said I was going to hyperfocus on one technical aspect of the job, and that's trim sheets for me. Trim sheets are an essential part of the environmental artist's toolkit; you'll be expected to make a bunch of assets quickly to the point where you can't texture everything individually, there's just not enough time. You will also be asked to make large swathes of architecture, and this is where these little guys come in. So where you'd typically need at least a couple materials for an environment, you can accomplish the same with just one, saving on space and drawcall power when it's time to package your game. 

WHAT IS A TRIM SHEET?

This is what a trim sheet looks like: 


Essentially, you'll have a variety of horizontal strips, each bearing a specific texture. When you go to texture your objects, simply UV them into strips and lay them out on top of this texture according to whatever texture you would like the objects to have. Because of the way UV space works, if your UV shell stretches out beyond the actual udim, so long as it's a horizontal stretch, it will continue to retain the texture. Trim textures run infinitely off to either side, so take advantage of that with your assets and UVing. This is the true strength of trim sheets, and the reason they're used to texture large areas and buildings, because they can cover a large area quickly and retain a good resolution while doing it. 

Here's an example of how this trim sheet was used. Notice how the environment has a consistent look to it, and all the wood seems to come from the same place? 


Trim sheets are super powerful and if you make them right, you can theoretically cover an immense amount of ground with just a single one. However, they require a lot of planning and technical knowledge to pull off.

HOW DO I PLAN A TRIM SHEET?

The first thing you have to do is figure out how big you want your sheet to be. Usually you'd go about it by your texel density, which governs how packed your resolution will be. I typically make 2048 resolution trim sheets, which cover about 4 meters of geometry. The texel density for these sheets is .512, which is the industry standard and used in games like Uncharted and God of War. 

So, knowing you have 4 meters squared to work with (4 down and 4 over), what are you going to have on your trim? This is the time to take out your reference and your untextured proxy shapes and mess around to see what you come up with, what shapes you want to bring to the textures and what designs you'd like to focus on. I'll be using my pirate ship trim for this example:


In this concept sketch, I planned out some support pillars, a network of ceiling beams, and a complex wall arrangement of wooden plans with a thick beam running down the middle and inlaid panels at the bottom. This was a relatively easy and simple trim sheet since most of the elements were arranged in order on the wall itself, so it was easy to visualize how it would end up looking. If you scroll up and check out the trim sheet, you'll notice it looks pretty much like a chunk of wall, and that's because that's basically what a trim sheet is. 


Once I knew what I wanted, all I had to do was plan out what I needed and grant each texture a proportional space in my sheet. If you plan out your trim in the sense that you have a measured ratio (1 meter strips, half meter strips, etc) then you’ll be able to plan out game assets better and if there are any variances in your sizes, you can squash and stretch the geometry or the UVs to fit the trim sheet. 

MAKING THE TRIM SHEET

So this is the part where we open up Maya and try to fit our ideas into a real 3d space, which generally involves some fiddling about. You should be able to have a basic layout done though, since if you're making a 4x4 sheet all you need to do is make a plane at that size, and add divisions to denote the different textures you planned out. 



So the first thing to do is slap a reference object in there to make sure your scaling is correct, and once you're confident that it is, begin extruding and forming the basis of your trim textures. We're going to be following a standard high poly to game res workflow, except instead of a game res model you'll bake over, we'll simply bake on a subdivided plane; the very same one you should have right now. Duplicate that, and extrude out the shapes on the copy, that way you'll have your game res already made.

The reason why I emphasize subdivided is because you'll want to make each strip a separate object. That way, when you get to Substance Painter, you can easily mask out areas based by mesh, but most importantly, bake things correctly. For example, the top strip could be Trim_Sheet_Wooden_Planks_Low, and you'd have a corresponding high res piece to bake on it. Understanding the baking process and how information maps are generated is an essential part of trim sheets. I'll explain some common pitfalls later, but for now continue making the sheet.

For any horizontal tiling, you don’t need end caps so you can delete those. Anything that isn’t tiling will need end caps though. Once you've gotten all your detail in, you've got to prepare the trim sheet high res for importing to ZBrush, and having it survive the process of dynameshing. Typically you want to add supporting edges so that your shapes don't shrink or subdivide weirdly (like a rectangle turning into an oval), but this also means extruding the back of the trim sheet out to form an enclosed mesh. 

I'll demonstrate what this means. Here is another trim sheet I made. Notice how the back is empty, as in there are no back faces?


This is fine for a game res, but not for a zbrush import. As soon as you hit dynamesh, the wall will attempt to close itself off and it'll have weird geometry on top of deforming unpredictably, and being too thin for certain operations. I made this mistake with my first trim sheet and it made sculpting really hard because of the way my geometry was affected, it made a massive seam on the edges when it came time to bake. 

SCULPTING IN ZBRUSH

When you bring the trim into Zbrush, be sure that each element is a separate subtool for easier subdivision and sculpting. Subdivide each piece of the trim so that it has roughly 1 to 2 million polys. That should give you enough geo to get things detailed. Subdivide with “smooth” turned off, and then after a couple tries, turn smoothing back on and subdivide again. If there are any curved pieces, subdivide in Maya and get it nice and populated before importing to zbrush because the process outlined above (subdivide without smooth a couple times and then with smooth) will cause it to warp.
For the big panels and other trims that don’t tile, just sculpt as normal. However, for everything else, you’ll need to modify your brush to tile. Basically think about it this way: you're looking at a flat cylinder. The left edge of your trim sheet should be able to seamlessly transition into your right side. If that doesn't happen, or if there's a seam, the repetition and tiling of the trim sheet will be disrupted and there'd be no point to making a trim sheet in the first place. Therefore, you make your brushes tileable to avoid this. 

WARNING: You’ll have to do this for every brush!

BRUSH MODIFICATION: Brush>Curve>WrapMode: turn to 1. This will make your brush strokes go from one edge of the sheet to the other, retaining positional data so you can then go back and continue the stroke to give the illusion of a tileable texture. 

For the first pass, get the basic shapes of each piece down. Then, add more detail as you go on. Make sure that none of it is super apparent when you’re tiling it, otherwise it ruins the effect of the trim sheet. This means no unique damage, nothing too flashy or attention-grabbing because otherwise, you'll be seeing that very distinct piece tile over and over and it'll be obvious you're repeating a pattern. 

Use the layers function in your workflow! It's a nondestructive way of adding detail and experimenting with it. You don't have to commit to any changes, and can slide the tolerance around to smooth out or intensify whatever you did. 

One last piece of advice is that if your tiling is weird with these textures/brushes, test it out in Maya and see where the issue is. If it needs to be fixed, don’t worry about doing so in Zbrush but instead take it to Photoshop and spot heal it out. Another thing that you could do is fade the ends with a smooth brush to hide the detail and “magically” add wear detail so it tiles better.

BAKING YOUR TRIM SHEET

Turn on your oven to 350 degrees. Import in all your pieces from Zbrush, rename them to highs and lows in accordance to your game res piece, and then prep the pieces for baking. Since this is a tiling texture, it's not as simple as just exporting it out and baking. Depending on where you want your AO and curvature maps, you may need to do the following:


The center piece is the original trim sheet, but since I want there to be AO info on the sides of these tiles, I have to put geometry on either side and the top. That way, when this high res is baked, the trim sheet will act as if it were truly tiling, but we're just tricking the program into including that tiling info for us. One last thing to keep in mind is that it is absolutely necessary to know if the UVs for the top of the geometry correspond to the top of the UVs, otherwise your texture will render weird. 

Be sure to unfold your game res piece! There's nothing more heartbreaking that texturing a whole trim sheet and realizing your UVs are scuffed. Make sure to check everything twice before you do it, and understand what you want and need during the planning process so you don't have to redo it!

A FEW BAKING TIPS

Keep in mind your Max Frontal Distance and Max Rear Distance when baking and it’ll save you a lot of time. For example, I typically put .07 or .1 as my values for those settings when dealing with trim sheets since you're baking a lot of tridimensional detail on a flat plane. 

In order to test out your trim sheet, duplicate your game res on either side of the original, and reimport to see if it tiles in Substance: 


And finally, zoom out every so often and check to see how your textures look! Sometimes we spend so much time texturing in little details that never matter, or we make mistakes, etc. Always check your work!

THE FUN PART

I'm kidding, naturally. This isn't fun at all as it involves everyone's least favorite part of 3d, UVing. In this step, you're gonna take the textures you exported from Painter and slap them on your assets in Maya. I'll demonstrate with the pirate ship once again. 


Here is a shot of a properly UV'd asset. It uses three of the trim strips, which I'll show below. I decided to make a lambert and put the normal map of the Painter textures in there so I could have a visual reference of what I was doing. Once that was done, I then had to slice the geometry and cut UVs to overlay on top of the trim sheet itself. 


This is the trim sheet itself, provided thanks to the lambert I put on that windowed wall. All I had to do after that was unfold the UVs and play around with them until I got them to tile and look good. It sounds complex but it's very intuitive, and other than the actual UVing process it's quite fun to see your textures pop up on screen!

With that being done for all your assets, you're good to go! As long as the UV position of these assets doesn't change in relation to the trim sheet they're using, the textures should hold and show up perfectly in Unreal. Using this method, you can make modular textures and dynamically change colors, details, etc on entire rooms and even buildings. There's no limit to the amount of things you can do with a solid foundation in trim sheets and a good understanding of the technique. 

And that's pretty much it for me! Thanks for reading all this, and if you want to know more, here are some resources that might do a better job than I at explaining the process:

https://www.youtube.com/watch?v=uUJShalzWy8

https://www.youtube.com/watch?v=DipfrjCgYW8&t=0s







No comments:

Post a Comment

Saint Anatoles Cathedral (3D Art Week 03)