PDA

View Full Version : Displacement: + and - both// Normal displacement?



jeric_synergy
06-28-2015, 07:47 PM
I'd like to have an object (a tube) displaced both PLUS Y and MINUS Y, so as to form a nice 'sine'-ish wave, BUT I'd like to have the displacement occur in a "World-Coordinates" fashion.

I guess I could do it with a regular displacement map and just have varying degrees of displacement, but I want to know if such a thing is possible-- certainly my extremely limited understanding of Normal Maps suggest it might be.

How would one construct such a normal map?

Tnx.

jeric_synergy
06-28-2015, 10:18 PM
OK, working on this.... attached see the layer editor I'm using to create this displacement. (PShopped to view both layers at once.) Using a gradient, I'v mapped it so that 1 (pure white) displaces vertices -1 meters, while 0 (black) moves them +1 meters on the Y axis. (Yeahhh, it's kinda backwards.)
128753

But I hoped that since the INPUT is PREVIOUS LAYER, that adjusting that layer would allow me to easily adjust the amount of displacement. I kinda assumed that TEXTURE AMPLITUDE would be the relevant knob. However, adjusting that had no effect. Neither did adjusting LAYER OPACITY for the Image Layer.

So, that sucks. Shouldn't one of those work???

lertola2
06-28-2015, 10:40 PM
OK, working on this.... attached see the layer editor I'm using to create this displacement. (PShopped to view both layers at once.) Using a gradient, I'v mapped it so that 1 (pure white) displaces vertices -1 meters, while 0 (black) moves them +1 meters on the Y axis. (Yeahhh, it's kinda backwards.)
128753

But I hoped that since the INPUT is PREVIOUS LAYER, that adjusting that layer would allow me to easily adjust the amount of displacement. I kinda assumed that TEXTURE AMPLITUDE would be the relevant knob. However, adjusting that had no effect. Neither did adjusting LAYER OPACITY for the Image Layer.

So, that sucks. Shouldn't one of those work???

I believe that in your example you will have to adjust the values in your gradient layer as that is the top layer. Your reasoning is logical but unfortunately that is not how it works.

You could use the sin node in the surface node editor. You can adjust how much displacement is applied by adjusting the Enable Bump Distance on the objects properties panel. If you want the displacement to be in world coordinates use the world spot as the input. But for the displacement to be in world coordinators you need to set the Bump Displacement Order to Before World Displacement.

http://forums.newtek.com/attachment.php?attachmentid=128754&d=1435551683


128754
128755

JoePoe
06-29-2015, 09:19 AM
edit: basically just said what Joe said.... (on very little sleep :sleeping:)

The only thing I would add regarding your example is to set the Image Map layer opacity to something really small (.0001%) so its essentially flat to start. Then the displacement will be equal in the neg and pos directions.

jeric_synergy
06-29-2015, 09:48 AM
Thanks fellas: it's not just me, right?: that evaluation seems wonky.

Ah well, I should be nodin' it up anyway.

BTW, the idea here is to create a woven patch, maybe 10x10, by sliding the mesh into place, without any collisions.

jeric_synergy
06-29-2015, 01:29 PM
Lertola, thanks for your answer. I wonder if you could clarify some things for me?:

You could use the sin node in the surface node editor. You can adjust how much displacement is applied by adjusting the Enable Bump Distance on the objects properties panel. If you want the displacement to be in world coordinates use the world spot as the input. But for the displacement to be in world coordinators you need to set the Bump Displacement Order to Before World Displacement.
I attach a pic of my rearranged version of your solution. Here's a thing that confuses me, and as usual it has to do with order of evaluation in the Node Editor (I often feel that it is more easily understood 'backwards', but I'm assured this is not the case....):
128762
Now, please correct how I conceptualize this flow, since I am obviously thinking about it in an incorrect fashion:

This flow appears to me to get a SPOT,
separate out the Y channel,
multiply it by a user-controlled scaling factor
apply a SIN function to that spot
and use the resulting value to displace the [apparent/rendered spot/vertex?]

So, one thing that confuses [me/this liberal arts major] is: {SCREECHING HALT SOUND EFFECT}

Dang, as I started examining what confused me about this, I realized there were MANY things that I wasn't picking up on, so please bear with me:

1) Since I was thinking "Displacement", I wasn't thinking "Bump"-- so I guess this is displaced only along the normals, right??
2) At first I was 'thinking' (for want of a better word, d'oh) the SCALE CONTROL was doing one thing (which it isn't) but it seems to affect the frequency of the evaluation-- why is that??

Thanks very much for your efforts here.

jeric_synergy
06-29-2015, 02:41 PM
OK, working off Lertola's idea, I cobbled this up, but it ONLY displaces (at all, not in any useful manner) along the X axis.

128764

How can this be? The MAKE VECTOR node is set to 0/{input}/0, so why is there any X displacement??

jeric_synergy
06-29-2015, 05:43 PM
OK, the answer to the previous puzzle was "Rotation ,World Coordinates, evaluation order".

So, getting close: see pix: how can I get the CLAMP action to be 'softer', rather than abruptly binary?
128765

jeric_synergy
06-29-2015, 09:45 PM
Soft clamp achieved: use a CURVE node. Not very intuitive, seems to be juuusssstttt different enough from the GE to throw me off. I wasn't able at ALL , for example, to PASTE a copy of a curve from the Blue channel to the Alpha channel when I realized that would be clearer. So, that was puzzling. Lack of RMB support disappointing also.

Adjusting the curve of the alpha channel in the Curve node controls the onset and modulation of the clamping action.

Attached is a copy of the scene as it stands. Beginners may find it interesting - veterans, laughable.

Thanks to Lertola for supplying the important bits!

128766

lertola2
06-30-2015, 06:23 AM
I wish I had time to look at your file today as these are the kinds of problems that I find very interesting. I have I took a quick look at using a gradient instead of the clamp node last night but I failed to get that to work. You might have to set up a bit of logic with a more complex node setup that essentially says if x is less than 1 then displacement is zero. If x is grater than 2 then displacement is sin wave. In between 1 and 2 then blend the two states. This is doable but it will take more than one node I think.

JoePoe
06-30-2015, 09:59 AM
Is it just my imagination or do displacements work quite a bit differently in the two environments (Object properties displace nodes vs surface editor nodes displacement > enable bump)???

Anyway, ...... I used a gradient to ease into the weave motion (in ob props. The same setup in surf editor does not work.).

128768

edit: the tube starts to get a bit lumpy (or maybe it's the middle sections getting stretched out) the bigger the amp. Not sure how to fix that.
Apart from a mental exercise, maybe this is something for spline control instead?? 8~

edit 2: yeah the middles are stretching. Peaks and valleys seem okay.
128769

jeric_synergy
06-30-2015, 10:32 AM
Lertola, I decided just to try CURVE(+MULT) because I wanted some exposure to that node. (Meh.) Add in a MULT as a filter and wallagh.

JoePoe, your ramp is much smoother than mine (attached above), so I guess maybe Gradients still have a bit of mileage left in them.

Thanks fellas! My next challenge might be to make it tangent to the "path", to avoid the shearing effect of simple straight Displacement. Down the road, this has to be repeated like twenty times, so workflow and ease of revision (EOR) is a consideration also.