POV-Ray : Newsgroups : povray.beta-test : Finish block dispersion handling. v3.8 (and v3.7). : Re: Finish block dispersion handling. v3.8 (and v3.7). Server Time
23 Apr 2024 13:07:07 EDT (-0400)
  Re: Finish block dispersion handling. v3.8 (and v3.7).  
From: clipka
Date: 1 Jul 2021 09:27:57
Message: <60ddc2dd$1@news.povray.org>
Am 01.07.2021 um 13:37 schrieb William F Pokorny:
> Expect not much of an issue given how long it's been this way, but, FWIW...
> 
> ---
> For backward compatibility we support some interior keywords in the 
> finish block too. The related finish variables are Temp_Caustics, 
> Temp_IOR, Temp_Dispersion and Temp_Refract.
> 
> The documentation doesn't indicate dispersion was ever previously 
> supported for the finish block, but we have partial code for it.
> 
> The finish block parsing is missing for Temp_Dispersion. User's having 
> scenes with finish block dispersion get syntax errors.
> 
> Taking the ior as being specified in the finish block, if a user were to 
> specify dispersion in the interior block, as our documentation 
> indicates, they get confusing results due this code in object.cpp:
> 
> if (Finish->Temp_IOR >= 0.0)
> {
>      Object->interior->IOR = Finish->Temp_IOR;
>      Object->interior->Dispersion = Finish->Temp_Dispersion;
> }
> 
> The defaulted Finish->Temp_Dispersion value (1.0) is used and the user 
> has no way to override the default due the lack of finish { dispersion } 
> parsing.

Refraction settings seem to have been officially moved from `finish` to 
the then-new `interior` in POV-Ray v3.1.

Dispersion was only added later, in POV-Ray v3.5. My guess is that 
whoever added the feature has probably considered whether to extend the 
old in-finish syntax to also support dispersion, but came to no definite 
conclusion, and therefore designed the mechanism under the hood to 
easily support such an extension, but that extension never materialized.

> And, yes, users can mix the interior vs finish block definitions 
> supported in both blocks in confusing ways. We don't warn that 
> conflicting definitions are a problem, and, such conflicts are not 
> flagged during parsing. A finish block ior>0.0 overrides any ior set in 
> the interior block.

A finish block ior >0.0 does trigger a warning, which should be enough 
of an indication for anyone to notice that they're doing an oopsie. If 
they're deliberately continuing to use an entirely undocumented feature 
despite earning warnings, I'd argue that we're not their baby-sitters.

> ---
> Aside:
> The compatibility warning message when you specify, for example, ior in 
> the finish block is misleading. All about backwards compatibility when 
> the concern is, I believe, forward compatibility.
> 
> Index of refraction value should be specified in 'interior{...}' statement.
> Use of this syntax may not be backwards compatible with earlier versions 
> of POV-Ray.

The intention of the message is to say, "when you use this syntax, the 
behavior of this version may not be backwards compatible with that of 
earlier versions".

I'd be happy to hear a better phrasing.


Post a reply to this message

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