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] Automatic heightmap coloring

Author
Message
MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 6th Sep 2007 05:38 Edited at: 6th Sep 2007 05:39
This is more for RiiDii, but anyone is welcome to use it as well. RiiDii has contributed to the opensource mmorpg project greatly. His recent thread here. inspired me to make an automatic fractal like terrain color application thing. It's not the most eficient tool yet, but with some work I think it could be added to anyones toolset.

Here's the full source.



It's a little buggy, in that you still might get white patches. Here's how it works.

The function will get the color attributes of each pixel and than plot a different pixel if it is within that color range.

For example, w1 and w2 represent the blue(water) ranges. So if we specify 20-90, any rgb color between rgb(20,20,20) and rgb(90,90,90) will be colored a random value of blue. This random value gives a nice sort of grainy look to the landscape.

This random value is controlled by the 'wamp' variable, meaning Water Amplitude.

To make things short and sweet, here's an image of some automatically colored terrains.



Hope this inspires others to create a better version, or even myself to finish it off later. It just wasn't doing any good sitting around, so I've released it here once and for all.



A book? I hate book. Book is stupid.
(Formerly Yellow)

Attachments

Login to view attachments
Pyramid Games Ltd
17
Years of Service
User Offline
Joined: 23rd Aug 2007
Location: Line 21, DBP
Posted: 6th Sep 2007 14:32
Awesome!

Login to post a reply

Server time is: 2024-11-22 18:44:06
Your offset time is: 2024-11-22 18:44:06