2
$\begingroup$

I'm wanting to apply a gradient texture to an object that is using the wave modifier, in a way that only the wave crests, or a z-range, get a color ramp band. It doesn't work with the wave modifier active, but it does work with the modifier applied, so the texture coordinates seem to apply only to the original (non-modifier-ed) mesh, which probably makes perfect sense. Unfortunately, the mesh is then static. The intent is to have a dynamic python-generated driver initiate the 'ripple' via midi input, so static or pre-rendered isn't in the cards.

I've added an image of the very simple node network and one of how I'd like the effect to look, but the image is of the mesh with the modifier applied, not active.

Is there a way to get a texture to do this while the modifier is active? I've seen a way to do something similar posted here using material displacement, but the wave modifier has some nice controls, so I'm just wondering if there's a way to do it with the wave modifier, or is that just too lazy. Thanks for taking a look.

enter image description here intended result

$\endgroup$
2
  • 1
    $\begingroup$ please try the same setup without applied modifier and use uv or object coordinates. That should work. If not, pls provide blend file. thx. $\endgroup$
    – Chris
    Jan 14 at 9:19
  • 1
    $\begingroup$ Just to document your guess and Chris comment: from the Texture Coordinate Node documentation, "Generated" coordinates are based on "the mesh without deformation". $\endgroup$ Jan 14 at 9:30

1 Answer 1

2
$\begingroup$

As Chris suggested, just switching the texture output node from 'generated' to 'object' did the trick. Perfect! Thanks so much. Also, thanks to StefLAncien for the reminder to rtfm along with the specific pointer. TIL. Here's a still from a dynamic animated wave-ripple with modifier active, not applied.

ripples in time

Blend file here:

P.S. - @RobinBetts 's comment suggesting how to highlight only the wave crests and not the ground plane sent me off on a learning experience, which resulted in a working version of this, doing what I set out for it to do in the first place. It's an extension of my original question, so if adding this to the original post is out of bounds, please let me know. Just thought it might be useful for anyone in the future trying the same thing. Thanks for the suggestions, they were all helpful!

node tree enter image description here Final blend file:

$\endgroup$
6
  • 1
    $\begingroup$ You might also want to explore using (Normal Z component) to catch the peaks of the waves, irrespective of their height. Then your ripples could decay with distance, if you wanted, without losing the shading. $\endgroup$
    – Robin Betts
    Jan 14 at 10:57
  • 1
    $\begingroup$ You read my mind - that's exactly my end goal, but was very glad to at least find out this direction wasn't a dead-end. I supposed some masking (or map range?) will be needed, since the outer edge of the falloff would also be undesirably included in the normal z component, but I think I can manage that. $\endgroup$
    – Sam Mitee
    Jan 14 at 11:20
  • 1
    $\begingroup$ you could AND (multiply) the Normal Z with (Generated Z Greater Than tiny) to mask out zero-height water. Negative heights would just be some offset, depending on what space you're using. Personally. I think I would use Object Space, to keep 0 at flat-height. $\endgroup$
    – Robin Betts
    Jan 14 at 11:26
  • $\begingroup$ Your suggestion makes perfect sense, in that I get how multiplying works like an AND with the ground plane, but I have some experimenting/reading to do here to figure out how to actually implement that in nodes. You've set me on the right path - thanks Robin. $\endgroup$
    – Sam Mitee
    Jan 14 at 13:18
  • 1
    $\begingroup$ Very nice! More sophisticated than my little mini-trial before passing comment :) Shame I can't upvote twice. $\endgroup$
    – Robin Betts
    Jan 16 at 7:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .