PDA

View Full Version : Partial morphs based on incidence angle??



Revanto
07-27-2014, 07:12 PM
I was wondering if it was possible to have vertices of an object morph based on the incidence angle of a light or the camera.

Just to make this clear, the light or camera will not trigger a whole object morph but a morph of the individual vertices based on the incidence angle to said light or camera.

Cheers,
Revanto :p

ernpchan
07-27-2014, 10:00 PM
Should be possible. You'd have to do it through nodes.

Dodgy
07-27-2014, 10:02 PM
Take the Forward direction of the light/camera and dot that with the normal of the object, then scale that using a Scalar multiply node and feed it into a morph node which is plugged into the displacement input.

Revanto
07-28-2014, 08:54 PM
Sorry, could you show me a snapshot of the node setup?
I still use LW9.6. Would this be a problem?

Rev.

jeric_synergy
07-28-2014, 09:33 PM
Would that be a PointInfo or a SpotInfo kinda deal?

Dodgy
08-08-2014, 02:27 AM
Heya,

This is the node setup. Because you want the inflation to occur at the out edge, you need to find the arccos of the result of the dot (the dot function returns the cosine of the angle between the two vectors, in this case the forward vector and the normal of the surface) and then sine that (as sine goes from 0 to 1 instead of 1 to 0 which is what cosine does). The multiply scales the displacement strength. The normal give the displacement direction so feeding that into the displacement makes a surface bulge outwards.

Alternatively use a gradient to control how much it flares out. The gradient will need to go from -1 (the reverse of the forward direction) to 0 (the sideways direction) to 1 (the forward direction). I use the Alpha since that's a percentage and easy to use. Connect the Alpha output to the Vector Scale scalar input.

Revanto
08-08-2014, 02:53 AM
Thanks, I'll give that a try. The reason I wanted to see if this worked is to possibly come up with a way of having variable line widths to create more ink like edges for toon renders. This would work in conjunction with creating a copy of the mesh, flipping the normals and setting this copy to 100% black luminosity 0% diffuse.

If it does work like I imagine then it might open up interesting options with the technique.

Appreciative of your help.

Cheers,
Revanto :p

Dodgy
08-08-2014, 06:55 AM
Ah, you know you can taper the render edges in a node editor now right? You can even do this same trick in there, so rotating the light affects the width of edges.

sudac20
08-08-2014, 11:01 AM
Any luck?

Revanto
08-08-2014, 11:08 PM
Ah, you know you can taper the render edges in a node editor now right? You can even do this same trick in there, so rotating the light affects the width of edges.

Ah, I did not know that. Anyway, I tried the node setup and it didn't work. I don't know why it didn't work but I don't understand the actual setup itself so anything could have been the issue.

As for variable width edges, I'll give that a try. If it work then my whole technique is moot. Or if the actual result is unsatisfactory then maybe my way would have greater value?.... maybe...

Anyway, no big deal. I just thought of the technique when I was half asleep one day.

Cheers and thanks for your help,
Revanto :p

jeric_synergy
08-09-2014, 01:23 AM
FWIW, IIRC Jen Hachigian (Celshader) did the article/tutorial on using nodes to adjust edge widths. No idea where it might be, but she does a lot of presentations on the LALWUG channel on YouTube.

Also, I believe Proton's article on achieving Dr. Suess style edge weighting and cross hatching addresses this concept. Again, good luck finding it-- should be doable.