|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Here is the macro.
Please note that there are still a couple experimental features (veins,
sslt). No html documentation yet, but you can combine most parameters to
create 'your own' granite. ;-)
Discussion, please, with an illustration if necessary, in p.b.i.
--
Thomas
Post a reply to this message
Attachments:
Download 'dakotaredgranite_beta_1.mcr.txt' (23 KB)
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Found already something to correct ;-)
Here is beta #1.1
--
Thomas
Post a reply to this message
Attachments:
Download 'dakotaredgranite_beta_1.1.mcr.txt' (23 KB)
|
|
| |
| |
|
|
|
|
| |
| |
|
|
This is looking great :)
I am thinking that we could consolidate the color_map code by using a macro, so
you can select which macro to run, rather than which full color map to parse.
In that line of thinking, we could also perhaps make the color map itself a lot
smaller using and array and a loop.
Looking through the extensive amount of code you've written (wow, impressive :O
)
I'm thinking that my suggestion for
#local not_0 = 1/256;
was close, but that would not give a pure black. Maybe 1/257 to give a pure
black monitor color but still not 0;
I think it will take some time and more experimentation to see what sorts of
things we can make - and break :D
Post a reply to this message
Attachments:
Download 'dakotaredmacrotest1.png' (219 KB)
Preview of image 'dakotaredmacrotest1.png'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> I'm thinking that my suggestion for
> #local not_0 = 1/256;
> was close, but that would not give a pure black. Maybe 1/257 to give a pure
> black monitor color but still not 0;
>
That's not pure black intentionally. In nature, pure black just don't exist.
Instead of using zero, I often use 0.001.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Bald Eagle" <cre### [at] netscapenet> wrote:
> I am thinking that we could consolidate the color_map code by using a macro, so
> you can select which macro to run, rather than which full color map to parse.
>
> In that line of thinking, we could also perhaps make the color map itself a lot
> smaller using and array and a loop.
For your consideration:
#macro Convert (Csc, SatBoost, BrightBoost, Color)
#switch (Csc)
#case (1)
#local MyColour = srgb Color;
#break
#case (2)
#local sRGB_Gamma = function(C) {select(C-0.0031308, C*12.92, 1.055*pow(C,
1/2.4)-0.055)}
#local SB = SatBoost; // Saturation boost
#local VB = BrightBoost; // Brightness ("volume") boost
#local RawColour = srgb <sRGB_Gamma(Color.red), sRGB_Gamma(Color.green),
sRGB_Gamma(Color.blue)>;
#local SatColour = RawColour-SB;
#local MyColour = SatColour*(1+VB)*RawColour.gray/SatColour.gray;
#break
#else
#local MyColour = Color;
#end
MyColour
#end
#declare CSC = 1;
#local CM = array {
<0.00, not_0, not_0, not_0>,
<0.25, 0.059, 0.059, 0.059>,
<0.25, 0.086, 0.027, 0.059>,
<0.35, 0.086, 0.027, 0.059>,
<0.35, 0.118, 0.118, 0.078>,
<0.45, 0.118, 0.118, 0.078>,
<0.45, 0.200, 0.137, 0.110>,
<0.50, 0.150, 0.087, 0.060>,
<0.57, 0.200, 0.137, 0.110>,
<0.57, 0.400, 0.337, 0.310>,
<0.60, 0.350, 0.287, 0.260>,
<0.63, 0.400, 0.337, 0.310>,
<0.63, 0.769, 0.329, 0.298>,
<0.70, 0.669, 0.229, 0.198>,
<0.75, 0.769, 0.329, 0.298>,
<0.75, 0.600, 0.600, 0.600>,
<0.85, 0.550, 0.550, 0.550>,
<1.00, 0.650, 0.650, 0.650>
}
#local C_gr21_DakotaRed_map1 = //the granite colour_map proper
color_map {
#if (version >= 3.8)
blend_mode 2
#end
#local Entries = dimension_size (CM, 1)-1;
#for (E, 0, Entries)
[CM[E].x rgb <CM[E].y, CM[E].z, CM[E].filter>]
#end
}
Post a reply to this message
|
|
| |
| |
|
|
From: Thomas de Groot
Subject: Re: Dakota Red Granite macro - beta #1.1
Date: 17 May 2021 02:00:07
Message: <60a20667@news.povray.org>
|
|
|
| |
| |
|
|
Op 16/05/2021 om 16:07 schreef Bald Eagle:
> This is looking great :)
>
<grin> You reminded me of the Stanford objects. I shall need to dig them
up again from the dust. They are good test objects indeed.
>
> I am thinking that we could consolidate the color_map code by using a macro, so
> you can select which macro to run, rather than which full color map to parse.
>
> In that line of thinking, we could also perhaps make the color map itself a lot
> smaller using and array and a loop.
>
Possibly. I saw your suggestion later in this thread and shall put it
through the mill.
>
> Looking through the extensive amount of code you've written (wow, impressive :O
> )
>
It grows all by itself...
> I'm thinking that my suggestion for
> #local not_0 = 1/256;
> was close, but that would not give a pure black. Maybe 1/257 to give a pure
> black monitor color but still not 0;
>
I think it is a trivial difference. As Alain said, no real black in
nature, and the black pigments here represent micas, which are far from
pitch black anyway.
> I think it will take some time and more experimentation to see what sorts of
> things we can make - and break :D
>
Oh, I am sure it will ;-)
--
Thomas
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Op 17/05/2021 om 00:00 schreef Bald Eagle:
> For your consideration:
>
Thanks. You are the array expert :-) I always feel a bit unconfortable
with those; I shall give it a go later today.
--
Thomas
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thomas de Groot <tho### [at] degrootorg> wrote:
> > I'm thinking that my suggestion for
> > #local not_0 = 1/256;
> > was close, but that would not give a pure black. Maybe 1/257 to give a pure
> > black monitor color but still not 0;
> >
> I think it is a trivial difference. As Alain said, no real black in
> nature, and the black pigments here represent micas, which are far from
> pitch black anyway.
I suppose it is .. trivial ... but my thought was as a general point, we should
provide the users with the fullest range of colors as possible, realistic or
not, so that we don't code another 20 scenes that 20 years from now people with
throw up their hands and cry "Why did they DO *this*???"
So I was thinking it would allow the representation of the purest black
possible, but still not be zero. What color is a dark hole or a lightless room?
There may also be scenes later on where people are rendering heightfields, etc,
and want a pixel rgb that numerically is integer 0.
Nothing really to do with the present granite, just thinking ahead.
That's all.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Op 17-5-2021 om 00:00 schreef Bald Eagle:
> For your consideration:
>
> #macro Convert (Csc, SatBoost, BrightBoost, Color)
> #switch (Csc)
> #case (1)
> #local MyColour = srgb Color;
> #break
> #case (2)
> #local sRGB_Gamma = function(C) {select(C-0.0031308, C*12.92, 1.055*pow(C,
> 1/2.4)-0.055)}
>
> #local SB = SatBoost; // Saturation boost
> #local VB = BrightBoost; // Brightness ("volume") boost
> #local RawColour = srgb <sRGB_Gamma(Color.red), sRGB_Gamma(Color.green),
> sRGB_Gamma(Color.blue)>;
> #local SatColour = RawColour-SB;
> #local MyColour = SatColour*(1+VB)*RawColour.gray/SatColour.gray;
> #break
> #else
> #local MyColour = Color;
> #end
>
> MyColour
>
> #end
>
Yes. Smart indeed.
> #declare CSC = 1;
>
> #local CM = array {
> <0.00, not_0, not_0, not_0>,
> <0.25, 0.059, 0.059, 0.059>,
>
> <0.25, 0.086, 0.027, 0.059>,
> <0.35, 0.086, 0.027, 0.059>,
>
> <0.35, 0.118, 0.118, 0.078>,
> <0.45, 0.118, 0.118, 0.078>,
>
> <0.45, 0.200, 0.137, 0.110>,
> <0.50, 0.150, 0.087, 0.060>,
> <0.57, 0.200, 0.137, 0.110>,
>
> <0.57, 0.400, 0.337, 0.310>,
> <0.60, 0.350, 0.287, 0.260>,
> <0.63, 0.400, 0.337, 0.310>,
>
> <0.63, 0.769, 0.329, 0.298>,
> <0.70, 0.669, 0.229, 0.198>,
> <0.75, 0.769, 0.329, 0.298>,
>
> <0.75, 0.600, 0.600, 0.600>,
> <0.85, 0.550, 0.550, 0.550>,
> <1.00, 0.650, 0.650, 0.650>
> }
>
You make an error here I believe. The first expression is /not/ the
x-value but the *color_map entry*! And so the last one is /not/ a filter
value. Below, this gets wrong as a consequence:
> #local C_gr21_DakotaRed_map1 = //the granite colour_map proper
> color_map {
> #if (version >= 3.8)
> blend_mode 2
> #end
> #local Entries = dimension_size (CM, 1)-1;
> #for (E, 0, Entries)
> [CM[E].x rgb <CM[E].y, CM[E].z, CM[E].filter>]
This line is confusing. How would you write the line above? Like this?
(? used for unknown expression):
[CM[E].? rgb <CM[E].x, CM[E].y, CM[E].z>]
> #end
> }
>
Also, in the above example with CSC=1 ('raw' srgb option) should 'rgb'
not be 'srgb'? I am getting ab bit lost here.
--
Thomas
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thomas de Groot <tho### [at] degrootorg> wrote:
> You make an error here I believe. The first expression is /not/ the
> x-value but the *color_map entry*! And so the last one is /not/ a filter
> value. Below, this gets wrong as a consequence:
Nope.
I converted the entire color map into an array of /4-component/ vectors, with
the color map entry as the first number. And, as I anticipated, this might be
confusing. Maybe this should be rearranged to have the color map entry be the
filter, or (better?) constructed as a 2D array?
It was just a quick example of how to not write out the whole color map twice,
and make any changes easier.
>
> > #local C_gr21_DakotaRed_map1 = //the granite colour_map proper
> > color_map {
> > #if (version >= 3.8)
> > blend_mode 2
> > #end
> > #local Entries = dimension_size (CM, 1)-1;
> > #for (E, 0, Entries)
> > [CM[E].x rgb <CM[E].y, CM[E].z, CM[E].filter>]
> This line is confusing. How would you write the line above? Like this?
> (? used for unknown expression):
> [CM[E].? rgb <CM[E].x, CM[E].y, CM[E].z>]
>
> > #end
> > }
> >
>
> Also, in the above example with CSC=1 ('raw' srgb option) should 'rgb'
> not be 'srgb'? I am getting ab bit lost here.
That line above is wrong, but for a different reason.
It's SUPPOSED to be:
[CM[E].x Convert (CSC, SatBoost, BrightBoost, <CM[E].y, CM[E].z,
CM[E].filter>)]
That way the one macro gets used for every CSC, and the rgb / srgb / function
gets implemented in the macro, not directly in the color map.
I got distracted and made an oopsie.
See if anything special needs to be done in the full macro so that the srgb
option works even though SatBoost, BrightBoost are not explicitly specified - in
other words, an unused default placeholder value just gets passed into the
macro.
Attaching file so it's all (hopefully) clearer.
Post a reply to this message
Attachments:
Download 'smallcolormap.pov.txt' (2 KB)
|
|
| |
| |
|
|
|
|
| |
|
|