I have been having this issue with grime lately. It is not something I know very well and when it comes to adding it to buildings with tillable textures I'm at a complete loss. I was going to explain my self but I found this question on some archives that explains my issue perfectly:
I have been using a texture sheet for my buildings so in the top left corner I have a 512x512 Stucco texture for my buildings which tile perfectly, but my problem is I cant figure out how to add other details like grime and dirt on the model without making the grime looking 'tiled' (this is assuming that i had the grime details on the stucco texture itself.)
People have told me to have a separate stucco texture with grime on it but this means that any time I have a texture that needs grime on it I have to have 2 versions of that texture?
This is a concept I cannot wrap my head around yet and I was wondering if anyone has any suggestions? The game I'm working on is using Unity which does not allow painting of texture on in the engine at least I don't think so?
Replies
Grime Decals?
have the grim use modified world coordinates for it;s uv's, so you can make it tiles at a different rate than the rest of the textures, and have it say only at the bottom where the building meets the ground, or something like that.
also out of the box your right unity cant paint vertex colour, but there are 3rd party tools to do so, or you can just vert pain meshes in maya / max than import them.
I have a 1024x2048 texture sheet that has around 8 512x512 textures on it, one of the textures is the Stucco I use on my walls.
But if I used Vertex Painting to combine the Stucco texture and a Dirt texture would the Dirt one need to be on a second texture sheet of the same size and in the same spot as the Stucco one or can it just be its own single texture?
Also I'm not 100% sure what you mean by this: "have the grim use modified world coordinates for it;s uv's" ? Remember using grime with UV Mapping and textures is really new to me so could you explain it like I'm a newbie?
In UDK this would be very easy to do with the built in shader editor. In unity I know I have seen at least one node based shader addon/plugin but I think it costs a few bucks and I'm not certain of its total functionality but I will try to explain the other questions.
The dirt does not need to be on a texture sheet of the same size, or position. It would probably be a smaller tiling texture. To make it match texel density of the stucco, you would use some sort of multiplier to make it tile more and because it is a tileable texture, it really doesn't matter where your UVs are located on the initial texture sheet because it will just repeat many times until it gets to that part of the UV space.
Modifying the UVs with world space units is using the postion of the object you are placing in the level to offset the UVs. This is done so objects don't have the same pattern of grime in the same exact spots. Say you have something that repeats like a fence, you would notice quickly if the same pattern of grime is on the same parts of the fence very quickly, but if the UVs are offset based on their position, where tiling grime repeats on each section of fence would be different so the pattern would vary.
Lastly think of the vertex color as a mask that is used by the shader that determines where where the grime would show on the stucco. Things can even become fancier with mix maps to get a higher resolution blend.
Good link demonstrating vertex painting and mix maps in UDK:
http://eat3d.com/free/vertex_painting
Also you don't neccesarily need a third party tool to paint vertex colors, you can paint them in your app of choice and then import, though being able to have different instances of an object with different vertex colors like in UDK can be useful to add variation.
However, I still don't get how to modify my UVs to add grime? Most of my UVs are pretty basic square shaped ones.
Create a grime texture with a transparent background. Make a new model, it should just be a flat plane. UV the plane, and map the grime texture. Now, just move that plane on top of the wall, leaving a bit of space so you don't get any fighting.
But would it look cheap to a player?
Would you say leaving 0.1 Units space would make it look convincing?
The reason you need a little bit of space is because if both faces have the exact same cords, the renderer will not know which one to render. No player will see the little bit of space.
(the in-game example is rather crud, this image is oldddd)
This is what Z-Fighting looks like BTW: