I realize it’s easy to set a background color for the canvas. However, what I’d like to do is to have some sort of gradient in the background. This could probably be achieved by using SkyBox or Dome or suchlike, but what I was wondering was whether it’s possible to do it in a cleaner manner.
Also, having static gradient fills in some objects like they do in Killer7 would be interesting. Any insight into how this could be done? I know you can get a similar effect with textures, but some of those gradients in that game retain their internal position according to the camera, not according to their model position.
thats an easy one.
if you have a Quad (it has 4 vertices) you can set a ColorBuffer. For the colors in Killer7 that colorbuffer must have a RED color for the two vertices at the top and a WHITE color for those at the bottom, or vice versa. OpenGL does the rest and this is the best performing solution for this. There you go.
EDIT: like that you can also make diagonal gradients or even gradients with four colors. merging to the center. Also dont forget to set the LightCombineMode to OFF for the wanted results
Need help to create a quad with gradient that is always in background. Could anyone provide piece of code?
Create your gradient in photoshop or gimp, then just texture your background quad. Quad could be rendered first, in ortho.