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
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.
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.
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.
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?
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.
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.
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?
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?
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...
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.
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.
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.
Always nice to improve efficiency. I'll give it a try.