0
$\begingroup$

I need help. I need the bracket (shown by the yellow grid on the floor and ceiling) along Y of this material to have a gradient, that meaning, to have the always "1" return from the Compare math node get converted to a gradient of values from 0 to 1 before connecting to the Factor on the Mix shader.

The nodes in place

To achieve this, you need something that alters that value specifically along Y with its maximum and minimum values on the exact limits of that bracket which is animated to move along Y (but not scale, scale stays the same).

I believe the answer is not that obvious as slapping a ColorRamp or a Gradient Texture somewhere in the middle of that, unfortunately... I have tried that and much more with no success.

Any ideas?

EDIT: For clarification, the desired effect looks like this:

enter image description here

Just... Animated correctly to move at the same pace as the bracket, as this is a shoddy workaround I just figured out.

EDIT2: This solution has this result where there's a black gradient right across the middle of the yellow section and it shows differently positioned on the rest of the scene elements that do also share this exact same material (car and columns).

Solution 1

EDIT3: I had my nodes in the mix shader inverted, sorry for that oversight. This solution does work, although I will have to tweak it for the gradient to extend over a larger area (I mean, make the edges darker and have the gradient extend further thowards the center).

enter image description here

EDIT4: I believe this has given me the desired effect.

enter image description here

I will now try to replicate a similar effect but one sided for the black area.

$\endgroup$
  • $\begingroup$ Not sure I fully understand what you are trying to achieve, could you illustrate the desired effect? Have a look at the Modulo operation $\endgroup$ – Duarte Farrajota Ramos Jun 26 at 0:22
  • $\begingroup$ Updated the post. $\endgroup$ – Sebastião Silva Jun 26 at 0:40
0
$\begingroup$

re: I need a gradient to go across this very long tunnel. What actually moves is the tunnel and the car is in place, but the material has to move independently of the tunnel position, as if its UV was a projection from the Z axis from a stationary camera, for example.

enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ Yep, that's exactly the adaptation I did on mind. Updated the post. Thank you. It has strange results that I am not actually sure what are caused by, I need to make some experiments. $\endgroup$ – Sebastião Silva Jun 26 at 16:40
0
$\begingroup$

enter image description hereSo you need a gradient to follow the car?

| improve this answer | |
$\endgroup$
  • $\begingroup$ I need a gradient to go across this very long tunnel. What actually moves is the tunnel and the car is in place, but the material has to move independently of the tunnel position, as if its UV was a projection from the Z axis from a stationary camera, for example. (This solution does not work as intended in my file and gives out strange results.) $\endgroup$ – Sebastião Silva Jun 26 at 16:30
  • $\begingroup$ I see, I had my mix shader inverted. Sorry for that! Updated OP. $\endgroup$ – Sebastião Silva Jun 26 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.