Home Technical Talk

Terrain density and vertex colouring

polycounter lvl 14
Offline / Send Message
AlexLegg polycounter lvl 14
I've been looking into to creating a section of terrain in 3DS Max, and have a had a look around the web and on the wiki, but have ended up confusing my self more!

So to keep things simple to start with, what is a reasonable terrain mesh resolution?

I think I saw Eric comment somewhere that 2 quads per metre is pretty good. Is this still correct?


When using vertex colours to blend between textures, I believe it is acceptable to add more polys to control where the blend is and the softness of it. Is this correct?

If so, what is the best way to add these polys?

Can anyone be kind enough to show me a wire frame image of terrain that has been subdivided to control the blend?

When I attempted it, the mesh looked kinda messy and the blend was still poor. I think my initial terrain resolution was far too low thoigh.

Thanks.

Replies

  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    We just smoothed the vert colours where needed and tried to keep subdivision somewhat consistent. We were a stylized game though so smooth gradient blends was what I was after in the art direction.
  • AlexLegg
    Options
    Offline / Send Message
    AlexLegg polycounter lvl 14
    OK, thanks. Any comments on what a reasonable terrain density would be?
  • AlexLegg
    Options
    Offline / Send Message
    AlexLegg polycounter lvl 14
    I've attached an image of my poor attempt at a terrain and vertex blend.

    I think the blend looks too soft,but I'd appreciate other peoples input.

    Also I think that the terrain density is too low, it needs more quads. For some reason, at the time I thought it was too high poly!

    I've attempted to sub divide the mesh around where the building joins terrain, to control the blending. But it just looks nasty.

    Can anyone advise or show a better way to cut the mesh for vertex blending?

    Thanks,

    Alex
  • AlexLegg
    Options
    Offline / Send Message
    AlexLegg polycounter lvl 14
    Ah thanks Dustin. that brings me to another question I was going to get on to...

    As I understand it, decals are just a quad, that floats just off the ground or whatever, and have an alpha mask. Is that pretty much correct? They don't have any other special properties that I'm not understanding?

    In which case, I've heard people mention using decals to blend things like rocks and clifs etc to the ground. But I don't understand what kind of texture these decals would have?

    To my mind decals are normal bullet holes and graffiti! Could you explain this further for me please?

    Are the decals just on the ground plane, or would they be on the building or the rock etc instead or as well as?

    Sorry for all the questions, I just feel like I am missing something on this subject!
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    You can make a decal that has an alpha channel gradient that blends the two sufaces, also used that on our last game.
  • Computron
    Options
    Offline / Send Message
    Computron polycounter lvl 7
    Is it a common practice to blend ground using decals? Aren't decals expensive?

    Every guide I have seen recommends using vertex blending because it is cheap to do and with a few extra instructions you can make the transitions fit practically any scenario. Also because it does not take nearly as much memory as the texture would for a decal.
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    We used both on the last game. The 3 way vertex blend shader is actually quite expensive according to our rendering engineer. Diffuse, normal, spec = 9 textures which is costly to render I guess.
  • Eric Chadwick
    Options
    Offline / Send Message
    Yep, once again, it all depends... on the hardware you're making it for, the quality of your graphics programmers, the type of camera angles you'll see the terrain from, etc.

    I'm using vertex coloring on MMO terrain a ton right now. We store our terrain texture blending in a bitmap, not vert color. In our system the terrain subdivision is optimized for curvature, so flat parts get less vertices than bumpy bits. Which makes the coloring a bit tricky, but still do-able. Wish I could show some pics. :(

    Alpha blending is generally expensive, depending. Blending 3-4 texture sets is also kind of expensive, depending. But it all works out in the end.

    Best thing to learn this stuff is to just closely examine existing games that use the tech you're interested in. Try to sleuth out how they did things, and try doing it yourself. I've been recording bits of the latest Castlevania, to help me pick it apart, some truly awesome enviros in that one.
  • fade1
    Options
    Offline / Send Message
    fade1 polycounter lvl 14
    if you use vertex blending, you achieve much better results if the textures don't differ too much. for blending between unrelated materials like in your example, i would go for decals.
    as far as performance goes it's a matter of your engine. if your engine needs to keep all the textures of your vertex blending material in memory, like malcolm said, decals are for sure a better solution. plus it's easier to handle and you get better results.
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    And while we're on the subject, our art direction last year called for smooth gradients between the 3 textures as it was a key part of our look, but we would have investigated this technique if we wanted something more photo real and noisy.

    http://www.m4x0r.com/blog/2010/05/blending-terrain-textures/
  • AlexLegg
    Options
    Offline / Send Message
    AlexLegg polycounter lvl 14
    We store our terrain texture blending in a bitmap, not vert color.

    So would this be one giant texture for the whole terrain? Or is it many smaller ones? If so how do you use many maps without creating many shaders?


    So when we are talking about decals, are we talking about a quad with an alpha texture? or are we talking about some sort of projection of the decal texture in the game engine?


    What sort of decal textures would be used to blend ground textures or a house to the terrain? Are we talking about something alomg the lines like a texture of a small patches of stones, rock or dirt?
  • Eric Chadwick
    Options
    Offline / Send Message
    Many medium-sized ones. It's included automatically in the generic terrain shader, which can use up to four sets of diffuse/spec/normal. RGB channels let you paint blends for each of the 3 layers, on top of the fourth. Pretty basic, but works great.

    Usually projected decals are used when the terrain has uniform UVs, so the engine can just re-use that. Also projected decals are often for dynamic things, like a selection highlight under a model, or bullet holes or whatever.

    When artists place decals in specific spots, then they're often a mesh with alpha. Here's an example, though I believe these are baked into a megatexture, instead of alpha-blending "live" in the game itself. They're likely only alpha quads in the editor (so the level artist can edit them later).
    [ame]http://www.youtube.com/watch?v=b4ieFw2s7Fw[/ame]
  • AlexLegg
    Options
    Offline / Send Message
    AlexLegg polycounter lvl 14
    That was a very interesting video, thanks for that I found it very helpful.


    So I thought I would give some decals a go in Max, and see if I have this right, or if I have gone a bit wrong.

    The decals were knocked up quickly and don't have normals, so please excuse their crap quality. But otherwise crits and any advice is welcome.


    This first image is the Max view port. I'm not sure if having non quad non planar geom is OK. If you look at the base of the house (1) the decal is a box that surrounds it, is this OK to do?

    The other decals are just planes that are scattered around to help with blending. Am I heading in the right direction with these? Are they the kind of decals that are used for hiding seems and blending?

    decal1max.jpg


    decal2render.jpg



    This is a close up of the box decal to blend the house into the ground. The texture is a copy of the dirt on the ground with vertex alpha. Is this what was meant by using decals to blend a building to the terrain?

    decal3vertexalpha.jpg


    This is the decals texture sheet. It was done quickly so is a bit crappy, but is does this look along the right lines?

    decal4texture.jpg

    I'd love to hear any comments on these.

    Thanks

    Alex
  • AlexLegg
    Options
    Offline / Send Message
    AlexLegg polycounter lvl 14
    Anymore advice on my decal attemps above, please?

    I'd love to know if my approach is alomng the right lines!

    Thanks.
  • Eric Chadwick
    Options
    Offline / Send Message
    Overkill, unfortunately. There's a lot of feedback needed, so I suspect others haven't wanted to make the leap.

    Decals should be used sparingly. Graffiti, the occasional oil stain, etc.

    I think the best thing is to take a look at some of the tutorials here, http://wiki.polycount.com/CategoryEnvironmentModularity , and also take a close look at a finished level in a game editor (UDK, CryEngine, etc.).
  • AlexLegg
    Options
    Offline / Send Message
    AlexLegg polycounter lvl 14
    Thanks Eric, Yeah I guess thats a bit daunting. I just can't find any info out there on decals - seems to be a huge lack of it!

    I've been through those links many times, but it is all about modularity, nothing much on decals.

    I've had a quick poke around with UDK levels, but couldn't find any decals again. But I maybe I should have a moref thorough look.

    My example wasn't really saying I would use all those decals, just to see if those are the kind of things that are generally sued as decals, and if they are used correctly.




    And the box around the house was an attempt to blend it to the terrain as mentioned here:
    Decals might be another option for blending between ground and building or ground and rocks.

    I wasn't sure if this was what Dustin meant!

    Cheers.
  • Eric Chadwick
    Options
    Offline / Send Message
    It's hard to judge, with test assets that generally look bad.

    What I meant by the tuts, is look at all the techniques they're using, and try them out in a full scene. Don't concentrate on decals, it's such a minor trick.

    Decals for blending between terrain and objects... best to put those on the ground, under/alongside the object. On the objects themselves, better to paint the ambient occlusion / stains into the object texture, and/or use a texture blend (ala Uncharted 2), and/or vertex color.
  • leechdemon
    Options
    Offline / Send Message
    leechdemon polycounter lvl 11
    One thing you can try to do in order to fix the gradations, is if you blend through a third texture, which is one you manually blend in photoshop. Put sand over the mud cracks using fancy brushes, etc. You'll still get fading, but you'll be able to control it, and keep the transition looking less gradated.
  • AlexLegg
    Options
    Offline / Send Message
    AlexLegg polycounter lvl 14
    Thanks Guys.

    I hear ya Eric! I'm reasonably familiar with the modularity in those tuts, I just don't know much about decals. I feel like its a hole in my knowledge, and I wasn't sure what I was missing with them, what they can do and how they are used. So its not like I think they are this all amazing thing, I just want to know more about them.:)

    I think I am getting there slowly though and appreciate the help.

    Right, sorry to harp on about this...:poly122:

    So the box around the building with the ground texture is definitely not common practice then?

    And the decals you refer to for this blending, are they the kind of thing I have attempted badly? ie, cracks etc? or is there other things that are often used?
  • Eric Chadwick
    Options
    Offline / Send Message
    Definitely not common practice to put a skirt around the bottom of a mesh. It's generally expensive to use alpha blending, unless you optimize the shader like crazy (no lighting, or other shortcuts). Besides, it generally looks crappy.

    As to how often decals are used... I haven't used them much at all. So I'm kind of the wrong guy to ask. But hit marks from the player (bullet holes, blast marks, glass cracks, footprints, etc.) are very common uses for decals.
Sign In or Register to comment.