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$
2
  • $\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$ Commented Jun 26, 2020 at 0:22
  • $\begingroup$ Updated the post. $\endgroup$ Commented Jun 26, 2020 at 0:40

2 Answers 2

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

$\endgroup$
1
  • $\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$ Commented Jun 26, 2020 at 16:40
0
$\begingroup$

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

$\endgroup$
2
  • $\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$ Commented Jun 26, 2020 at 16:30
  • $\begingroup$ I see, I had my mix shader inverted. Sorry for that! Updated OP. $\endgroup$ Commented Jun 26, 2020 at 16:46

You must log in to answer this question.

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