Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] - Pattern Generator

Years of Service
User Offline
Joined: 21st Aug 2009
Posted: 11th Jul 2011 19:53
Ok, so this isn't a very complicated bit of code, but it is still pretty cool. It basically loops through every pixel on your screen and sets it to a different colour based on some random maths. You can get some pretty cool effects out of it. I've added some examples at the bottom of the code, but you can change it to pretty much anything. I used to use some of these as the background on my phone :L

There is no such thing as "Too Fast!"
Neuro Fuzzy
Years of Service
User Offline
Joined: 11th Jun 2007
Posted: 12th Jul 2011 23:32 Edited at: 13th Jul 2011 00:23
Ahah, that's a great idea. I love how the sin(x) swapping negative and positive completely changes the color scheme xD

I couldn't resist writing a supersampled version to get rid of the jaggies:

change the last parameter of "calculateSuperSampled" to add more computation time, but get a nicer image. Keep in mind that this is a squared relationship. when sampling=0, the number of function calculations per pixel is 1. smapling=1, calculations=9, sampling=2, calculations=25, sampling=3, calculations=49, and in general, calculations=(sampling*2+1)^2



Why does blue text appear every time you are near?

Login to post a reply

Server time is: 2023-03-26 12:17:24
Your offset time is: 2023-03-26 12:17:24