Jump to content
  • Advertisement
Sign in to follow this  
nint22

Per-pixel gradient image

This topic is 3882 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've posted a few questions here before and the community has been amazing with some great responses! Thank you all very much! Here is another simple question you all might be able to help me with. :) I'm working on a simple 3D puzzle game. So far, it is going great, but my background is too boring. I'd like to create a gradient background (That changes colors with time) instead of the classic gray that I clear the buffer with. I can think of two approaches: 1) Create a black and white gradient image in photoshop and simply have it render in the background on each scene with a specific color... But I am afraid it will pixelate on high-end screens due to resizing. 2) Write, per-pixel, onto a texture and blit it to the background, but again my issue here is I don't know any gradient algorithm and am afraid it will be too slow. Any suggestions? As usual, any help is always greatly appreciated.

Share this post


Link to post
Share on other sites
Advertisement
I don't know what sort of gradient effect you're looking for, but you can always draw a fullscreen quad in the background, enable Gouraud shading, and then change the vertex colors. The colors will be smoothly interpolated across the face of the quad.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!