POV-Ray : Newsgroups : povray.binaries.scene-files : Dakota Red Granite macro - beta #1 : Re: Dakota Red Granite macro - beta #1.1 Server Time
23 Apr 2024 09:00:39 EDT (-0400)
  Re: Dakota Red Granite macro - beta #1.1  
From: Thomas de Groot
Date: 18 May 2021 02:24:15
Message: <60a35d8f$1@news.povray.org>
Op 17/05/2021 om 19:42 schreef Bald Eagle:
> 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?

I need to plunge more seriously into arrays, but yes, I believe a 2D 
array would be better in this context. I shall have a look and try to 
work out something by myself (good practice!). First to cool smoking 
brain cells... :-)

> 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.
> 

Ok. Going to wrap that up somehow. Thanks for this. I have done very 
little in the way of arrays in the past, so this is a good opportunity 
to get better acquainted.


-- 
Thomas


Post a reply to this message

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