POV-Ray : Newsgroups : povray.general : color_maps : back to basics Server Time: 19 May 2019 10:21:36 GMT
  color_maps : back to basics (Message 1 to 10 of 10)  
From: Leroy
Subject: color_maps : back to basics
Date: 12 Apr 2019 22:25:01
Message: <web.5cb1102255c0ed3f98ce07b10@news.povray.org>
I was going through my old color maps that where made with my old map Maker
program. It was tedious loading each into the Maker just to view them. So.. I
wrote another program to View all the maps in a whole directory. After debugging
the View program with the help of Maker. I decide I would take all of the color
maps that comes in POV's standard include files and organize them and save 'em.
 More than half way through this task of finding and organizing the color maps,
I realized that I was lazy in writing the Maker program. First I did have paste
in the program but no key shortcut. That was no problem to fix, 10 minutes and
it was done. The next thing is a little more complicated.
 When I set up the Maker program I built is from the display toward the code.
That is there is a 255 limit to the number of elements in a color map. So the
display shows 255 colors. Each element has a placement value of a multiple of
1/254 (.003937007874). I had decide to only print out 6 digits of these numbers.
But that not really important there has to be a limit somewhere. What is
important is that some simple numbers are left out of this arrangement. Like
0.1,0.25,.3 and so on. Most if not all of POV's included color maps uses these
numbers.

 So before I rewrite Maker I'd like some input as to how to go about it.

Color map Maker is at http://leroyw.byethost15.com/SubPages/Win_Programs.html

I really need to KISS(keep it simple stupid).

Thanks for any input!


Post a reply to this message

From: Bald Eagle
Subject: Re: color_maps : back to basics
Date: 13 Apr 2019 03:25:00
Message: <web.5cb1561fe0a4d32d4eec112d0@news.povray.org>
"Leroy" <whe### [at] gmailcom> wrote:

>  So before I rewrite Maker I'd like some input as to how to go about it.
>
> Color map Maker is at http://leroyw.byethost15.com/SubPages/Win_Programs.html
>
> I really need to KISS(keep it simple stupid).
>
> Thanks for any input!

Hi Leroy - good to see you've still got some time and motivation to revisit old
projects and get back into them with new inspiration!  :)

I haven't had a chance to play with the program(s), but I'm assuming that you
use sliders, etc to create a color_map to paste into a POV scene file.

That's great, but usually those color_maps are used in a pattern, and that's
what's always been less than intuitive and hard to visualize (for me).
I'm not sure the regions of certain patterns are always represented evenly /
equally / linearly  --- so maybe the values near 0 and 1 dominate the pattern,
or the value near 0.5 does.

I think in addition to solely the color_map, a pattern visualizer would be
useful so that you could apply the color_map to a pattern and adjust it with
feedback in real time.   That would be a HUGE step forward in developing
textures.

It's where I was aiming at with this little project:

http://news.povray.org/povray.binaries.images/thread/%3C5acf08bc%241%40news.povray.org%3E/


Post a reply to this message

From: Alain
Subject: Re: color_maps : back to basics
Date: 13 Apr 2019 18:15:02
Message: <5cb22726$1@news.povray.org>
Le 19-04-12 à 23:23, Bald Eagle a écrit :
> "Leroy" <whe### [at] gmailcom> wrote:
> 
>>   So before I rewrite Maker I'd like some input as to how to go about it.
>>
>> Color map Maker is at http://leroyw.byethost15.com/SubPages/Win_Programs.html
>>
>> I really need to KISS(keep it simple stupid).
>>
>> Thanks for any input!
> 
> Hi Leroy - good to see you've still got some time and motivation to revisit old
> projects and get back into them with new inspiration!  :)
> 
> I haven't had a chance to play with the program(s), but I'm assuming that you
> use sliders, etc to create a color_map to paste into a POV scene file.
> 
> That's great, but usually those color_maps are used in a pattern, and that's
> what's always been less than intuitive and hard to visualize (for me).
> I'm not sure the regions of certain patterns are always represented evenly /
> equally / linearly  --- so maybe the values near 0 and 1 dominate the pattern,
> or the value near 0.5 does.
> 
> I think in addition to solely the color_map, a pattern visualizer would be
> useful so that you could apply the color_map to a pattern and adjust it with
> feedback in real time.   That would be a HUGE step forward in developing
> textures.
> 
> It's where I was aiming at with this little project:
> 
>
http://news.povray.org/povray.binaries.images/thread/%3C5acf08bc%241%40news.povray.org%3E/
> 
> 

Patterns like bumps/bozo/spotted, leopar, granite, wave/ripples and 
agate seems to use a sin like distribution.

Patterns like gradient, onion, radial, boxed, spherical, planar, 
cylindrical and spherical use a ramp, or linear, distribution.

wood use a triangular distribution.

You can always use a different wave type if you want.

When you just want to view some colour_map, it's bettrer to stick to the 
linear ones.


Post a reply to this message

From: Leroy
Subject: Re: color_maps : back to basics
Date: 15 Apr 2019 20:40:01
Message: <web.5cb4eb34e0a4d32d4517dadb0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
>
> I think in addition to solely the color_map, a pattern visualizer would be
> useful so that you could apply the color_map to a pattern and adjust it with
> feedback in real time.   That would be a HUGE step forward in developing
> textures.
>

Color Mapper comes with 5 test patterns gradient x & y, spherical, boxed, and a
pseudo-random pattern that I added for fun. One of the 5 is displayed and
changes each time you change the map. I thought about adding more. But at the
time I didn't know as much as I do now and I had other projects to do.
 Oh your right about the slider bars:) They let you choose a color. Then you can
put that color any where on the map.

> It's where I was aiming at with this little project:
>
>
http://news.povray.org/povray.binaries.images/thread/%3C5acf08bc%241%40news.povray.org%3E/

I'd like to see your code. If I was going to use it to test a color map I'd put
it on a plane. Then while testing I could move the pattern around.


Post a reply to this message

From: Leroy
Subject: Re: color_maps : back to basics
Date: 15 Apr 2019 21:10:01
Message: <web.5cb4f29de0a4d32d4517dadb0@news.povray.org>
Alain <kua### [at] videotronca> wrote:
>
> Patterns like bumps/bozo/spotted, leopar, granite, wave/ripples and
> agate seems to use a sin like distribution.
>
> Patterns like gradient, onion, radial, boxed, spherical, planar,
> cylindrical and spherical use a ramp, or linear, distribution.
>
> wood use a triangular distribution.
>
> You can always use a different wave type if you want.
>
> When you just want to view some colour_map, it's bettrer to stick to the
> linear ones.

I agree with you on that. It is better to view color map in their linear form.
And Color Mapper does this as so does the Map Veiwer. What I like to know is...
would the slight difference in placement values have a big difference when
rendering.
 What lead me back to the color map was playing with all the patterns that come
with POV and a few hand made pattern functions. I was thinking of making a
windows program that would let you choose a pattern and let you set all the
things that modifies the pattern. There are a LOT of things that can modify a
pattern:) And at the base is the color map.
 Forgive me if I ramble a bit. I think of the color map more of a placement map.
That is pigment_map, texture_map, normal_map all can have the same placement
values with different things at 'em. So if you make a color_map you can
visualize any of the other maps.


Post a reply to this message

From: Bald Eagle
Subject: Re: color_maps : back to basics
Date: 17 Apr 2019 00:10:01
Message: <web.5cb66e98e0a4d32d4eec112d0@news.povray.org>
"Leroy" <whe### [at] gmailcom> wrote:

> I'd like to see your code. If I was going to use it to test a color map I'd put
> it on a plane. Then while testing I could move the pattern around.

Sure thing.
Luckily it was a short file and I can just paste it here.

With regard to viewing the color map with a "linear pattern" - the problem I
always had/have with adjusting some of the patterns is that I want to adjust a
certain _part_ of it, and I don't know which part I'm trying to adjust.  With
wood, for instance, if I want MORE of a certain tone, do I put that in the
center of the color map, or the "ends" at 0 or 1?  Because some of these
patterns don't get distributed proportionally.
So that's why I wanted to plot the numerical values to _see_ what the
distribution was in the pattern itself, not the color map that then gets
re-distributed from the native "linear" definition.



#version 3.7;

/*
 Value mapping of pigment patterns to show map values in 0.1 increments
 Bill Walker "Bald Eagle" April 2018
*/

global_settings {
 assumed_gamma 1.0
}
#include "colors.inc"

sky_sphere {pigment {rgb <1, 1, 1>*0.2}}

camera {
   location <0, 0, -100>    // position & direction of view
  look_at  <0, 0, 0>
  right x*image_width/image_height           // horizontal size of view
  up y // vertical size of view
 }

light_source {<10, 80, 25> color White}

// define textures with numbers from 1 - 10, and use these numbers as textures
in pigment map for wood

#declare Num = array [10];
#for (N, 0, 9)
 #declare Num[N] = text {ttf "arialbd.ttf" chr(48+N) 100, 0 translate <0, 0,
-50>}
#end


#declare T = array [10];
#for (N, 0, 9)
 #declare Current = CHSV2RGB(<N*36, 1, 1>);
 #declare T[N] =
  pigment {
   pigment_pattern {
    object {Num[N]} // 1, 0}
    warp {repeat x}
    warp {repeat y}
   }
   pigment_map {
    [0.0 rgbft Current]
    //[0.9 rgbft Current]
    [1.0 rgb 0]
   }
  scale 0.025
  }

#end

/*
#for (N, 0, 9)
 box {<0.1, 5*N, 0>, <50, 5*(N+1), 0.2>
  texture {T[N]}
 }
#end
*/

#declare NR_wood_grain =
pigment {
  wood
  warp {cylindrical orientation y dist_exp 1}
  warp {turbulence 1.25}
  scale <0.5, 30, 1>
  warp {turbulence 0.25}
  scale <1, 10, 1>
  warp {
   black_hole <0, 0.5, 0>, 1
       falloff 2
       strength 1.5
       repeat 7
       turbulence 2
       inverse
  }
  pigment_map {[0 rgb 0] [1 rgb 1]}
}


#declare NR_Wood =
texture {
  pigment_pattern {NR_wood_grain}
  texture_map {
    #for (N, 0, 0.9, 0.1)
     [N     T[N*10] ]
     [N+0.1 T[N*10] ]
     //#debug concat ( " N = ", str (N, 3, 1),  " N+0.1 = ", str (N+0.1, 3, 1),
" N*10 = ", str (N*10, 3, 1), "\n")
    #end
   }
      triangle_wave

}

box {<-50, -40, 0.1>, <50, 40, 0.2>  //translate -x*25 translate x*B*60
 texture {
  NR_Wood
  scale 60
 }
}

//box {<-25, -25, 0.1>, <25, 25, 0.2> texture {NR_Wood scale 10} }


Post a reply to this message

From: Stephen Klebs
Subject: Re: color_maps : back to basics
Date: 17 Apr 2019 02:15:00
Message: <web.5cb68bb4e0a4d32d2ed2b2480@news.povray.org>
Would like to see gradient contours other than straight, linear curve. Like
Gaussian, cove or half-round. Or custom function.


Post a reply to this message

From: Bald Eagle
Subject: Re: color_maps : back to basics
Date: 17 Apr 2019 17:30:02
Message: <web.5cb76259e0a4d32d4eec112d0@news.povray.org>
"Stephen Klebs" <skl### [at] gmailcom> wrote:
> Would like to see gradient contours other than straight, linear curve. Like
> Gaussian, cove or half-round. Or custom function.

That would be cool. Probably won't happen until 4.0...  ;)

I think you could closely approximate anything you'd like by using an array and
filling in points by interpolating with the desired function.
Then use the array to define the color map.

It's a workaround, but for most things it probably gets you close enough.
Like most things, it could probably be written as a macro, to accept a
[partially filled] array containing a few defined points, the number of
subdivisions desired between 0 and 1, and the interpolation function.


Post a reply to this message

From: Alain
Subject: Re: color_maps : back to basics
Date: 17 Apr 2019 18:21:13
Message: <5cb76e99@news.povray.org>
Le 19-04-16 à 22:13, Stephen Klebs a écrit :
> Would like to see gradient contours other than straight, linear curve. Like
> Gaussian, cove or half-round. Or custom function.
> 
> 
> 
> 
Well wave type can give you a start:

ramp_wave : goes 0 to 1 linearly. Default for gradient and onion.

triangle_wave : goes from 0 to 1, then back to 0 linearly. Have a 
periodicity of 2. Default for wood and marble.

sine_wave : use a sinusoidal curve scaled and shifted to the 0..1 range. 
Have a periodicity of 2. Default for wave and ripples.

scallop_wave : Use the absolute value of the sin.

cubic_wave : zero slope at 0 and 1, maximum slope at 0.5 with smooth 
transition.

poly_wave Value : Use Value as an exponent. If value is >1, it start 
with no slope at 0 and increase exponentially toward 1. If Value <1, it 
start sharply and the slope diminishes toward 1 (think of the graph of a 
square or cubic root). Using Value = 0 should return 1 everywhere.


Alain


Post a reply to this message

From: Leroy
Subject: Re: color_maps : back to basics
Date: 24 Apr 2019 20:45:01
Message: <web.5cc0ca49e0a4d32df0dca4b30@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

>
> With regard to viewing the color map with a "linear pattern" - the problem I
> always had/have with adjusting some of the patterns is that I want to adjust a
> certain _part_ of it, and I don't know which part I'm trying to adjust.  With
> wood, for instance, if I want MORE of a certain tone, do I put that in the
> center of the color map, or the "ends" at 0 or 1?  Because some of these
> patterns don't get distributed proportionally.
> So that's why I wanted to plot the numerical values to _see_ what the
> distribution was in the pattern itself, not the color map that then gets
> re-distributed from the native "linear" definition.
>

I see the problem and it get more complicated when the ends of the color map are
the same color or the same color is repeated in the color map. Every pattern
takes the color map and twists it. It can take a lot of trial and error to find
that perfect arrangement. And of course we're dealing with 3d. What you have
done is   show the values of a pattern in 3d.
 I've been playing around with patterns, trying to get a handle on how qualify
differences in color placement. I took all the 'simple' patterns (agate,granite,
,gradient and the like) with all the waves types and did a simply test. Starting
at <0,0,0> with increments of .1 ending at <1,1,1> in a strait line.(using
evaluate pigment) I took the average of the differences between points. So now I
have a bunch of numbers. I don't know if they are a true representation of how
the patterns differ ,but it's a start.
 One thing was clear the gradient x, gradient y gradient z patterns numbers
where the same for each wave form. So maybe I've got something.

Well enough rambling back to work:) I need to go over your code;)

Have fun!


Post a reply to this message

Copyright 2003-2008 Persistence of Vision Raytracer Pty. Ltd.