00:00
00:00
B1KMusic
Hi. I make games and software. I'm not on NG much, but feel free to peruse my youtube and gitlab for interesting stuff.

Braden @B1KMusic

Age 29, Male

Programmer/Musician/

fish

Earth, Milky Way

Joined on 6/19/11

Level:
10
Exp Points:
948 / 1,110
Exp Rank:
69,209
Vote Power:
5.20 votes
Rank:
Police Sergeant
Global Rank:
8,618
Blams:
42
Saves:
1,040
B/P Bonus:
12%
Whistle:
Normal
Medals:
799

Check out this...thing I made

Posted by B1KMusic - March 9th, 2013


http://jsfiddle.net/B1KMusic/xf7De/

It generates a map of random colors up to 10 000 x 10 000 pixels without making the browser lag.

I spent extra time making the settings easy to understand.

You can mess around with the settings, change the size of the image, change the pixel size, and the color channel ratios, and the picture renders before your eyes, and if you like it, you can click it and save it. It can crash trying to save huge pictures, though.

Tip: In firefox, set the image size to your screen resolution, pixel size to 1, and the color channels to:

R: 0x00
G: 0x77
B: 0x00

Instant grass!

For more realistic grass, some blue should be included:

R: 0x00
G: 0x77
B: 0x33 <-- Since dark blue is kinda the color of grass shadow, this actually makes it a little more realistic

Chrome renders fast
Firefox can save massive pictures that would kill the page on chrome
IE9 works
Safari works about the same as chrome
Haven't tested Opera

Picture below is a 1280x800 "grass" picture I rendered in firefox.

Technical details:

The way it progressively renders is through the use of setTimeout and anonymous functions.

((function renderY(i){
__if(i < H){
____((function renderX(j){
______if(j < W){
________for(var k = 0; k < 100; k ++){
__________context.fillStyle = randomColor();
__________context.fillRect(j,i,1,1);
__________j++;
________}
________setTimeout(function(){renderX(j)},0)
______}
____})(j));
____i++;
____setTimeout(function(){renderY(i)},0);
__}
})(-1));

Check out this...thing I made


Comments

I always wanted Instant grass! but seriously this is acc quite cool!

Thanks :D

Very cool -B