Graphics related stuff,
just wondering if anyone has any idea on some tips for rendering a gradient (ex: color interpolating from yellow to orange from one side of the screen to another) when the direction of the blending isn't simply horizontal or vertical.
If it was simply horizontal, you'd only need to figure out one row and then repeat for every row.
But, in Photoshop for example, the interface has you drag your mouse to create a direction vector that decides at which angle the gradient goes.
When it's angled, drawing oblique lines could possibly miss some pixels. So how would this be prevented efficiently? Not looking for a complete solution just something to help me get started.
Edit:
It would still be nice to know how to do this with my own-made solution, but would this be a valid solution?
First make a texture as if the gradient was horizontal...
Then, given direction vector, find the angle, and then find the 4 uv points of the corners of the XY box? This would require using textures/GPU though, but I guess I don't have a problem with that.
Like
http://i.cubeupload.com/E0qddD.png (colored box is actual screen/pixels, outside box is texture)?