Using this method you can take the object above and create the one below.
What you will need is to have your finished mesh, have it unwrapped normally, and a diffuse/albedo map if you have it.
Take your mesh that is unwrapped normally and add another unwrap to it. This will add another set of UV coordinates for your other texture. I use 3DS Max but it'll work in Blender and Maya as well the interface will just look a little different. When you apply the second unwrap or UV coordinates, move everything outside of the 1 x 1 area. We do this because we can change the wrapping mode of the other texture to clamp and nothing outside of the area will affected. Next you unwrap it according to your decal/other texture. For my drum I grabbed 2 faces and did a flat Planar Map. Don't worry about over lapping your clusters on this map.
For your textures your base diffuse has no restrictions. My drum is using a 512 x 1024. Your decal texture however will require one thing, an alpha channel. My decal is a PNG where I cut out the sign and left it on a transparent background.
Above are both of my UV channels after the unwraps.
The shader is very simple. We will get your base texture and plug it into a Lerp. The decal will take the second spot and its Alpha channel will be the blend condition. The important part of this is to make sure your UV coordinates are correct. In Unity and most game engines your UV coordinates/channels get renumbered and start from 0, some 3D packages start from 1. The normal diffuse map will use channel 0 and and the decal map will use channel 1 in Unity. Now just make a Material using this shader and plug in your maps in the corresponding order. When Importing your textures make sure the Wrap Mode is set to Clamp for your Decal map.
If you didn't move your extra clusters from the 1 x 1 area you end up with something similar to the the object on the left.
When everything is done correctly you can swap out the Decal texture for anything with an Alpha channel. The drum on the far right is using a base sprite that comes with the default Unity UI. THIS WORKS IN ALMOST EVERY 3D PACKAGES/GAME ENGINE.
The Pros:
- You can use this method to recycle and add more detail to already made meshes. Being able to swap both textures helps you create unique looking assets with little to not effort.
- Due to it being two texture maps the decal map does not rely on the resolution of the base diffuse texture. On the three meshes above I have a 1024x1024 map, 512x512 map, and a 32x32 map.
- The perk of using this method instead of Multiplying/Adding/Etc the texture maps is both textures keep their respective properties and there are no restrictions.
- This can also work on your other texture Inputs like Specular. However I would not recommend doing this on your Normal map, I would just use your base texture's Normal map.
- If you are making a mesh with Graffitti/Stickers I recommend this method. Unless the other map is black, then I would just multiply it. You also don't need to have one Texture map for each Decal. The Decal map using its own coordinates lets you have a larger map with different things I just kept it simple for this tip.
0 comments:
Post a Comment