POV-Ray : Newsgroups : povray.newusers : Parse warning on refraction Server Time
15 Jun 2024 00:07:41 EDT (-0400)
  Parse warning on refraction (Message 3 to 12 of 12)  
<<< Previous 2 Messages Goto Initial 10 Messages
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

From: Thomas de Groot
Subject: Re: Parse warning on refraction
Date: 19 Jun 2013 03:09:11
Message: <51c15917@news.povray.org>
On 18-6-2013 23:41, Stephen wrote:
> 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.
>

Which makes me guess - like Jim - that the problem resides within the 
TextLabel.inc file itself. Gharryh, I suppose you include this file into 
your main scene? In any case, examine the code around line 23 in the 
include file. Big chance that the missing } is found there. If not, 
experiment by adding  } successively at the end of each material block 
and render, starting with the end of the file and gradually shift it 
higher if the render works well. As soon as the render fails, you have 
found the area to examine closely. I often do it that way when in 
serious doubt.

Succes!

Thomas


Post a reply to this message

From: gharryh
Subject: Re: Parse warning on refraction
Date: 19 Jun 2013 12:45:01
Message: <web.51c1df4d201eece9520168c30@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:
> Which makes me guess - like Jim - that the problem resides within the
> TextLabel.inc file itself. Gharryh, I suppose you include this file into
> your main scene? In any case, examine the code around line 23 in the
> include file. Big chance that the missing } is found there. If not,
> experiment by adding  } successively at the end of each material block
> and render, starting with the end of the file and gradually shift it
> higher if the render works well. As soon as the render fails, you have
> found the area to examine closely. I often do it that way when in
> serious doubt.
>
> Succes!
>
> Thomas
Solved the problem by removing all the old textures from the origional file and
creating a new one and that solved the problem. This is the content of that
file:
[code]
//    POV-Ray version 3.7 Include File
//    File: MyMaterials.inc
//    Last updated: June 2013
//    Description: This file contains my material defenitions.

#ifndef(MyMaterials_Temp)

#declare MyMaterials_Temp = version;
#version 3.5;

#ifndef(__colors_inc)
#include "colors.inc"
#end

#declare MyRedLed = material {
    texture {
        pigment {Red filter .6}
        finish {
            specular .7
            roughness .02
        }
    }
    interior{ior 1.5}
}

#declare MyGreenLed = material {
    texture {
        pigment {Green filter .6}
        finish {
            specular .7
            roughness .02
        }
    }
    interior{ior 1.5}
}

#declare MyAcrylic = material {
    texture {
        pigment {Green filter .9}
        finish {
            specular 1
            roughness .005
            reflection .1
            ambient 0
            diffuse 0
        }
    }
    interior{ior 1.4}
}

#declare MyRedClearPlastic = material {
    texture {
        pigment {Red filter .8}
        finish {
            specular 1
            roughness .001
            reflection .1
        }
    }
    interior{ior 1.4}
}

#declare MyGreenClearPlastic = material {
    texture {
        pigment {Green filter .8}
        finish {
            specular 1
            roughness .001
            reflection .1
        }
    }
    interior{ior 1.4}
}
#version MyMaterials_Temp
#end
[/code]


Post a reply to this message

<<< Previous 2 Messages Goto Initial 10 Messages

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