Home Technical Talk

Grime on Tileable Textures?

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

  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    2 textures blended with vertex colour?

    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.
  • 1magus
    Options
    Offline / Send Message
    Right I can see the usefulness of a third party Vertex Painting tool for Unity but does it combine the textures with no work on my part or do both textures need to be in the same spot for a UV Texture Sheet?

    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?
  • m4dcow
    Options
    Offline / Send Message
    m4dcow interpolator
    1magus wrote: »
    Right I can see the usefulness of a third party Vertex Painting tool for Unity but does it combine the textures with no work on my part or do both textures need to be in the same spot for a UV Texture Sheet?

    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.
  • 1magus
    Options
    Offline / Send Message
    That was a very detailed explanation Thank You :)

    However, I still don't get how to modify my UVs to add grime? Most of my UVs are pretty basic square shaped ones.
  • Benton
    Options
    Offline / Send Message
    It is really simple, you don't actually need to do any blending.

    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.
  • 1magus
    Options
    Offline / Send Message
    That could work true.. that is a very good idea.

    But would it look cheap to a player?

    Would you say leaving 0.1 Units space would make it look convincing?
  • Benton
    Options
    Offline / Send Message
    I use this method for cracks, dirt, little details that I cant put on a tiling texture. It looks fine.

    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.
  • Snader
    Options
    Offline / Send Message
    Snader polycounter lvl 15
    Depending on the engine you're using and how flexible it is, you could try using your AO as a mask, like this:
    Modular%20Texture%20Optimization.jpg
    (the in-game example is rather crud, this image is oldddd)
  • m4dcow
    Options
    Offline / Send Message
    m4dcow interpolator
    What Benton is talking about are called decals, and moving them slightly away from the base surface is to avoid Z-fighting. There is no exact distance of how far apart they should be. I would say do a few tests and when you don't see the weird shimmering effect on your object in engine, you should be good.

    This is what Z-Fighting looks like BTW:
    ZfightingCB.png
  • JamesWild
    Options
    Offline / Send Message
    JamesWild polycounter lvl 8
    Beware that Z-fighting will be worse on platforms with less depth/z buffer bits, and many mobile platforms cheap out a little on depth buffer quality because it's largely unnoticable and saves a lot of memory/transistors.
Sign In or Register to comment.