PDA

View Full Version : Morph map to vector displacement map ?


lorex
09-28-2010, 03:33 AM
Hey,
since a morph map is basically a vector displacement map in object space, how hard would it be to convert it from object to tangent space ad bake it to uvs, using the awesome DPKit for example. I will do some tests today but I was just wondering what method would you use to perform the conversion.
thanks.

dpont
09-28-2010, 04:52 AM
Speaking of DPKit,
I think that using the Vector Cast node to bake
3D displacements as an image, is the appropriate way
it has also a "Tangent Space" option,
the Vector Map node can then be used
for mapping the resulted Color image.
It is also a bit more complicated to setup
than a classic point cache format.

Denis.

dpont
09-28-2010, 05:10 AM
If you are going to experiment direct baking
from a Morph Map node, you could try to use
the Normal Cast node but I never tested
it in this situation,
shortly,
normalized Morph output in Normal input of Normal Cast
plugged in diffuse color,
then I don't know if you could map correctly
the result with the LW Normal Map node
in the Displacement node editor.

Denis.

lorex
09-28-2010, 05:38 AM
Hi denis,
I understand the vector cast node would be an easy way to do it but I think it's a shame not being able to use the vector info coming directly from the morph map.
But I also understand the math would be pretty complicated converting the vectors to tangent space and having a way for Lightwave to read it correctly.
I will try your suggestion of using normal cast / normal map and will keep you posted, although reading normal information as vector information coud be tricky for LW.
what if I try to output a normalized vector map directly from the morph map and use your object tangent node to convert it to tangent space and then plug that map into a vector map node ?

by the way, thank your for your efforts on the DPKit, very useful.

evenflcw
09-28-2010, 05:51 AM
You dont mention what you want to achieve in the end but maybe this helps? All thanks to Denis! Thanks!

http://www.newtek.com/forums/showthread.php?t=103733&highlight=vector+displacement
(post 7 in particular)

lorex
09-28-2010, 06:16 AM
Hi evenflcw,
What I'm trying to do is this: I've got a model with a mdd file coming from another application ( I can't modify those ). I need to add a corrective morph to this model. I obviously can't just add the morph and expect it to work so I'm trying to convert the morph info into displacement map info.

I could probably just compare the 2 models and extract a good old normal displacement map but I was looking at the DPKit and was wondering if the vector information from the morph map could be directly converted into a vector displace map. If that could work, It would obviously yield the best results.

Thank you for the link, I will look into that, it looks very promising.

dpont
09-28-2010, 11:48 AM
...I could probably just compare the 2 models and extract a good old normal displacement map but I was looking at the DPKit and was wondering if the vector information from the morph map could be directly converted into a vector displace map...

A normal displacement map has only one value
to scale the normal of the point, usually coded
as a grey image, a morph map has 3 values so you need
a color image to store a 3D vector,
You spoke about "Tangent" space, may be useless
here, it could have disadvantages also with atlas
UV Map, "World" space could work with a simple
setup to bake:
Morph Map node plugged in Diffuse Color,
rendered with the Surface Baking Camera.
but save in 32bit TIF or EXR, because you
need to store un-normalized vector with
negative and positives values.
In Displacement NE, you just need the
LW Image node, load your baked image
with UV Map projection.

Denis.

lorex
09-28-2010, 12:57 PM
Morph Map node plugged in Diffuse Color,
rendered with the Surface Baking Camera.
but save in 32bit TIF or EXR, because you
need to store un-normalized vector with
negative and positives values.
In Displacement NE, you just need the
LW Image node, load your baked image
with UV Map projection.

Denis.

Yes that's basically what I did, but since I'm not interested in a "world" space map, I was hoping that plugging my morph map " image" into your object tangent node I could convert it into a "tangent" map for your vector map node but it didn't quite work.
thanks for your help anyway :thumbsup:

dpont
10-03-2010, 12:32 PM
I added a Vector input in Vector Cast node,
so it is possible to bake a morph map in tangent space.

Available in the win32 DPKit version yet.

Denis.

lorex
10-04-2010, 08:40 AM
Hi Denis,
thank you very much for your work. :thumbsup:
The node works very well on simple objects but on more complex objects like characters , not so well. After some testing, it seems the problem has more to do with the surface baking camera then the vector cast node itself.
I will do some more testing and keep you posted.