Home Technical Talk

Wrinkle/tension Maps inside Maya

Kyle_butler
polycounter lvl 11
Offline / Send Message
Kyle_butler polycounter lvl 11
Hi, guys! I know it has been discussed before, and even though I didn't want to create another thread about it, I hit a dead end.

For those who have been following/ helping me, my project will be an animation inside Maya. I'm currently working on the blendshapes.
Unfortunately, I can't understand how to set up the blendshapes to create wrinkle maps... I've read the "Stop staring" section about it, but to be quite honest, I couldn't understand what he was doing... I don't want to just mimic it. I've tried peter shipkov's soup plug-ing, but still couldn't make it work.

Perhaps, Mark Dygert suggestion from the thread "Wrinklemaps in 3D Studio Max" is the best way to go. But I need a little bit more details on how to actually accomplish it. I'm using sss fast skin shader.
How can I set up multiple normal maps to be activated with the blendshapes? A driven key between this shader's maps opacity and blendshapes is possible?

Replies

  • ghib
    Options
    Offline / Send Message
    I'd be really interested to learn how to do this also.
    The version of Stop Staring that I have only has a way to layer up bump maps but no normal maps. I tried various other ways to layer it up but in the end I just ended up doing this stuff in Unreal.
    Also the maya viewport was so horrendously slow in refreshing the normal map that even if I did get it working it would be unusable for me.

    I know this doesn't help you but just thought I'd share my pain.

    I actually find setting this kind of stuff up in the Node Editor a bit easier than using Set Driven Key which isn't quite as visual.
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    Isn't this a matter of blending extra texture data based on driven keys? I tried doing it just this way as a test. Basically blending a wrinkle-normal-map based on a blendshape value by using driven keys.
  • FAT_CAP
    Options
    Offline / Send Message
    FAT_CAP polycounter lvl 18
    kodde wrote: »
    Isn't this a matter of blending extra texture data based on driven keys? I tried doing it just this way as a test. Basically blending a wrinkle-normal-map based on a blendshape value by using driven keys.

    That looks great Kodde :)

    Can you go into a bit of detail about how you set that up? I'm looking into exactly the same thing at the moment but, being a Maya noob I'm struggling a bit and, as far as I'm aware, tehre is no ability to blend/ animated materials in realtime/ the viewport in Max where I'm much more comfortable.
  • ghib
    Options
    Offline / Send Message
    kodde wrote: »
    Isn't this a matter of blending extra texture data based on driven keys? I tried doing it just this way as a test. Basically blending a wrinkle-normal-map based on a blendshape value by using driven keys.

    I had a look at that vid when I was looking into previewing animating normal maps in Maya. I was wondering how you actually layered the normal map over the top. Was it a simple Lerp or were you overlaying the normal maps, and how would you approach layering multiple maps?

    The solution I arrived at was to have a base NM in relaxed state and a second NM with sculpted wrinkles baked together with the base sculpt. Blended in using many smaller mask textures which are added together. It's the strength of the mask textures I hooked up to the blendshapes/bone rotations. I have no idea if this is the best way of doing it but my reasoning was that you'd end up with a smaller texture overhead.
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    Thanks FAT_CAP.

    I can hardly remember how I blended. I don't have the shader in front of me. I think I just converted the normal texture data from 0 - 1 range to -1 - 1 range. Then add them together and go back to 0-1 range. This won't handle all cases, but worked for my test for that case. You could potentially hit the cap if several normal maps just keep adding together and pushing an angle too far. This wasn't the case for me as I had a fairly flat surface and just added wrinkles to that.

    For the wrinkle normal map I just did a dirty method of baking the wrinkled version to the lowpoly and masking out that area. I'd not advice to do that as it would catch other non wrinkle state details in this map as well and thereby giving you these details twice.

    I think I'd approach this similar to what you suggested ghib, at least when it comes to comparing the Wrinkle HP mesh to the Base HP mesh. But then again, to what UV-map would you save this data? Ideally you'd want the difference between Wrinkle HP <-> Base HP and bake it to the lowpoly's UVs. Not sure if that is possible. If not you might be able to save this to the vertex colors on the Base HP, and then transfer the vertex colors to the lowpoly's UVs? You would need quite high polygon density though.

    I can probably dig up the maya .cgfx I used if you want. But it's far from a complete shader, it's pretty much for testing this type of feature.

    EDIT:
    ghib> I like your idea of using masks, sounds efficient. Did you try this out?
  • Kyle_butler
    Options
    Offline / Send Message
    Kyle_butler polycounter lvl 11
    Thanks for the contribution, guys.
    By reading your comments, this is not as trivial as I thought it was.
    kodde, could you please look it up and tell us how you'd accomplished that? Because it is exactly what I'm trying to do.
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    Kyle> To begin with I did this with my own custom authored .cgfx shader.

    Your two options I see if you want to reproduce this in Maya.
    1) Use a custom real-time shader(CGFX/HLSL) with this feature.
    2) Try doing this with Maya's native shaders. Although I'm sceptical about blending normal maps and having them displaying properly in the viewport. But I haven't tried it personally.
  • Kyle_butler
    Options
    Offline / Send Message
    Kyle_butler polycounter lvl 11
    Yeah, before you answered me I was looking your website and your KoddeShader v2.0 looks great.
    I don't know if adding this information is relevant, but in my current project the real-time viewport display isn't a major concern (I'll render passes and composite them in some other software anyway).
    Blending maps without worring about them being automaticaly displayed in the viewport is somehow easier?
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    Kyle_butler> Well at least you're not limited to the viewport capabilities. This often gets in the way of my creative shader ideas using Maya native shaders.

    If I was you I'd go with ghib's suggested method. To me this method sounds manageable and you won't have to hassle with all too many normal maps. Instead you have to solve the blending of masks which should be a bit easier than blending several normal maps. To me this sounds possible with Maya native shaders for offline rendering.

    EDIT: By the way, if you're doing this for offline rendering, do you really need wrinkle maps to solve your task? Can't this be achieved with blend shapes already? Maybe even multiple blend shade nodes? Or are you using a game model with limited polygon resolution?
  • Kyle_butler
    Options
    Offline / Send Message
    Kyle_butler polycounter lvl 11
    kodde, that is precisely the problem: I'm working on a low poly mesh.
    I can't really grasp ghib's method. I can follow the idea, but I can't put it into practise.
    Right now, I'm trying to break down the method to the easiest form.
    For instance, I have two objects. The red sphere is the base shape and the blue sphere (without the top portion) is the target.

    What I'm trying to accomplish in this example is: I want the base shape to inherit both the shape and the material of the target shape. Is this possible? The shape, obviously, but the material... that is the tricky part.

    I've tried to connect the blendshaps's weeight to the material color RGB in the Connection editor with no success...
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    To inherit the entire material or just the color? Color I assume.

    Yeah it should be quite simple. You could do it fully node based, or node-based + simple expressions. You probably won't need any other fancy shader nodes other than blendColors. You might need to create a dummy object with custom attributes to hold values which will be fed to different nodes depending on which method you choose to go for.
  • Kyle_butler
    Options
    Offline / Send Message
    Kyle_butler polycounter lvl 11
    kodde, I've finally managed to blend the normal maps using the mental ray materials by using JS MultiLayers. I've created a relationship between the blendshapes and the layers' activation.
    To avoid both maps being active at the same time, I've added a Reverse node.
    I'll try to post a video on youtube and link it here to keep as reference for the community.
    Thank you all for the help and suggestions.

    NodesBlendNormalMaps.jpg
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    Hey good job!
    Seems a bit excessive to just lerp blend between two normal maps. But if it works and your happy with it :)

    The two misss... materials you have, are they identical except for the normal map? If so, you could just blend between the normal maps to the left of 1 material instead, and input the blended result in the normal map slot if you get what I mean. This would need less nodes and if you ever wanted to update the material on other parameters you won't have to maintain two "identical" materials.
  • Kyle_butler
    Options
    Offline / Send Message
    Kyle_butler polycounter lvl 11
    Great suggestion! they are indeed the same, except for the normals.
    Always nice to improve efficiency. I'll give it a try.
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    try using the blendColors node to do the blending of normal textures, should work fine.
Sign In or Register to comment.