PDA

View Full Version : LW10.0 - Mud dynamics



Celshader
04-30-2011, 08:56 PM
This is a dynamics/displacement demonstration I created for the April meeting for the Los Angeles LightWave User's Group. LightWave 10.0 content attached to this post.

Video: http://www.youtube.com/watch?v=eAd2NdSYI-8

http://celshader.com/images/bboards/LW/Mud2.jpg

geo_n
05-01-2011, 03:21 AM
Nice mud trail. I got mdd error loading PlaybackScene.lws.
Is that not in dpkit?

Cageman
05-01-2011, 04:59 AM
Nice!

Cool technique... thanks for sharing!!!! :)

wrench
05-01-2011, 08:30 AM
Excellent Jen! Thanks for sharing.

B

Celshader
05-01-2011, 10:29 AM
Glad you like it! :)


Nice mud trail. I got mdd error loading PlaybackScene.lws.
Is that not in dpkit?

For this LightWave 10.0 content, I am using the native MDD Displacement node, which ships with LW10.0.

If you are using LW9.6, you may use the DP Kit's MDD_Pointer_Node to play back the MDD file in the Node Editor instead of the MDD Displacement node.

For those still using LW9.x, I have a LW9.x DP Kit example (with content) of this subdivision ordering technique at the bottom of this page:
http://celshader.com/gallery/md/

stevecullum
05-01-2011, 10:33 AM
Thats really neat - nice effect!

Would look cool with particles flying mud chunks off the wheels. :)

stevecullum
05-01-2011, 10:55 AM
Are you able to explain the maths a little, feeding onto the gradient and the gradient itself? Why such low values, purpose of subtraction etc...

Celshader
05-01-2011, 12:24 PM
Are you able to explain the maths a little, feeding onto the gradient and the gradient itself? Why such low values, purpose of subtraction etc...

Sure. I wanted the Bump Displacement to appear *only* where the ClothFX displacement appears. I was not sure how to do this based on the MDD data itself. However, because this is a flat plane, I decided to create an alpha based on the world-coordinate Y-value of the points. If the points remain at their original Y-positions, they will exist in a thin layer of black sandwiched between two infinite zones of white. This sandwich is defined by the Gradient. As long as these points sit in the black layer, they are immune to the Crumple texture. However, whenever the points get pushed into the "white" zone, the Crumple texture will appear.

For the Gradient, a Y-value of "0" is "off" (black) and points that hover slightly above and below 0 (the low values) is "on" (white).

However, the original ClothFX calculation took place with the plane raised 100mm above the Y-axis. You can see this non-zero Y-value if you select the plane in the calculation scene, and this value was baked into the ClothFX calculation. Even though the playback scene has the plane's Y-value zeroed out, the undisturbed points still have a World Coordinate Y-value of 100mm.

I could have skipped the Subtract node and corrected this Y-offset in the Gradient. If I set the middle key at 0.1 (100mm) and the fringe keys at 0.11 and 0.09, I would get the same effect without the use of a Subtract node.

However, I was in a hurry when I set this up and thought I should correct the Y-offset before I plugged the results into the Gradient node. That way the middle key would always be 0, and the fringe keys would be mirror opposites of each other (positive and negative).

By subtracting the original 100mm ("0.1") Y-value from all World Coordinate Y values, I tell the Node Editor to treat all points that exist at 100mm as though they had a World Coordinate value of 0 (because 100mm - 100mm = 0mm). All points above or below 100mm will then fall into the non-zero "white" zones of the gradient.

For example, if a spot on the plane gets pushed to 0mm in World Coordinate space, the Subtract node will convert that value into -100mm. When fed into the Gradient, the value of -100mm means that spot will have a Color value of RGB 255 255 255. If a spot remains in its "rest" position at 100mm, the Subtract node converts that value to 0mm and the Gradient assigns a value of black to that spot.

This black-and-white alpha then drives the Crumple texture's Opacity, erasing all evidence of Crumple from the spots in their "rest" positions in the black layer.

My texture setup could be overkill, though. When I did this presentation at the User's Group meeting last week, Dave Jerrard pointed out that I may not have needed anything other than the Crumple node. He suggested using the Crumple node's built-in Position and Falloff values instead of the elaborate Spot->VectorScalar->Subtract->Gradient setup I'd wired up. Oops.

:D

bazsa73
05-01-2011, 01:19 PM
looks pretty good!

abdelkarim
05-01-2011, 01:23 PM
nice . :D thnx

lkyjp24
05-13-2011, 10:36 PM
great work, this is good Simpsons ;)

Svenart
05-14-2011, 04:34 AM
very interesting technic, thanks for posting this.

Netvudu
05-19-2011, 05:23 AM
Itīs a shame this very nice technique (thanks Jen) only works with the world Y. This limits it to flat planes or terrains created with a displacement (which we could add through the nodes after this trick, I suppose).
We should come with an alternative way because more often than not,terrains are not going to be flat :p

I do remember some other way involving a camera pointed down and saving a particle trail as a mask, but we should strive to make this version useable for other non-flat cases, because this one looks a winner for its simplicity and how quick it is to implement.

Larry_g1s
05-19-2011, 12:12 PM
Very interesting Jennifer. Thanks for sharing.