Forged Alliance Forever Forged Alliance Forever Forums 2013-08-29T18:54:28+02:00 /feed.php?f=53&t=4931 2013-08-29T18:54:05+02:00 2013-08-29T18:54:05+02:00 /viewtopic.php?t=4931&p=52173#p52173 <![CDATA[Re: chart/ function/ algorithm for projecting color codes]]>

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?

Statistics: Posted by Lionhardt — 29 Aug 2013, 18:54


]]>
2013-08-29T18:54:28+02:00 2013-08-28T19:14:13+02:00 /viewtopic.php?t=4931&p=51979#p51979 <![CDATA[chart/ function/ algorithm for projecting color codes]]> 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 -.-

Statistics: Posted by Lionhardt — 28 Aug 2013, 19:14


]]>