|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Here's what I have:
#declare pigmentR = pigment
{
function {fR (fL(x,y,z),fC(x,y,z),fH(x,y,z))}
color_map
{
[0 color srgb <0,0,0>]
[1 color srgb <3,0,0>]
}
}
#declare pigmentG = pigment
{
function {fG (fL(x,y,z),fC(x,y,z),fH(x,y,z))}
color_map
{
[0 color srgb <0,0,0>]
[1 color srgb <0,3,0>]
}
}
#declare pigmentB = pigment
{
function {fB (fL(x,y,z),fC(x,y,z),fH(x,y,z))}
color_map
{
[0 color srgb <0,0,0>]
[1 color srgb <0,0,3>]
}
}
isosurface
{
function { fFinal (fL(x,y,z),fC(x,y,z),fH(x,y,z)) }
threshold 0
accuracy 0.01
contained_by
{
box {<-1,0,-1>,<+1,+1,+1>}
}
max_gradient 20000
// [evaluate P0, P1, P2]
// open
// [max_trace INTEGER] | [all_intersections]
pigment
{
average
pigment_map
{
[1 pigmentR]
[1 pigmentG]
[1 pigmentB]
}
}
}
However, the result is much to white on top, and there are no blues or
greens whatsoever. I've attached the result of the render. Here's
roughly what the colors are supposed to look like:
https://commons.wikimedia.org/wiki/File:Cielch_color_solid_cylinder.png
Mike
Post a reply to this message
Attachments:
Download 'cielch_color_solid_cylinder_isosurface_2.png' (17 KB)
Preview of image 'cielch_color_solid_cylinder_isosurface_2.png'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
It occurred to me that the color solid should not extend beyond a
cylinder with radius 1 and height 1. I have attached an overhead view.
I'm guessing the simplest thing to do was intersect the isosurface with
the cylinder. Is that correct?
Mike
Post a reply to this message
Attachments:
Download 'cielch_color_solid_cylinder_isosurface_2.png' (16 KB)
Preview of image 'cielch_color_solid_cylinder_isosurface_2.png'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 11/24/2016 3:50 PM, Mike Horvath wrote:
> Here's what I have:
>
> #declare pigmentR = pigment
> {
> function {fR (fL(x,y,z),fC(x,y,z),fH(x,y,z))}
> color_map
> {
> [0 color srgb <0,0,0>]
> [1 color srgb <3,0,0>]
> }
> }
> #declare pigmentG = pigment
> {
> function {fG (fL(x,y,z),fC(x,y,z),fH(x,y,z))}
> color_map
> {
> [0 color srgb <0,0,0>]
> [1 color srgb <0,3,0>]
> }
> }
> #declare pigmentB = pigment
> {
> function {fB (fL(x,y,z),fC(x,y,z),fH(x,y,z))}
> color_map
> {
> [0 color srgb <0,0,0>]
> [1 color srgb <0,0,3>]
> }
> }
>
>
> isosurface
> {
> function { fFinal (fL(x,y,z),fC(x,y,z),fH(x,y,z)) }
> threshold 0
> accuracy 0.01
> contained_by
> {
> box {<-1,0,-1>,<+1,+1,+1>}
> }
> max_gradient 20000
> // [evaluate P0, P1, P2]
> // open
> // [max_trace INTEGER] | [all_intersections]
> pigment
> {
> average
> pigment_map
> {
> [1 pigmentR]
> [1 pigmentG]
> [1 pigmentB]
> }
> }
> }
>
> However, the result is much to white on top, and there are no blues or
> greens whatsoever. I've attached the result of the render. Here's
> roughly what the colors are supposed to look like:
>
> https://commons.wikimedia.org/wiki/File:Cielch_color_solid_cylinder.png
>
> Mike
>
Okay, the problem is that I want to use sRGB instead of RGB in the
pigments. However, it seems to not be possible to multiply the sRGB
colors and then average them like you can with regular RGB. Or is there
a way to get this to work?
Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 24.11.2016 um 23:56 schrieb Mike Horvath:
> Okay, the problem is that I want to use sRGB instead of RGB in the
> pigments. However, it seems to not be possible to multiply the sRGB
> colors and then average them like you can with regular RGB. Or is there
> a way to get this to work?
Don't use sRGB when mucking around with colour spaces, unless you know
/exactly/ what you are doing. Colour space experts are smart enough to
specify colours in terms of linear light intensity, or otherwise
explicitly inform the readers.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 24.11.2016 um 22:50 schrieb Mike Horvath:
> It occurred to me that the color solid should not extend beyond a
> cylinder with radius 1 and height 1. I have attached an overhead view.
May I ask the stupid question, "why not"?
I would expect the Lch colour space to encompass all the RGB colour
space, so the boundaries of the latter should be sufficient to bound the
shape.
My guess is that the issues you see with the shape are due to bogosities
in your colour conversion functions.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thank you clipka! Everything is working perfectly now! Part of the
problem was a bug in my conversion functions. Once I fixed it, I started
getting the correct results.
Do you mind if I put a LGPL license on the code an upload it to Wikipedia?
Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 11/24/2016 6:43 PM, clipka wrote:
> Am 24.11.2016 um 23:56 schrieb Mike Horvath:
>
>> Okay, the problem is that I want to use sRGB instead of RGB in the
>> pigments. However, it seems to not be possible to multiply the sRGB
>> colors and then average them like you can with regular RGB. Or is there
>> a way to get this to work?
>
> Don't use sRGB when mucking around with colour spaces, unless you know
> /exactly/ what you are doing. Colour space experts are smart enough to
> specify colours in terms of linear light intensity, or otherwise
> explicitly inform the readers.
>
The functions output sRGB colors with Illuminant = D65 and Observer = 2°
(1931) according to one of the conversion websites that uses these formulas.
I'd like the POV code to use sRGB as well.
Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 11/24/2016 6:46 PM, clipka wrote:
> Am 24.11.2016 um 22:50 schrieb Mike Horvath:
>> It occurred to me that the color solid should not extend beyond a
>> cylinder with radius 1 and height 1. I have attached an overhead view.
>
> May I ask the stupid question, "why not"?
>
> I would expect the Lch colour space to encompass all the RGB colour
> space, so the boundaries of the latter should be sufficient to bound the
> shape.
>
> My guess is that the issues you see with the shape are due to bogosities
> in your colour conversion functions.
>
L, C and H are supposed to form a cylinder. There are some very small
sRGB bits poking outside of the cylinder. I guess I could show the bits
as well, as long as I explain what they are.
Also, I *did* make a mistake in the color conversion code. I was
clamping L, C and H to 0..100, 0..100 and 0..360 incorrectly. Once I
stopped clamping, the shape turned into what I have been expecting based
on earlier tests.
I've attached the final shape, with the outside sRGB bits trimmed off.
Mike
Post a reply to this message
Attachments:
Download 'cielch_color_solid_cylinder_isosurface.png' (24 KB)
Preview of image 'cielch_color_solid_cylinder_isosurface.png'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 25.11.2016 um 01:50 schrieb Mike Horvath:
> On 11/24/2016 6:43 PM, clipka wrote:
>> Am 24.11.2016 um 23:56 schrieb Mike Horvath:
>>
>>> Okay, the problem is that I want to use sRGB instead of RGB in the
>>> pigments. However, it seems to not be possible to multiply the sRGB
>>> colors and then average them like you can with regular RGB. Or is there
>>> a way to get this to work?
>>
>> Don't use sRGB when mucking around with colour spaces, unless you know
>> /exactly/ what you are doing. Colour space experts are smart enough to
>> specify colours in terms of linear light intensity, or otherwise
>> explicitly inform the readers.
>>
>
> The functions output sRGB colors with Illuminant = D65 and Observer = 2°
> (1931) according to one of the conversion websites that uses these
> formulas.
>
> I'd like the POV code to use sRGB as well.
Don't try to go via that route; it won't work with the approach I've
described.
Instead, in the function pipeline, insert a function to explicitly
convert from sRGB to RGB:
3D cartesian -> Lch -> sRGB -> RGB -> "distance"
3D cartesian -> Lch -> sRGB -> RGB -> pigments
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 25.11.2016 um 01:47 schrieb Mike Horvath:
> Thank you clipka! Everything is working perfectly now! Part of the
> problem was a bug in my conversion functions. Once I fixed it, I started
> getting the correct results.
>
> Do you mind if I put a LGPL license on the code an upload it to Wikipedia?
Feel free to do so.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|