We are about to switch to a new forum software. Until then we have removed the registration on this forum.
In P2D if you write a code like this
beginShape();
fill(255, 0, 0);
vertex(x1, y1);
fill(0, 255, 0);
vertex(x2, y2);
fill(0, 0, 255);
vertex(x3, y3);
endShape();
the output is a triangle which is filled with color that varies across its surface, interpolating between R/G/B linearly.
Is there a simple way to write a shader that would interpolate the three colors differently? If yes, can you please guide me how to do that?
Would this be a vertex or a fragment shader?
Answers
If you really need a shader I can help you with the blend the different colours part though. Btw might not need a shader, have you tried different blendmodes if they make a difference? I did not even know you could colour each vertex in a shape.
Sorry for my previous post, I think it's not what you wan't.
What you want is the regular linear blendmode, but along an S curve rather than a line right?
In other words change the ratios of color blended rather than how they're blended.