POV-Ray : Newsgroups : povray.beta-test : Gamma in POV-Ray 3.6 vs. 3.7 Server Time
5 Oct 2024 12:17:36 EDT (-0400)
  Gamma in POV-Ray 3.6 vs. 3.7 (Message 61 to 70 of 75)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 5 Messages >>>
From: clipka
Subject: Re: Gamma in POV-Ray 3.6 vs. 3.7
Date: 14 Sep 2009 14:38:54
Message: <4aae8dbe$1@news.povray.org>
Le_Forgeron schrieb:
> In fact the reflection's colour is a matrix, and the refraction's colour
> is another. (Today, refraction = coef*reflection ... known as filter)
> Transmit should remains a single number, right ?

Are you sure about this?

For diffuse reflection you're right: That one would need a matrix, to 
account for fluorescence effects. The material absorbs light, and 
re-emits the energy of it at a different wavelength in random 
directions. But do there exist any (practically relevant) effects where 
a photon loses or gains energy without being scattered quite randomly?


Post a reply to this message

From: Mike Raiford
Subject: Re: Gamma in POV-Ray 3.6 vs. 3.7
Date: 14 Sep 2009 15:19:13
Message: <4aae9731$1@news.povray.org>
clipka wrote:
> Mike Raiford schrieb:
>> That would be neat to have... But, how to implement? How would you 
>> convert from an rgb-specified color to a spectrally specified color?
> 
> Oh, I guess that shouldn't be too difficult: Just multiply each color 
> component with the spectral output of some standard phosphor for that 
> color - et voila. It would boil down to an 3xN matrix multiplication.
> 
> Generating the output image should be just as easy: Using an Nx3 matrix 
> based on the CIE tristimulus curves would give the color in XYZ color 
> space. From there it's just another 3x3 matrix multiplication to csRGB. 
> Consequently, there must also exist some Nx3 matrix to take us directly 
> to sRGB.)
> 
> Of course, to make any /real/ use of this feature, there would neet to 
> be an additional color syntax to have more control over a color's spectrum.
> 

You would definitely want a way to define the observer and the pigments. 
One thing you would need to be careful of is colors defined simply by 
RGB would be susceptible to metameric failure under light sources that 
have strong lines in their spectrum (see below)

>> fluorescence would be quite fun to have. Impractical, but fun to play 
>> with.
>>
>> At least with spectral colors and lights you could simulate metameric 
>> failure.
> 
> Whatever that may be...

http://en.wikipedia.org/wiki/Metamerism_%28color%29
-- 
~Mike


Post a reply to this message

From: clipka
Subject: Re: Gamma in POV-Ray 3.6 vs. 3.7
Date: 14 Sep 2009 16:02:36
Message: <4aaea15c$1@news.povray.org>
Ive schrieb:
> What I have to add are a few notes about file-format gamma handling:
...
> did I forget something, GIF? not much to say there but usually gamma 
> corrected in between 1.4 and 2.4 - its a matter of guessing again.

How about TIFF? Not that it would probably matter much, if the support 
is as broken as you say, but still...

Would it be a safe bet to presume sRGB for those as well?


Post a reply to this message

From: Le Forgeron
Subject: Re: Gamma in POV-Ray 3.6 vs. 3.7
Date: 14 Sep 2009 16:36:03
Message: <4aaea933$1@news.povray.org>
Le 14/09/2009 20:38, clipka nous fit lire :
> Le_Forgeron schrieb:
>> In fact the reflection's colour is a matrix, and the refraction's colour
>> is another. (Today, refraction = coef*reflection ... known as filter)
>> Transmit should remains a single number, right ?
> 
> Are you sure about this?

Today, reflection is just a 1D-vector (3 components: R,G,B), and docs says:

The 4th component, called filter, specifies the amount of filtered
transparency of a substance. Some real-world examples of filtered
transparency are stained glass windows or tinted cellophane. The light
passing through such objects is tinted by the appropriate color as the
material selectively absorbs some frequencies of light while allowing
others to pass through. The color of the object is subtracted from the
light passing through so this is called subtractive transparency.

The 5th component, called transmit, specifies the amount of non-filtered
light that is transmitted through a surface. Some real-world examples of
non-filtered transparency are thin see-through cloth, fine mesh netting
and dust on a surface. In these examples, all frequencies of light are
allowed to pass through tiny holes in the surface. Although the amount
of light passing through is diminished, the color of the light passing
through is unchanged.

### end of citation

I would expect transmit to not suffer ior, whereas filter to do. [see
later **]

For filter handling, look at source/backend/render/trace.cpp, circa line
928 : the filtering accumulator get added with the product of single
filter by surface colour (vector rgb). If it was independent, it would
use a different information instead of multiplying for that.
(and it might be more memory consuming, but saving 3 "*" each
ray/intersection, but that would not matter i guess)

at least, it looks like ambient finish can be colored, sort of a good
news for me.

** : it seems that whatever, filter or transmit, both get ior in play,
as a single ray is shot (line 963, trace.cpp again). Which somehow is
not what I would expect from my reading of the docs.

Transmit is refracted, unfiltered;
Filter is refracted, filtered by layer colour (!?)

Reflected colour is special (according to metallic reflection and such
fancy), but basically has far more control (ambient, diffuse, reflection...)

The fishy thing here seems to be that the same colour for reflection is
used for refraction/filter.

I might wish for a second Transmit, straight line for incoming rays, for
at least semi-refracting objects (real see-thru when ior come into play)




> 
> For diffuse reflection you're right: That one would need a matrix, to
> account for fluorescence effects. The material absorbs light, and
> re-emits the energy of it at a different wavelength in random
> directions. But do there exist any (practically relevant) effects where
> a photon loses or gains energy without being scattered quite randomly?

The notion of diffuse refraction (sort of) could be a perturbation of
the normal, or some integration of a sampled cone...

For straight refraction, I know at least of laser-protection filter.

And whether a laser-beam is obtained from excitation of peripheral
(reflection) or of internal (refraction)

For the SDL, at least it would allow a refraction on a black reflecting
glass.

Now, the real question might be to modelise the refraction at the
surface, or in the media only ? Should the surface_color*filter be
dropped for an additional refracted transmit (bis, sort of) ?
Should we continue to fake a "filtering" (the actual refraction) ?




And should we bother for pleochroism ? what about birefringence ?

(from wikipedia, handle with care: Cotton (Gossypium hirsutum) fiber is
birefringent because of high levels of cellulosic material in the
fiber's secondary cell wall.

If Cotton is not everywhere... )

Maybe that's a part for media, not pigment.


Post a reply to this message

From: Ive
Subject: Re: Gamma in POV-Ray 3.6 vs. 3.7
Date: 14 Sep 2009 17:00:45
Message: <4aaeaefd$1@news.povray.org>
clipka wrote:
> How about TIFF? Not that it would probably matter much, if the support 
> is as broken as you say, but still...
> 
> Would it be a safe bet to presume sRGB for those as well?

Given the facts that the used RGBA-interface from libtif applies a 
simple gamma correction of 2.2 before returning the RGBA 8bit values 
when the original image data did use color formats like L*a*b or Luv 
(linear ones) and most of the libtif code dates back to times long 
before sRGB was even specified I would vote for just an inverse 2.2 
correction. Should be at least close for almost 90% of randomly selected 
TIFF's.

TIFF has for 'everything' some tags but does not have some simple gamma 
tag like PNG. Instead it has tags that would contain complete LUT's for 
each color channel. But the RGBA-interface ignores those anyway. And 
most contemporary TIFF's rely on embedded ICC profiles and this is also 
not supported when using this interface.

-Ive


Post a reply to this message

From: clipka
Subject: Re: Gamma in POV-Ray 3.6 vs. 3.7
Date: 14 Sep 2009 19:58:39
Message: <4aaed8af@news.povray.org>
Le_Forgeron schrieb:
>> The 4th component, called filter, specifies the amount of filtered
>> transparency of a substance. Some real-world examples of filtered
>> transparency are stained glass windows or tinted cellophane.
 >> ...
>> The 5th component, called transmit, specifies the amount of non-filtered
>> light that is transmitted through a surface. Some real-world examples of
>> non-filtered transparency are thin see-through cloth, fine mesh netting
>> and dust on a surface.
 >> ...
> 
> I would expect transmit to not suffer ior, whereas filter to do. [see
> later **]

Not really: The see-through cloth and similar stuff mental picture of 
what transmit actually does only work well when dealing with sufaces 
only - in that case the question whether transmit suffers ior is moot.

Actually, filter doesn't suffer ior either: It is the light attenuated 
by them that suffers refraction.


> For filter handling, look at source/backend/render/trace.cpp, circa line
> 928 :

Hold it! --
Don't look at the code if you want to find out how things *should* be 
modeled :-P

You know why both filter and transmit are there?

Because a single coefficient is not enough to describe transparency.

Now Gues why that is?

Because strictly speaking it would require *three* coefficients: Red, 
blue and green transparency :-P

With those three, you could do everything filter and transmit do right 
now - plus some.

And when going for spectral math, it would require as many coefficients 
as there are wavelengths: Each could be attenuated differently.


> The fishy thing here seems to be that the same colour for reflection is
> used for refraction/filter.

Not really: Normally, when transparency is involved, you get 
straightforward "white" reflection. This is different when metallic 
materials are involved, but those are not transparent - unless there are 
small holes in it, in which case the transparent color is "white" (as 
modelled by transmit).

(There are a few exceptions to this, but as far as I know those are 
rare. iridescence is such an effect.)


> I might wish for a second Transmit, straight line for incoming rays, for
> at least semi-refracting objects (real see-thru when ior come into play)

What real-world effect would that model?


>> But do there exist any (practically relevant) effects where
>> a photon loses or gains energy without being scattered quite randomly?
> 
> The notion of diffuse refraction (sort of) could be a perturbation of
> the normal, or some integration of a sampled cone...

That has nothing to do with my question.

There's also no such thing as diffuse refraction - there is only diffuse 
transparency, caused by either (a) as you say pertubations of the 
normal, or (b) volumetric scattering in the material.

> For straight refraction, I know at least of laser-protection filter.
> 
> And whether a laser-beam is obtained from excitation of peripheral
> (reflection) or of internal (refraction)

I have no idea what you're saying here.

> For the SDL, at least it would allow a refraction on a black reflecting
> glass.

??

> Now, the real question might be to modelise the refraction at the
> surface, or in the media only ?

Refraction only occurs at surfaces.
Do you perhaps mean attenuation of refracted light? For that, POV-Ray 
provides both the "filter" color, as well as the interior fading. The 
one would be suitable to model coatings made of semi-transparent 
material, while the other would model large volumes of semi-transparent 
material.

> And should we bother for pleochroism ? what about birefringence ?

A bit of peochroism would be neat. Some 6 instead of 3 color channels 
would be a start. Plus a UV channel of course.

> (from wikipedia, handle with care: Cotton (Gossypium hirsutum) fiber is
> birefringent because of high levels of cellulosic material in the
> fiber's secondary cell wall.
> 
> If Cotton is not everywhere... )

As it is typically used in fibrous form, the birefringence effect is of 
no importance whatsoever at the scales of usual scenes.

> Maybe that's a part for media, not pigment.

Birefringence is definitively neither a media nor pigment thing, but a 
straightforward interior thing, and would have to join ranks with ior 
and dispersion (as a matter of fact it's a difference in ior depending 
on polarization with respect to the "optical axis" of the (AFAIK 
necessarily) crystalline material).


Post a reply to this message

From: MDenham
Subject: Re: Gamma in POV-Ray 3.6 vs. 3.7
Date: 14 Sep 2009 20:55:00
Message: <web.4aaee547235fbd0cc15a32a60@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> You know why both filter and transmit are there?
>
> Because a single coefficient is not enough to describe transparency.
>
> Now Gues why that is?
>
> Because strictly speaking it would require *three* coefficients: Red,
> blue and green transparency :-P
>
> With those three, you could do everything filter and transmit do right
> now - plus some.
>
> And when going for spectral math, it would require as many coefficients
> as there are wavelengths: Each could be attenuated differently.

This makes a good case for actually stripping filter and transmit out of the SDL
entirely (or at least deprecating them) and throwing in a separate
"transparency" keyword under pigments.

....especially if we _are_ going to have spectral coloring/lighting.  (For the
time being, I'm leaning towards an implementation that's strictly peak/width
pairs.  It'd be extended later, but it's at least a start towards a "good"
system for this.)

> > For the SDL, at least it would allow a refraction on a black reflecting
> > glass.
>
> ??

Obsidian, at present, is one of the more pain-in-the-neck RL substances to
model.  I assume this is what he's trying to get at, but I could be wrong.

> > And should we bother for pleochroism ? what about birefringence ?
>
> A bit of p[l]eochroism would be neat. Some 6 instead of 3 color channels
> would be a start. Plus a UV channel of course.

Pleochroism pretty well falls under the requests for an AOI pigment pattern,
doesn't it? :-D

> > Maybe that's a part for media, not pigment.
>
> Birefringence is definitively neither a media nor pigment thing, but a
> straightforward interior thing, and would have to join ranks with ior
> and dispersion (as a matter of fact it's a difference in ior depending
> on polarization with respect to the "optical axis" of the (AFAIK
> necessarily) crystalline material).

Dispersion is an ugly hack at present, just like iridescence.  :-D  (Technically
it should be implemented as the spectral variant of ior...  yet another thing on
The List (tm) for this.)  Birefringence seems like it'd require an extension to
ior as well (similar to the current two-value reflection form - specify an axis
of anisotropy and a second ior), though maybe I'm loading a bit much on the ior
keyword now...


Post a reply to this message

From: clipka
Subject: Re: Gamma in POV-Ray 3.6 vs. 3.7
Date: 15 Sep 2009 05:17:17
Message: <4aaf5b9d$1@news.povray.org>
MDenham schrieb:
> This makes a good case for actually stripping filter and transmit out of the SDL
> entirely (or at least deprecating them) and throwing in a separate
> "transparency" keyword under pigments.

Indeed - though it might be more correct to re-use the "transmit" 
keyword for that purpose.

> ....especially if we _are_ going to have spectral coloring/lighting.  (For the
> time being, I'm leaning towards an implementation that's strictly peak/width
> pairs.  It'd be extended later, but it's at least a start towards a "good"
> system for this.)

For the time being, I guess we'll have to do with RGB for quite a while 
still :-)

> Obsidian, at present, is one of the more pain-in-the-neck RL substances to
> model.  I assume this is what he's trying to get at, but I could be wrong.

It appears to me that this would be due to the blackness not being a 
surface effect at all, and would need subsurface scattering or (probably 
more efficient in this case) media to be modelled properly.

>>> And should we bother for pleochroism ? what about birefringence ?
>> A bit of p[l]eochroism would be neat. Some 6 instead of 3 color channels
>> would be a start. Plus a UV channel of course.
> 
> Pleochroism pretty well falls under the requests for an AOI pigment pattern,
> doesn't it? :-D

Yes, that would probably be an alternative in some semi-rare cases.


Post a reply to this message

From: Mike Raiford
Subject: Re: Gamma in POV-Ray 3.6 vs. 3.7
Date: 15 Sep 2009 08:39:44
Message: <4aaf8b10@news.povray.org>
clipka wrote:

>> Maybe that's a part for media, not pigment.
> 
> Birefringence is definitively neither a media nor pigment thing, but a 
> straightforward interior thing, and would have to join ranks with ior 
> and dispersion (as a matter of fact it's a difference in ior depending 
> on polarization with respect to the "optical axis" of the (AFAIK 
> necessarily) crystalline material).

How hard would it be to implement birefringence ...? Seems like it could 
easily be faked

Syntax would be trivial:

ior 1.5, 1.7 //(birefringent material)

You don't really need to care about the polarization of light, since 
light in POVRay doesn't have polarity anyway.

I would imagine tracing a second ray at a different IOR would be rather 
simple to add.

-- 
~Mike


Post a reply to this message

From: MDenham
Subject: Re: Gamma in POV-Ray 3.6 vs. 3.7
Date: 15 Sep 2009 08:55:01
Message: <web.4aaf8e92235fbd0cf9396ec40@news.povray.org>
Mike Raiford <"m[raiford]!at"@gmail.com> wrote:
> clipka wrote:
>
> >> Maybe that's a part for media, not pigment.
> >
> > Birefringence is definitively neither a media nor pigment thing, but a
> > straightforward interior thing, and would have to join ranks with ior
> > and dispersion (as a matter of fact it's a difference in ior depending
> > on polarization with respect to the "optical axis" of the (AFAIK
> > necessarily) crystalline material).
>
> How hard would it be to implement birefringence ...? Seems like it could
> easily be faked
>
> Syntax would be trivial:
>
> ior 1.5, 1.7 //(birefringent material)
>
> You don't really need to care about the polarization of light, since
> light in POVRay doesn't have polarity anyway.
>
> I would imagine tracing a second ray at a different IOR would be rather
> simple to add.

The problem is that you still need to know two other pieces of information:

1) the axis of anisotropy
2) the "ordinary" axis

It turns into a useful (though limited) form of the otherwise not-gonna-happen
"variable ior" request thanks to this.  (Generalized variable ior isn't going
to happen for reasons that are mentioned in the documentation, such as
"pockets" of high IOR - or even not-so-high IOR - having potentially
pathological behavior.  You'd need to switch to a solely
rays-start-at-light-sources approach - photons, only slower - to make this even
slightly viable, and that kind of rewrite probably isn't worth it.  [If it turns
out that it's necessary for a "good" spectral system, then we may have issues.
:-D])


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 5 Messages >>>

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