chart/ function/ algorithm for projecting color codes

Interesting mapping tools and mapping help.

Moderator: Morax

chart/ function/ algorithm for projecting color codes

Postby Lionhardt » 28 Aug 2013, 19:14

Hey,
so when exporting a heightmap you can choose which height value black and white correspond to. So I wondered if there was a tool that maps numbers to color codes on the basis of some linear projection from number x = #000000 and number y = #FFFFFF.

Or, if there is no such tool, does anybody have an idea, how you could build your own projection, so that after every nth pixel on a horizontal color transition, there comes a new color that corresponds to the [Sum_of(n/number of pixels per color strip)+1]th height level in increments of 1 height unit per step and n0 = black?

Or maybe there is even a simple chart that has colors ordered in a linear succession of brightness (we only need grey values after all...) and then you could find out what the interval is by importing that thing in the editor and measuring the height levels of two successive color samples... that in the editor of course would correspond to two adjacent bumps/cavities.


Having any of those tools would make editing heightmaps with image editing software so much more precise!



EDIT:

So... in a very inefficient manner I created a chart on my own. The color value increments correspond to height value increments of 1 with white = 128 height units in the editor. See the attachment.

The way you would use this is the following:

You set your heightmap settings so, that they correspond to the settings shown in the chart. With the color picker you choose the colors corresponding to the heightlevel you want to paint onto your heightmap from the chart. So if you want to paint a plateau of height H you search the number H in the chart and pick the color below it.



EDIT 2:

I just realized that this cannot work... at least not precisely. I guses you need to set white to 256 if you want one field to correspond to ine height unit increment. I will fix this later today. As it is now, you got 2 fields correspodning to one height level incremement... but only on average, so this shit isn't even linear -.-
Attachments
Gradient_0_128.png
Gradient_0_128.png (14.26 KiB) Viewed 1048 times
Last edited by Lionhardt on 29 Aug 2013, 18:54, edited 1 time in total.
Help me make better maps for all of us, visit my Mapping Thread.

Maps needing gameplay feedback:
Spoiler: show
[list updated last: 31.1.2018]

(maps available in the vault)

- Hexagonian Drylands
- Fervent Soil and Torrid Suns

YouTube Channel
User avatar
Lionhardt
Contributor
 
Posts: 1070
Joined: 29 Jan 2013, 23:44
Has liked: 188 times
Been liked: 144 times
FAF User Name: Lionhardt

Re: chart/ function/ algorithm for projecting color codes

Postby Lionhardt » 29 Aug 2013, 18:54

So, I have thought a little about the problem. Could it be that the problem is this:


The number of different shades of grey be K.
When you draw the gradient over a number of pixels N with K/N = some irrational number your gradient won't be perfectly linear. Could that be the case? If so, you would need to know the maximum number of different shades of grey that can be made in 16bit and choose some N so that K/N = some rational number or even better an integer... Does that make any sense?
Help me make better maps for all of us, visit my Mapping Thread.

Maps needing gameplay feedback:
Spoiler: show
[list updated last: 31.1.2018]

(maps available in the vault)

- Hexagonian Drylands
- Fervent Soil and Torrid Suns

YouTube Channel
User avatar
Lionhardt
Contributor
 
Posts: 1070
Joined: 29 Jan 2013, 23:44
Has liked: 188 times
Been liked: 144 times
FAF User Name: Lionhardt


Return to Mapping

Who is online

Users browsing this forum: No registered users and 1 guest