what is the best way to create a gradient for a 2D polygon in OpenGL, (Linear, and Radial)?
Thanks
How can you generate textures for radial gradients on the fly?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Linear is very easy – you just set different colors to different points like
for radial texture might be better option
to generate it on fly create empty texture then fill it with function sqrt((MAXX – x)^2 + (MAXY – y)^2), then add color to it.