PDA

View Full Version : Anybody think of a way to turn MDD into a displacement map



m.d.
01-05-2014, 12:52 PM
Did a long realwave sim which has some chatter /high speed flutter where the boat interacts....

A resim with enough sub steps is about a 40 hour ordeal....and the displacement maps from realwave are corrupted(vertical lines running through)

I would like to generate a RGB displacement map so I can fix the issue using fusion....I am sure there is a way to map each vertex to a pixel and write the XYZ values to RGB....but not quite sure how to go about doing that.....and how to get the map out of LW....maybe map the colours to another high Rez plane....and render it with an orthographic camera...

Any ideas would be appreciated...

BTW....this would be a perfect option for something like chronosculpt....but it the error is moving and would require smoothing it out 600 frames individually and by hand

ernpchan
01-05-2014, 01:36 PM
You could use a gradient to determine the colors based on height.

jeric_synergy
01-05-2014, 02:03 PM
Sounds like a NORMAL MAP to me.

m.d.
01-05-2014, 02:06 PM
You could use a gradient to determine the colors based on height.

That would give me a height map(which may be enough) but I am looking for a full 3d displacement vectors, as there is a bit of lateral displacement with the wave motion
The height map may work in a pinch though....

m.d.
01-05-2014, 02:09 PM
Sounds like a NORMAL MAP to me.

Not sure the technichnical difference between the 2....but I think a normal is just a direction where a displacement is a vector with an intensity....

jeric_synergy
01-05-2014, 02:14 PM
A normal map contains, IIRC, 3D displacement information, while a displacement map, IIRC, is always along the vertex's normal. Different applications may use slightly different terminology.

I'm no normal map guru (now, THERE'S an understatement) but I think a normal map contains actual 3d information, so you could have involute surfaces after displacement, unlike a (literal) displacement map.

m.d.
01-05-2014, 02:30 PM
Well this is for a flat plane....
A normal map is usually to add detail to an already approximate or low poly shape...and just shows the direction of the normal
Afaik

A displacement along a vertex normals would only require grayscale....where you see the displacement input in lightwave is a vector input....but zbrush only uses grayscale displacement....so I can see the confusion....
It's mostly terminology as you suggested....

m.d.
01-05-2014, 02:41 PM
http://docs.pixologic.com/user-guide/3d-modeling/exporting-your-model/vector-displacement-maps/

That explains it pretty well

jeric_synergy
01-05-2014, 02:41 PM
Well, you specified 3d displacement, so it seems to me that a normal map is what you're going to need. And a flat plane is just a subset of all possible shapes, so even though a normal map can do a lot more than just a displacement map, it seems to fit your requirements.

IOW, it's the minimum required overkill in this case. ;)

(crossposted so I haven't had time to read your link above.)

m.d.
01-05-2014, 02:50 PM
A normal map does not do 3d displacement....

m.d.
01-06-2014, 01:29 PM
back to the topic at hand....

Still at a loss how to do this.....
what I need is a nodal network to compare 2 items with identical point networks (one object driven by MDD...and one static)
the resulting color information should be the difference in 3d position between the 2 points of the same index.

RebelHill
01-07-2014, 05:12 AM
Well, you pretty much answered your own question in your last post there...

What you want is to be able to get the spot info for 2 versions of your mesh, the base, undeformed state, and the deformed state at each frame, use vector subtract to subtract the first val from the second at each spot, split the vector to XYZ components and feed each channel to a colour channel, or through a gradient to a colour channel. The first important thing is that you'd need to work out the max displacement that any one vertex underwent, so that you could set a "reference bar", and furthermore, output the images to a floating point format to be able to properly capture the "value details". Then essentially, the opposite network to apply that image back as a displacement.

The only real hurdle is getting both mesh states.

You cant, in the node window of one object, get a spot info for a different scene object, neither can you get a spot info for a single object at different times, or in different deform states... Maybe you could use the MDD nodes/files directly and compare their outputs, using a second MDD which you save out without deformation... not sure how well that'd work though.

erikals
01-07-2014, 06:05 AM
like this... ?


http://youtu.be/4BT2o84Dvjo

m.d.
01-07-2014, 11:21 AM
Well, you pretty much answered your own question in your last post there...

What you want is to be able to get the spot info for 2 versions of your mesh, the base, undeformed state, and the deformed state at each frame, use vector subtract to subtract the first val from the second at each spot, split the vector to XYZ components and feed each channel to a colour channel, or through a gradient to a colour channel. The first important thing is that you'd need to work out the max displacement that any one vertex underwent, so that you could set a "reference bar", and furthermore, output the images to a floating point format to be able to properly capture the "value details". Then essentially, the opposite network to apply that image back as a displacement.

The only real hurdle is getting both mesh states.

You cant, in the node window of one object, get a spot info for a different scene object, neither can you get a spot info for a single object at different times, or in different deform states... Maybe you could use the MDD nodes/files directly and compare their outputs, using a second MDD which you save out without deformation... not sure how well that'd work though.


I did actually think of the spot info....and to my surprise you cant use it for a different object...but you did just give me an idea..

Perhaps I can write out spot info into RGB on the mesh....and bring it back in via an image sequence and compare that to the spot info of the deformed mesh....2 step solution but it may work

I tried translating MDD directly into color to compare them...and it does generate some color....but there is a lot of extra bits in there
it seems MDD is only mathematically relational to other MDD through the math nodes and then readable by the deform input....it does not directly translate into proper color values (at least with my limited knowledge it doesn't)

I think the deform input is treating the MDD data differently then a color input....I am guessing MDD stores the change in the world/object space of a given vertex rather then is current WS/OS position kind of like video intra frame compression just stores the actual image on I frames and just stores the change in position on P and B frames (actually stores the difference from motion estimation and real recorded value....but you get the idea)
either that or there is some extra data inbetween xyz pixel values that lead to the RGB mess it creates

either way I think the deform input is parsing MDD data in some way

m.d.
01-07-2014, 11:28 AM
like this... ?


http://youtu.be/4BT2o84Dvjo

the height map is totally doable...i am looking for an actual vector displacement map (more of a mental exercise then a necessity)

in your tutorial there couldn't you just use a gradient in the Y channel instead of an image of a gradient? Using a 16 bit image is probably ok....but going to an 8 bit would only translate into 256 height values

erikals
01-07-2014, 12:31 PM
yes, you can use a gradient as well,

no don't think LightWave can create Vector Displacement.
it can render it, but not create it...

dpont
01-07-2014, 01:23 PM
You may try the Vector Cast node,
same principle than Normal Cast but for Vector Map,
including Tangent space and compatible with Vector Map.

Denis.

m.d.
01-07-2014, 04:34 PM
I did try that denis, I did a pile of test's last night bringing in zbrush vector displacements
http://forums.newtek.com/showthread.php?132447-Tangent-vector-displacement-maps&p=1361574&viewfull=1#post1361574

i think i am trying reverse that process...by comparing 2 meshes to create a vector displacement...
i tried working your node in...but it seems to be only designed to read and cast the vectors...unless I am misunderstanding something

my nodal logic isn't the best

erikals
01-07-2014, 04:52 PM
you tried this...? but with Vector Cast instead? >

http://www.youtube.com/watch?v=O7fINI4DpeI

it's be awesome if it worked...

erikals
01-07-2014, 05:27 PM
i tried something similar to the youtube video above, but couldn't make it work.

(i'm super-bad at node setups though...)

seems to stop at 11%, could be my mistake, not quite sure...

m.d.
01-07-2014, 09:36 PM
tried your scene...and made my own..different objects
crashes LW as soon as VPR or f9

dpont
01-07-2014, 11:56 PM
About Vector cast node,
it calculates vectors from point to point,
so the sclupted object should not have extra geometry.


Denis.

erikals
01-08-2014, 06:19 AM
ah... http://erikalstad.com/backup/misc.php_files/smile.gif ok, getting closer... http://erikalstad.com/backup/misc.php_files/047.gif

erikals
01-08-2014, 07:01 AM
a bug maybe?

looks like reloading DPKit is needed...


http://youtu.be/VzwGFHnvz9g