Skip navigation
Currently Being Moderated

4 point linear gradient

Sep 14, 2011 6:12 PM

Hi all, this forum has been a huge help to me in creating pb plugins so first of all thanks for the help so far.
But I have come to a point where I may now have to ask some specific questions.

 

I'm trying to create a 4 point linear gradient as opposed to a radial effect such as the built in 4 point.

I've tried a couple methods but no luck:

1. Took the four colors of the corners and averaged them based on weighted distance from the sample coordinate to each corner. It didn't quite give the right effect.

2. Next I tried a kind of crack head approach that calculated gradients from each of the top verts to each bottom one. (4 gradients) I then weighted mixed them based on the distance from the sample point to the closest part of each gradient line.

3. Various other methods and variations of 1 and 2.

 

Also, something I want to avoid: When I tried corner pinning a ramp brainstorming the look of the effect, values pinched where the points got closer together. I'm afraid this might still happen even if I find the optimum solution, honestly I don't know what to expect. I'm told what I'm trying to replicate is like shake's 4 point node if that helps but I do not know from experience.

Also, I do not need to deal with color. If someone does have an explanation and it would be easier to explain without talking about mixing colors, that will be fine.

 

Thanks for any help with this!

 

[edit] Dang. Didn't mean to post in the 3d section. This might not be the right place. Would a moderator be able to move this if it's wrong?

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points