Home Technical Talk

Vertex painting / texture blending

polycounter lvl 8
Offline / Send Message
danshewan polycounter lvl 8
So, I'm wondering if it's always preferable to blend textures using vertex painting as opposed to creating the blended texture as a single diffuse map in Photoshop?

I'm pretty new to the concept of vertex painting, and I'm faced with a situation that could probably utilize it pretty well. Initially, I'd intended to just combine the two elements in the diffuse map, but I'd really like to get my hands dirty with vertex painting and I guess some tips, things to consider and pros and cons of the technique would be really helpful.

So far, I've been reading this tutorial, and this page of the UDN:

http://www.3dtotal.com/team/Tutorials/vertex_paint/vertexpaint_01.php

http://udn.epicgames.com/Three/MeshPaintReference.html

Links to any other resources I should be reading would also be appreciated.

Thoughts?

Replies

  • Eric Chadwick
    Vertex blending is used because it's a very efficient way to blend textures without using more texture memory, because the vertex color is usually already there in memory for every vertex.

    If instead you have to make an explicit texture for each blend, it can eat up memory pretty quick.

    The biggest drawback is you often need to be careful about adding enough vertices in the right places in order to get good blends.

    And the blends are usually very soft and smooth which can look pretty bland, unless you have a nice shader that uses a heightmap to add detail to the blend (see The Snow and Ice of Uncharted2?).
  • Mark Dygert
    Vertex density will determine the resolution at which you can paint your blend. You end up putting in verts where you normally wouldn't to get a good blend. You also need to be mindful of where the hidden edges fall as it tends to effect the blend. Flipping some of the hidden edges or making them visible and forced to face another way can help break up the repeating blend pattern, but only so much.

    What app? Looking to do it in the 3D app or with UDK? Either way works with UDK but its hard to get specific about how to without knowing, with what.

    I like the vertex paint tools in UDK, pretty awesome. UDK even imports vertex colors that where already painted into meshes (provided you check the approprate boxes when exporting). It's also great for painting in a bit of unifying color into the scene.

    As much as I like the paint tools in UDK I would probably start off with a pretty dense plane, paint the blends in the 3D app, optimize the plane to give defintion around the blends and cut out a lot of the un-needed geometry then export the final mesh.
  • danshewan
    Offline / Send Message
    danshewan polycounter lvl 8
    Thanks for the input, guys.

    I'm working in Max, and right now I don't have a preference as to whether to paint in Max or the UDK. I'm still trying to wrap my head around the concept, so I'm really just soaking up the info.

    I've been through the Uncharted 2 thread, and it was interesting inasmuch as someone with very limited knowledge of the technique can find it interesting!

    I'm trying to make some headway with my Japanese temple scene, and it's the courtyard that I thought might benefit from vertex painting. The effect I'm trying to achieve is an old, forgotten stone slab courtyard overlaid with dirt, sand etc.

    Right now I'm still evaluating whether or not it's even practical to get into this, or whether I should just use a single diffuse map.

    Thanks again.
  • Mark Dygert
    The 3D total tutorial was confusing as hell the first time I read it. Mostly because it was blending a bunch of textures and using some crazy masking techniques. I think it tries to teach too much at the same time?

    If you're looking to play around with it in Max, create a blend texture, put one tile material in each slot and in the mask slot put vertex color. Then on the mesh apply the "VertexPaint" Modifier and paint your blend using B/W.

    You could also experiment with dirt piles or planes, that have an opacity fade around the edges to get rid of the harsh sharp line.
  • danshewan
    Offline / Send Message
    danshewan polycounter lvl 8
    Vig wrote: »
    If you're looking to play around with it in Max, create a blend texture, put one tile material in each slot and in the mask slot put vertex color. Then on the mesh apply the "VertexPaint" Modifier and paint your blend using B/W.

    Cheers, Vig - I'll try that. It's good to know that the 3DTotal tutorial author touches on two different topics, vertex blending and masking, in the same tutorial without stating it - at least I know now.
  • danshewan
    Offline / Send Message
    danshewan polycounter lvl 8
    Vertex blending is used because it's a very efficient way to blend textures without using more texture memory, because the vertex color is usually already there in memory for every vertex.

    If instead you have to make an explicit texture for each blend, it can eat up memory pretty quick.

    Okay, so at the risk of sounding extremely stupid (though I'm assured there are no stupid questions), aside from being able to blend two tiling textures together much faster than creating a single diffuse map (say, for ease of use on modular building assets like walls etc.), are there any other benefits to using vertex paint blends?

    Obviously it's significantly quicker to experiment with painting vertices in Max than repainting a diffuse map every time, but for something like terrain (even a moderately small courtyard, which is what I'm using to experiment), surely it would be more economical to use a single diffuse map (maybe with some texture planes to add variation) rather than vertex painting, both in terms of texture size and vertex count?

    Have I got this right, or am I missing something?

    Thanks in advance for everybody's patience - I just want to get a solid handle on the why as well as the how.
  • DarthNater
    Offline / Send Message
    DarthNater polycounter lvl 10
    Danshewan I've been wondering the same thing myself. Yes, it saves on memory because you already have those two textures loaded into memory, but I always though, if I'm only loading one of those textures just for the sake of blending it, isn't that defeating the whole purpose? I guess they way I explained it doesn't really make much sense but hopefully someone understands what I am trying to ask.
  • 00Zero
    well, lets say you have a wall mesh that is repeated X number of times. if you go the traditional route and just give it a unique texture, all the walls will have the same texture and it will be obvious. (unless you break it up with decals or have multiple versions of the wall texture, each a little different).

    if you go vertex painting route, you can have like 2 or 3 tiling textures. (brick, stucco, moss). the textures are tiling, and so can be smaller size. plus you can use a mask so that intead of a soft linear blend between each texture, you can have hard edges. another plus is that even though you have the same mesh repeating (like a wall), each mesh can have different vertex coloring so they can all look different.

    http://www.chrisalbeluhn.com/UDK_Advanced_Vertex_Painting.html
  • Rick Stirling
    Offline / Send Message
    Rick Stirling polycounter lvl 18
    ^^ Yes.

    Not sure about Unreal, but you are not necessarily limited to 2 textures, you don't need to use just black to white vertex painting. You could have 2 or 4 or 5 or 8 textures and use vertex colours to paint the masks.

    Once you realise this then you can see the massive savings you have when compared to use textures for the blends.

    You do need more verts, but these should require less memory than the textures.


    Edit - you can also link spec and normal maps to the blends - imagine the memory costs needed to store the unique texture blends for all of those extra maps.
  • adam
    Offline / Send Message
    adam polycounter lvl 20
    Just the thread I was hoping to find - kind of. I've seen a few threads now on the vert blending within UDK and was wondering if anyone has those links handy? I can't find them on the boards.

    I'm looking for..

    • The more advance blending methods (masked blends, etc)
    • Painting on the mesh within UDK, rather than in max and importing
  • 00Zero
    check out this tutoriail. he uses cloud mask to blend, and paints in udk.

    http://www.chrisalbeluhn.com/UDK_Advanced_Vertex_Painting.html
  • Mark Dygert
    Adam, http://udn.epicgames.com/Three/MeshPaintReference.html
    It goes over mesh paint and what all the knobs do.

    Another great thing is that you can also paint colors into many meshes at the same time, making it a great tool to punch up the lighting and unify the scene with subtle colors. Paint a dark color around the base of buildings, lighter at the top.

    I also think there is a sample material in UDK already set up.

    Dan, in addition to what Rick and other pointed out also keep in mind that, normally vertex paint blends are used to cover large sections of terrain.

    So think of a huge grassy field and you need a dirt path snaking down the middle that blends into gravel then pavement. So 3 tiny tiles covers several acres of land where one giant texture would never really work.

    You could do a 4th grass tile to help break up the large repeating grass, very economical when it comes to texture space.

    Also, instead of having dozens of unique textures for ever modular chunk, you can have a handful of tiles you blend in different ways to get unique looking pieces. Add in cheap color nodes to tint the tiles and you have a lot of unique looking details but using very little texture memory.
Sign In or Register to comment.