Home Technical Talk

blending Tiled terrain textures., need help...

los
polycounter lvl 17
Offline / Send Message
los polycounter lvl 17
I'm trying to figure out how to blend tiled maps togther as they do in video games, using 3d max.

What techniques are used? I heard something about vertex alphas with in the tiles. I'm super lame when it comes to environments, I've been neglecting them for a while, just doing characters.
Ive been trying to find tutorials but I haven't came across any.

any help appreciated.
-los

Replies

  • FunkaDelicDass
    Options
    Offline / Send Message
    FunkaDelicDass polycounter lvl 18
    Are you talking about having a tile-able texture? In Photoshop, paint your texture, flatten it, then go to Filter-Other-Offset. If you want your texture to tile both horizontally and vertically, type in a numerical value for both the H and V boxes. The number should usually be half of what your texure size is, so if your texture is 128x128, type in 64. If the texture is only going to tile horizontally, then just type in a number for the H value and leave V at zero (and vice versa for vertical tiles). Make sure "wrap around" is checked then click ok. Your seam will be obvious, so fix that up using the clone brush or whatever. Then do the Offset again. Your texture should be back where you had it, with the edge seams fixed.

    To test your tile-ability, you can use Edit-Define Pattern to turn your texture into a Pattern, then you can open a new, larger document, and fill that document with your Pattern (Edit-Fill, choose pattern and select your pattern). If you can see obvious repeats, go back into your texture and work on eliminating those.

    Vertex alphas are usually used for "decals" - basically stuff to break up repeated textures (grafiti on walls, scorch marks, etc.). Decals and vertex alpha are also used quite frequently in outdoor environments, since it's usually more natural-looking in busy textures like grass and foliage. You can set vertex alpha in max by selecting verts, and type in an alpha percentage under veterx properties. You probably wont see it blend in the viewport, and I'm not exactly sure if you can, but if somebody knows, please post how.

    Hope that helps...
  • Eric Chadwick
  • ScoobyDoofus
    Options
    Offline / Send Message
    ScoobyDoofus polycounter lvl 19
    WHOAH! Chadwick, your my hero! Those are some awesome tools!
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    I think los is actually talking about how you could take 2 different tileable textures (like, say, grass and mud), then blend them per vertex on geometry... to make a fading boundary between grass and mud or whatever... like what happens when you do terrain editing in UnrealEd...

    I was also wondering about this too last summer, I kinda got it working in Maya, but I don't think I ever figured it out in Max. I'm pretty sure there will be a way, though, maybe by using a Mix map in your material, with a Vertex Color map in the Mixing slot? Just guessing here, though... smile.gif
  • Rick Stirling
    Options
    Offline / Send Message
    Rick Stirling polycounter lvl 18
    In some cases people duplicate the polygons at the seam. lets say texture A meets textures B with a hard edge.

    A new polygon textured with texture A is applied over texture B and then vertex alphas are used to "erase" into it. Its almost like a layer in photoshop.

    This is good because it menas you don't need to create lots of blend textures, and usinga few polygons is very cheap. The same method is used to blend walls into floors - just stopping hard edges in an outside environment.

    Mop: Mix maps also work, depending on your engine. Use the two textures inthe textures slots, and then shove an alpha mask in.
  • los
    Options
    Offline / Send Message
    los polycounter lvl 17
    thanks guys, appreciate the links Chadwick.I was thinking along the lines of what mop mentioned.

    There actually is a material that does this. Its the blend material.

    alcarus over at cgchat.com explained how to use.
    http://www.cgchat.com/forum/showthread.php?s=&threadid=22990

    I appreciate the responses guys
    -los
  • Rick Stirling
    Options
    Offline / Send Message
    Rick Stirling polycounter lvl 18
    You'll have to be careful thoguh, not all engines support that method.
  • Eric Chadwick
    Options
    Offline / Send Message
    Sounds like you're doing portfolio renders, right los? In that case, you might want to show you're familiar with vertex alpha, and also show a look consistent with the artifacts you get from vert-blending (those luverly linear gradients between verts).

    fyi, here's how RealityEngine does/did it...
    http://reality.artificialstudios.com/twiki/bin/view/Main/MixMapTutorial
    (but I bet the bitmap is converted into vertex alpha so it can run in a vertex shader)

    and how Unreal does it...
    http://udn.epicgames.com/Two/EditingTerrainLayers
    (clearly using vertex alpha)


    In Max, you can blend multiple textures together, not just two, using the Composite map type and masking with Vertex Color maps:

    Composite map
    Slot1=Mask map
    MaskMapSlot=Texture1
    MaskMaskSlot=Vertex Color map 1
    Slot2=Mask map
    MaskMapSlot=Texture2
    MaskMaskSlot=Vertex Color map 2
    etc.

    Then set each Vertex Color map to a different UV channel, and a Sub channel (R, G, or B) since you want a grayscale mask value. Each UV channel can be arranged to represent vertex color values... U 0 to 1 is Red 0 to 255, etc.

    Anyhow, some ideas to chew on.
  • los
    Options
    Offline / Send Message
    los polycounter lvl 17
    thanks Eric, I'll try this stuff out.
    -los
  • los
    Options
    Offline / Send Message
    los polycounter lvl 17
    Eric, I feel like I should send you some cash(If I had any..) or something man. This is exactly what I needed. WOW... Thanks again dude.

    It took me a few trys, more than a few actually but, You forgot to metion you need to plug in that composite map In the Diffuse channel. Other than that Just had to learn vertex painting really quick and thats all it took.

    Thanks again man.
    -los
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    If helpful replies on Polycount generated cash, Mr. Ericwick would be one of the richest men around these parts! Good stuff smile.gif
  • Eric Chadwick
    Options
    Offline / Send Message
    Cool, glad it helped you los. Biggest problem is Max doesn't like to display multiple UVs at once in the view, have to render to really see the results. But it's fun isn't it?

    Wuv u 2 Mop. poly106.gif
  • PaK
    Options
    Offline / Send Message
    PaK polycounter lvl 18
    geometry overlays with vertex alpha is the way i have done this in the past.

    so...

    you have 2 textures that don til and the meet. Straddle the seam with a group of polys. the egdges should have transparent vertex alpha values. this will blend nicely. EA LOTR's games did this everywhere.
Sign In or Register to comment.