Home Contests & Challenges Archives Game Art Workshops

Workshop #2 EQ

Alright this is probabbly all i will end up doing for this workshop, but i wanted to tackle the chain itself.

So i started off by modeling the base shape for the.... Thing the chain wraps around.

After that i extruded out to get the shape for the chain itself

Now that i had the basic chain proportions, i modeled a tiling strip of highres chain.

I then uv'ed my lowres chain section, unwrap it so it filled exactly 100% of the width, and then scaled it up so it was near uniform density as the base shape, while still being able to tile. This means i scaled it 200%, any even number would work here, 2x 3x 4x 5x etc would all ensure your tiling works correctly. 2x tiling doesnt save me a huge amount of texture space, but its essential for how i plan on animating it.

Ok, now that i have my low uved, i broke up a straight chunk of it and scaled it to be roughly the size of half the distance of the chain(so its covering the 0-1 uv space). This will be the bake mesh for the tiling texture.

Now i took my tiling section of HP chain, duplicated it enough times so that it filled the size of the "bake" section, and tweaked the bake mesh a little so that it matched up exactly at the points where i wanted it to tile(i picked 2 points of the same shape, the points of two of the "teeth" in this case, that were the closes distance to what i wanted).

After that its just a matter of baking to your bake mesh(i moved the base section in the bake/high meshes down a little so they wouldn't intersect. And did a few more things like separate the uvs where i planed to use hard edges. You could probabbly get away with less hard edges here, but because i'm making a tiling texture, i wanted as little "smoothing compensation" in the texture as possible, to get rid of any odd triangulation artifacts and such. Probabbly not a big deal tho.

chainsaw01.jpg

I threw it all in maya, baked the maps from the bake mesh and applied it to the low mesh. Its important to set the same hard edges on your bake mesh as your low so as to not have any smoothing errors.

chainsaw02.jpg
chainsaw03.jpg

Close up of chain HP

With a bit more experimentation here i think you could get better results, more "pointy" results than i have here. Focusing the sharp detail to the center of the mesh(where i have an edge loop in the low) would probably help a bit here. But i just wanted to show the basic principal, so i wont spend much time tweaking =)

chainsaw04.jpg

And a big ass gif showing the final result. Simply moving the uvs left to right gives us a nice animated chainsaw! This method also works well for tank treads.

chainsaw.gif

And a link to the high, low, bake meshes + textures

http://johnyontehspot.com/pix/chainsaw.rar

Replies

  • breakneck
    Offline / Send Message
    breakneck polycounter lvl 13
    never thought of animating the chain with scrolling texture. cool idea. tnx for the tips!
  • Joshua Stubbles
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
  • HAL
    Offline / Send Message
    HAL polycounter lvl 13
    Wow, thx I always wondered how to create tracks and chains :D

    great help
  • Thegodzero
    Offline / Send Message
    Thegodzero polycounter lvl 18
    beware playing with your tiling UVs you can loose countless hours just scrolling it back and forth... seriously.

    Its also a good idea to bake that chain as its own material set because if you make it scroll/pan the textures in game the rest of the chainsaw material would also scroll/pan... Or at least that's been my experience...
  • Joshua Stubbles
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    Depends on the engine I suppose.
    Some engines will let you animate the UV's themself, per object. Others only let you scroll the texture, which is where you'd have a problem.
  • EarthQuake
    Thegodzero wrote: »
    beware playing with your tiling UVs you can loose countless hours just scrolling it back and forth... seriously.

    Its also a good idea to bake that chain as its own material set because if you make it scroll/pan the textures in game the rest of the chainsaw material would also scroll/pan... Or at least that's been my experience...

    As long as its a different material it would be fine. You'll need some sort of custom shader/code work applied only to the chain/tracks either way you do it.

    So, 2 draw calls, 1 texture
    or 2 draw calls same textures + extra small texture = same performance hit + extra memory usage

    Tho its a small amount more memory usage, and it may make a lot more sense to use a really small texture, and free up a bit more space on the main texture(the example i did only tiles 2x, where with a smaller texture you could tile x8 or something more optimal).
  • OBlastradiusO
    Offline / Send Message
    OBlastradiusO polycounter lvl 11
  • Loren Broach
    Offline / Send Message
    Loren Broach polycounter lvl 10
    This is rad, thanks man!
  • Jesse Moody
    Offline / Send Message
    Jesse Moody polycounter lvl 17
    Vassago wrote: »
    Depends on the engine I suppose.
    Some engines will let you animate the UV's themself, per object. Others only let you scroll the texture, which is where you'd have a problem.

    In UE3 you could just set up a mask for those that would prevent the moving texture on the other parts and only move the texture along the parts you want.

    I have never done this but I have done it with emissive maps and other things so I'm sure it is possible.
  • Thegodzero
    Offline / Send Message
    Thegodzero polycounter lvl 18
    EarthQuake wrote: »
    Tho its a small amount more memory usage, and it may make a lot more sense to use a really small texture, and free up a bit more space on the main texture(the example i did only tiles 2x, where with a smaller texture you could tile x8 or something more optimal).

    ^that rite there is the biggest reason, there are a lot of workarounds to make it work too but why when its that easy to do? This also means you can use a different shader type as well. The main object might not need an alpha but this might why pay for a tiny bit of alpha on a big texture when you can have it on a small one.
  • EarthQuake
    Yeah any time you have a small section of a prop that needs alpha, split it off onto its own small texture, you will likely save memory, because 32 bit compressed is twice the size of 24 bit compressed.
  • IronHawk
    Offline / Send Message
    IronHawk polycounter lvl 10
    cool trick but that chain would have a hard time cutting a steak much less a log. Its got no bite.
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Nice example, thanks for writing all this up :)
  • EarthQuake
    IronHawk wrote: »
    cool trick but that chain would have a hard time cutting a steak much less a log. Its got no bite.

    Yeah the biggest disadvantage is obviously not having the silouhet detail, in which case doing a simple alpha strip might be better, depends on how close you're gonna get i guess, i would rather have the depth unless it was a 3rd person game where you didnt get close enough to notice.

    Really to me those are the only 2 viable options if you want it to animate. IMO atleast.

    I can't really think of anything else that would be A. terribly wasteful with polys and/or B. a major pain to rig and animate.
  • MattBush
    Cool idea,
    For use in a game engine, best way I can think of would be to paint the vertices that are to be animated (animated = white, the rest = black (at least 1.0 and 0 in one channel so you can tell the areas apart)) and store that in a color channel for each vertex.
    Then use this value to multiply the offset amount for the animation. Should use way less memory than a texture mask.

    Another thing you could do, is have 2 or 3 increasingly motion blurred versions of the chain texture directly above in the texture, so you could pass a blur amount (an integer, 0, 1, 2, 3) in to the shader and offset the uv's of the masked area upwards to match the speed of the chain.
    Or if you want to be awesome, use the world space tangent vector (or would it be binormal?) and a vp matrix to figure out the velocity of each pixel in screen space and add that to the value drawn to the velocity buffer (if you have per-pixel motion blur in your engine). (:
  • onionhead_o
    Offline / Send Message
    onionhead_o polycounter lvl 16
    hey EQ, i got a question how do u make sure the chain animation loops with this method. becuase im thinking of using this method for a belt that is suppose to be moving a spool. its actually for a mechanism that opens a gate from my silent hill inspired environment http://boards.polycount.net/showthread.php?t=63628
  • Vailias
    Offline / Send Message
    Vailias polycounter lvl 18
    The actual looping logic differs per game engine.

    If the program/engine actually supports animated UV's then you should be able to specify the animation sequence to simply loop like any other sequence.

    If you're doing it via a texture/shader method, so long as your uv layout goes all the way across you can keep it panning as long as you want with with whatever method you wind up using to create panning textures, since the texture infinitely repeats in UV space.
  • papercliphouse
Sign In or Register to comment.