POV-Ray : Newsgroups : povray.newusers : Parse warning on refraction Server Time
22 Dec 2024 06:14:25 EST (-0500)
  Parse warning on refraction (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: gharryh
Subject: Parse warning on refraction
Date: 17 Jun 2013 15:30:00
Message: <web.51bf6388957ad2fb520168c30@news.povray.org>
Since using version 3.7 i get the following parse error:
--
Parse Warning: Refraction value unnecessary to turn on refraction. To attenuate,
the fade_power and fade_distance keywords should be specified in 'interior{...}'
statement.   Use of this syntax may not be backwards
compatable with earlier versions of POV-Ray.   The #version directive or +MV
switch will not help.
--

I have some texture defs that are using refraction.
How should i rewrite these defs to please the render machine.
[code]
#declare acrylic =
texture {
    pigment { White filter .9}
    finish {
        specular 1
        roughness .005
        reflection .1
        ambient 0
        diffuse 0
        refraction 1
        ior 1.4
    }
}
[/code]


Post a reply to this message

From: Alain
Subject: Re: Parse warning on refraction
Date: 17 Jun 2013 17:43:26
Message: <51bf82fe$1@news.povray.org>

> Since using version 3.7 i get the following parse error:
> --
> Parse Warning: Refraction value unnecessary to turn on refraction. To attenuate,
> the fade_power and fade_distance keywords should be specified in 'interior{...}'
> statement.   Use of this syntax may not be backwards
> compatable with earlier versions of POV-Ray.   The #version directive or +MV
> switch will not help.
> --
>
> I have some texture defs that are using refraction.
> How should i rewrite these defs to please the render machine.
> [code]
> #declare acrylic =
> texture {
>      pigment { White filter .9}
>      finish {
>          specular 1
>          roughness .005
>          reflection .1
>          ambient 0
>          diffuse 0
>          refraction 1
>          ior 1.4
>      }
> }
> [/code]
>
>

What was the previous version number of POV-Ray that you used?

That warning was isued with version 3.6, and also 3.5 if I recal 
correctly. I don't remember if it was isued with version 3.3... but it 
already used the interior block to enable ior and refraction.

There is an added statement:
"Use of this syntax may not be backwards compatable with earlier 
versions of POV-Ray.   The #version directive or +MV switch will not help."
that was not isued when using version 3.6.
This mean that in future version, it may cause an error instead of a 
simple warning.

"refraction" in the finish is a greatly deprecated caryover from version 
3.1 and earlier.
"ior" no longer have it's place in the finish and need to be moved to 
the interior block.

The solution is:
Remove any refraction from the finish.
If you have refraction with a value different than 1, use fade_color, 
fade_distance and fade_power in the interior block.

Move the ior to the intetrior block:
interior{ior 1.4}

Any object with a transparent, even partly transparent, pigment and an 
interior block defining an ior will always refract rays.

To have a single definition for both the texture and interior, you 
should use material:

#declare Acrylic= material{
	texture{
		pigment{White filter 0.9}
		finish{specular 1 roughness 0.005
			reflection{1 fresnel} conserve_energy
			ambient 0 diffuse 0
			}
		}
	interior{ior 1.4}
	}

Using variable, fresnel, reflection is much more realistic and 
convincing. Adding conserve_energy is also important to get convincing 
results.

Optionaly, you can add some dispersion to the refraction. Just add:
dispersion 1.01
to turn that feature on using the default dispersion_samples 7.

Recomended usage: Always start any user defined variable with an upper 
case letter.




Alain


Post a reply to this message

From: Cousin Ricky
Subject: Re: Parse warning on refraction
Date: 17 Jun 2013 18:05:00
Message: <web.51bf86d6201eece978641e0c0@news.povray.org>
"gharryh" <h.a### [at] harry-arendsnl> wrote:
> I have some texture defs that are using refraction.
> How should i rewrite these defs to please the render machine.
> [code]
> #declare acrylic =
> texture {
>     pigment { White filter .9}
>     finish {
>         specular 1
>         roughness .005
>         reflection .1
>         ambient 0
>         diffuse 0
>         refraction 1
>         ior 1.4
>     }
> }
> [/code]

This is very, very old syntax.  I don't even know what the refraction statement
means in this context, but this old post by C. Lipka suggests that nowadays it's
just dead code:

> - "refraction" is actually not necessary; it's just a relic from old times (I
> wonder where you got that from; it's not even mentioned in the online help
> anymore as far as I can tell). The amount of refracted light is nowadays
> controlled by the transmit & filter components of the pigment.
http://news.povray.org/povray.general/message/%3Cweb.49b8626c69fc1a9c801985dd0%40news.povray.org%3E/

The ior should be removed completely from the finish AND the texture, and put
inside an interior.  A texture and an interior may be combined in a material:

[code]
#declare Acrylic = material
{ texture {
      pigment { White filter .9}
      finish {
          specular 1
          roughness .005
          reflection .1
          ambient 0
          diffuse 0
       /* refraction 1  Remove these
          ior 1.4       two lines. */
      }
  }
  interior { ior 1.4 }
}
[/code]

To apply this to an object, use the material statement:

[code]
object { MyObject material { Acrylic } }
[/code]


Post a reply to this message

From: gharryh
Subject: Re: Parse warning on refraction
Date: 18 Jun 2013 06:00:01
Message: <web.51c02ea0201eece9520168c30@news.povray.org>
"Cousin Ricky" <rickysttATyahooDOTcom> wrote:
>
> To apply this to an object, use the material statement:
>
> [code]
> object { MyObject material { Acrylic } }
> [/code]

Just did that but got a error. I counted all the brackets but found no anomali.
{code]
union {  // Create a box with two rounded edges
    union {
        cylinder{<11,0,24><11,.1,24>1 }
        cylinder{<11,0,-24><11,.1,-24>1 }
        box{<11,0,25><-12,.1,-25> }
        box{<11,0,24><12,.1,-24> }
//    } texture { red_led }
      } material { red_led }
}
[/code]
with this as the material def:
[code]
#declare red_led = material {
    texture {
        pigment {Red filter .6}
        finish {
            specular .7
            roughness .02
//            refraction 1
//            ior 1.5
        }
    }
    interior{ior 1.5}
}
[/code]
The rror is this:
"L:\POV-Ray\Aandrijving\TextLabel.inc" line 23: Parse Error: No matching } in
'material', texture identifier found instead


Post a reply to this message

From: gharryh
Subject: Re: Parse warning on refraction
Date: 18 Jun 2013 06:00:02
Message: <web.51c02f33201eece9520168c30@news.povray.org>
"Cousin Ricky" <rickysttATyahooDOTcom> wrote:
>
> This is very, very old syntax.  I don't even know what the refraction statement
> means in this context, but this old post by C. Lipka suggests that nowadays it's
> just dead code:
>
I just started again using POV-Ray as i am a retaired engineer.
I had to update from version 3.1


Post a reply to this message

From: Stephen
Subject: Re: Parse warning on refraction
Date: 18 Jun 2013 06:36:19
Message: <51c03823$1@news.povray.org>
On 18/06/2013 10:55 AM, gharryh wrote:

> The rror is this:
> "L:\POV-Ray\Aandrijving\TextLabel.inc" line 23: Parse Error: No matching } in
> 'material', texture identifier found instead
>


Have you defined red_led as a texture, previously in your code?


-- 
Regards
     Stephen


Post a reply to this message

From: gharryh
Subject: Re: Parse warning on refraction
Date: 18 Jun 2013 16:00:01
Message: <web.51c0bb11201eece9520168c30@news.povray.org>
Stephen <mca### [at] aolcom> wrote:
> On 18/06/2013 10:55 AM, gharryh wrote:
>
> > The rror is this:
> > "L:\POV-Ray\Aandrijving\TextLabel.inc" line 23: Parse Error: No matching } in
> > 'material', texture identifier found instead
> >
>
>
> Have you defined red_led as a texture, previously in your code?
>
>
> --
> Regards
>      Stephen
No it even goes wrong on a simple object in a clean scene


Post a reply to this message

From: James Holsenback
Subject: Re: Parse warning on refraction
Date: 18 Jun 2013 17:31:22
Message: <51c0d1aa$1@news.povray.org>
On 06/18/2013 03:54 PM, gharryh wrote:
> Stephen <mca### [at] aolcom> wrote:
>> On 18/06/2013 10:55 AM, gharryh wrote:
>>
>>> The rror is this:
>>> "L:\POV-Ray\Aandrijving\TextLabel.inc" line 23: Parse Error: No matching } in
>>> 'material', texture identifier found instead
>>>
>>
>>
>> Have you defined red_led as a texture, previously in your code?
>>
>>
>> --
>> Regards
>>       Stephen
> No it even goes wrong on a simple object in a clean scene
>
>
>
well you're not giving us much context here! If TextLabel.inc is NOT 
huge perhaps you could post that rather than the snipets you've posted 
previously.


Post a reply to this message

From: Stephen
Subject: Re: Parse warning on refraction
Date: 18 Jun 2013 17:41:10
Message: <51c0d3f6$1@news.povray.org>
On 18/06/2013 8:54 PM, gharryh wrote:
> Stephen <mca### [at] aolcom> wrote:
>>
>> Have you defined red_led as a texture, previously in your code?
>>
>>
>>
> No it even goes wrong on a simple object in a clean scene
>
>
>
Oh dear! That is a shame.
Because I just rendered your code in a scene and it was fine.

-- 
Regards
     Stephen


Post a reply to this message

From: Alain
Subject: Re: Parse warning on refraction
Date: 18 Jun 2013 22:24:08
Message: <51c11648$1@news.povray.org>

> "Cousin Ricky" <rickysttATyahooDOTcom> wrote:
>>
>> This is very, very old syntax.  I don't even know what the refraction statement
>> means in this context, but this old post by C. Lipka suggests that nowadays it's
>> just dead code:
>>
> I just started again using POV-Ray as i am a retaired engineer.
> I had to update from version 3.1
>
>
>
>
That explain the outdated code.

Some hints of things that worked but may yeld unexpected results now:

clipped_by must NEVER be used in place of intersection or difference. It 
will cause some unexpected shadows abnomalies and some other problems.

Most of the time, you don't need any manual bounding. The exeption been 
of some intersections when the end shape is small compared to the 
component shapes.

The gradient pattern was on the absolute value, reversed on the negative 
side, now the ramp is always in the same direction.

If you used radiosity, maximum_distance no longer exist and will cause 
an error if present.

The old dual entries in color_map, texture_map,... is deprecated. It's 
still suported without problem.


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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