Sign in to follow this  

psychedelic background

This topic is 4666 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

Hey all- I'm making a puzzle game and want to have some moving psychedelic backgrounds, much like winamp visualizations or something similar. I've been searching for a while for source code or tutorials but can't find anything. Does anybody have some links or tips that would help? I'm just not sure how to even start writing something like this. Thanks, sorry if this is vague. If anybody has played the indie-game Frazzled, I'd like to do something like the backgrounds in that game. Thanks, ~Mark

Share this post


Link to post
Share on other sites
I can't say I have coded anything like this, but my idea is this. Start by learning how to use Perlin noise or some other noise function like it. Then you could apply this to a texture that constantly changes according to the noise, maybe like in a circle. The other thing is that OpenGL allows you to modify the texture matrix. So you could possibly use this to your advantage here. Just a thought.

Share this post


Link to post
Share on other sites
I made a really quick program to emulate the Winamp plugin Milkdrop. (In C#/MDX, so pardon my lack of detail concerning OGL.) What I did was set everything up to render to a texture. I then drew a line list to that texture. (Note: I don't clear this texture before rendering to it.) Then I set the device up to render to a second texture. I created a simple rectangular mesh of triangles, and used that mesh to render the first texture to the second texture. (This time, I do clear the texture first.) I then rendered the second texture to the back buffer using a fullscreen quad, and displayed the back buffer. For the next frame, I swapped the role of the two textures. So the second texture that contains the scene from the previous frame then gets lines drawn on top of it, then this texture with lines on it gets rendered to what was previously the first texture. Then this originally-first texture gets rendered to the back buff.

The "psychedelic" effect comes by morphing the vertices in the mesh a little, or a lot, so that the first texture gets rendered to the second texture in a morph manner, whether it be twisting, zooming, or anything else. The more vertices in the mesh, the more precise and intricate the morphing can be. Make sure to have texture filtering turned on to bilinear in order to get the proper blur/fade effect.

Share this post


Link to post
Share on other sites

This topic is 4666 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this