Hello guys. I’m working on a real-time animation that requires a lot of gradient compositing. Just to give you a rough idea:
http://www.redpicture.com/pics/gradient.jpg
The image above is a prototype and shows various overlapping triangles that are filled with color gradients in Adobe Illustrator. Illustrator allows the user to define an arbitrary start point, and end point to a gradient. This generates a fill pattern, and is masked off by the Path of the graphic object getting the fill. In this case, it’s a triangle.
http://www.redpicture.com/pics/gradient-2.jpg
In order for my project to deal with rapid changes from the client, I have figured out how to extract relevant data from a PDF file. I can pull out the geometry, the colors in the gradient, the gradient start, end, and rotation.
The basic way ( the only way I know, lol ), is to read the data, generate pixel data, generate triangle vertices, bind pixel data as texture, and achieve the rotation by transforming the texture in the model’s ( triangle ) space. I think I can achieve this. However, before I do all this, it occured to me that I might also approach this problem with a GLSL shader instead.
-
Which approach would you go for?
-
If I want to animate, or update the gradients on the fly, does that preclude the use of the GLSL approach.
-
Is the basic way I describe above flawed, or are there some gotchas to consider here.
Thanks for any help in advance oh gurus.