PDA

View Full Version : Can an enclosed 3D volume - e.g. a sphere - be used as a procedural shader/mask?



Gungho3D
02-18-2018, 09:58 PM
So I'm wanting to use one enclosed 3D object - in my case a boat hull - to act just like a procedural shader in giving me a very specific volume of shading ...

I want to use it as a means of masking a displaced, water surface object, so that no matter how the water surface is displaced (waves), the shaded/masked area always shows where the hull would be correctly intersecting the water.

Yep, I could do it via generating a series of images and pulling them in after the fact, ... just trying to avoid that

So in summary: one fully enclosed geometric volume used on another surface exactly like a procedural mask - is there a plugin / way of achieving this?

Cheers & thanks in advance :-)

Gungho3D
02-19-2018, 04:27 AM
BUMP: anyone?

Ztreem
02-19-2018, 06:09 AM
Do you mean something like this?

140186
140187

Gungho3D
02-19-2018, 06:27 AM
Do you mean something like this?

140186
140187

Dude - where you learn magic trick like this-sa one? Either that, or the force is indeed strong with you ... :bowdown:

Thanks ZT, exactly what I was looking for!

Never ceases to amaze me, the sheer smarts a whole bunch of people have on this forum!

lertola2
02-19-2018, 07:10 AM
Do you mean something like this?

140186
140187

Wow. Very cool. Is there a way to set this up on two intersecting objects in such a way as to produce an animatable boolean effect?

Ztreem
02-19-2018, 07:48 AM
Wow. Very cool. Is there a way to set this up on two intersecting objects in such a way as to produce an animatable boolean effect?

Yes, of course.
140188
140189

Ztreem
02-19-2018, 07:51 AM
Dude - where you learn magic trick like this-sa one? Either that, or the force is indeed strong with you ... :bowdown:

Thanks ZT, exactly what I was looking for!

Never ceases to amaze me, the sheer smarts a whole bunch of people have on this forum!

Glad I could help. This is only one of many things you learn on the journey, I guess... :)

UnCommonGrafx
02-19-2018, 08:02 AM
Very nice examples and demo scenes.
And what a journey.

kyuzo
02-19-2018, 08:07 AM
Yes, of course.
140188
140189

Wow. Now you're just showing off..
:D
Awesome stuff.

I was looking for as technique like your first one to do animated facial features, like say on a lego figure. I don't suppose there's anyway to overlay TWO intersecting objects, to get two different colours? For instance, a round black eye, with a white dot for a highlight?

raymondtrace
02-19-2018, 08:54 AM
There is a "mushroom" demo scene at the bottom of this docs page:
https://docs.lightwave3d.com/display/LW2018/Mesh+-+Edges

This technique might apply to animated facial features, like on a lego figure.

kyuzo
02-19-2018, 09:01 AM
Never mind... I managed to figure it out...

Cool.

140190

kyuzo
02-19-2018, 09:06 AM
There is a "mushroom" demo scene at the bottom of this docs page:
https://docs.lightwave3d.com/display/LW2018/Mesh+-+Edges

This technique might apply to animated facial features, like on a lego figure.

Yeah, I'd seen that, and it looked promising, but it seemed to only shade the actual edge intersections, rather than 'fill in' the shape. Unless I'm missing something. Which is always a possibility...

Ztreem
02-19-2018, 09:40 AM
Never mind... I managed to figure it out...

Cool.

140190

Great!
The raycast/ raytrace nodes are very useful. It can be used for many different things.

prometheus
02-19-2018, 10:19 AM
Great!
The raycast/ raytrace nodes are very useful. It can be used for many different things.

Just curious, do you know if you can do the same with nodes in blender, or some other method better suited for blender?

Ztreem
02-19-2018, 11:58 AM
Just curious, do you know if you can do the same with nodes in blender, or some other method better suited for blender?

Good question. I havnít tested yet but you have real animated booleans in blender and I know there is a raycast node with animation nodes addon. So much things to test, so little time...

Ztreem
02-19-2018, 04:14 PM
Good question. I havnít tested yet but you have real animated booleans in blender and I know there is a raycast node with animation nodes addon. So much things to test, so little time...

If I would need to do it today in Blender I would just do a dublicate of the object and use the boolean modifier. Works quite good and also works in opengl view. This kind of operation I think is easier to do in LW but it can also be of my long use of LW and very short usage of Blender. :)

140195

Gungho3D
02-19-2018, 05:47 PM
Glad I could help. This is only one of many things you learn on the journey, I guess... :)

Houston ... "the journey" has for the moment exposed that I am on LW 11.63, whereas the examples from your good self leverage the LW 2015.3 implementation of that node specifically: I don't have an "inside" output attached to the 11.63 raycast node ...

Not to worry.

We do have LW 2015.3, but for reliability/dependability's sake, it has not been (and will not be) included in the pipeline for getting stuff done - been there, done that, never again (much as I like some of its features).

We plan to run with LW 2018 eventually, but there is no pressing urgency in the here and now. Again, heaps of features I like, and, by the look and feel of the demo, seems rock solid. All in good time ...

Thanks for your help anyway, greatly appreciated!

Ztreem
02-20-2018, 12:00 AM
Houston ... "the journey" has for the moment exposed that I am on LW 11.63, whereas the examples from your good self leverage the LW 2015.3 implementation of that node specifically: I don't have an "inside" output attached to the 11.63 raycast node ...

Not to worry.

We do have LW 2015.3, but for reliability/dependability's sake, it has not been (and will not be) included in the pipeline for getting stuff done - been there, done that, never again (much as I like some of its features).

We plan to run with LW 2018 eventually, but there is no pressing urgency in the here and now. Again, heaps of features I like, and, by the look and feel of the demo, seems rock solid. All in good time ...

Thanks for your help anyway, greatly appreciated!

You can get almost identical result by raycast straight up from the surface, I belive. Depends of how your final scene looks.

Ztreem
02-20-2018, 01:18 AM
Here is a raycast straight down from the surface, so when the cubes goes through and under the surface it gets white but if its above then nothing.

140201

Gungho3D
02-20-2018, 09:22 PM
Thanks ZT, super busy right now, but will get back to this ...

Gungho3D
02-21-2018, 04:29 AM
Hey ZT ...

I use nodes regularly, but "Raycast Geometry" is like speaking Greek - beyond me.

I had a go at following your example above, but not enough of the node parameters and which surface settings to apply them to were visible, so ... :-( ... no success.

I have attached a small, ridiculous-but-representative scene with object if you would like to have a play with it and see if it can be made to work.

If you have the time/inclination, then thank you so much. If not, no probs :)

140219
140220

MonroePoteet
02-21-2018, 07:41 AM
To match ZTreem's original setup, on your node network for the Water surface you need to use the "Inside" output of the RayCast Geometry object rather than "Distance", and your Gradient needs to have some other value at 1.0 besides black to feed the Luminosity channel:

140222

BTW, if your actual goal is to create a foam area around the boat, this isn't going to work, since all the geometry detected "Inside" the Boat will be um, inside the boat. You may need to create a slightly larger boat, parent it to the actual boat, make it Unseen by Camera and turn off all its shadowing and use the bigger boat for the RayCast Geometry target.

Nice technique, ZTreem!

mTp

OFF
02-21-2018, 09:23 AM
Thanks for cool tricks Ztreem!

Gungho3D
02-21-2018, 04:25 PM
To match ZTreem's original setup, on your node network for the Water surface you need to use the "Inside" output of the RayCast Geometry object rather than "Distance", and your Gradient needs to have some other value at 1.0 besides black to feed the Luminosity channel:

140222

BTW, if your actual goal is to create a foam area around the boat, this isn't going to work, since all the geometry detected "Inside" the Boat will be um, inside the boat. You may need to create a slightly larger boat, parent it to the actual boat, make it Unseen by Camera and turn off all its shadowing and use the bigger boat for the RayCast Geometry target.

Nice technique, ZTreem!

mTp
Hey MP, thanks for taking the time.

The purpose of the exercise is to establish a hull/waterline "boundary". As you point out, one of the outcomes can then be to move on to "what comes next" - e.g. foam. Or better wake control. I have achieved both previously, just wanting to see how much can be automated.

Yes, I was aware of the shading outcome being on "the inside" :)

Also, you have opened the scene in LW 2015 ... as per discussion above with ZT (and example from him) my poor hack was an attempt to implement his suggestion inside of LW 11.63, which doesn't have "inside" :-(

However Dude I am very grateful for you taking the time, much appreciated!

Gungho3D
02-22-2018, 05:58 AM
Ok, so for LW 11.6.3 this works. Many thanks to ZT & MP for their patience and expertise ...

140241