POV-Ray : Newsgroups : povray.newusers : Re: Can't get glass to look right Server Time
26 Nov 2024 01:46:32 EST (-0500)
  Re: Can't get glass to look right (Message 1 to 3 of 3)  
From: Captain Chemistry
Subject: Re: Can't get glass to look right
Date: 26 Nov 2004 16:35:00
Message: <web.41a7a0161bf351e2290632e60@news.povray.org>
MAX TRACE LEVEL is the key!

Cheap explanation:
Pov returns a black color for every ray that DOES NOT hit some solid object
after it bounces around max_trace_level number of times (eg 5 times) and
THAT is why the ball is opaque. Jaime Vives Piqueres has a file called
"glasswater.pov" on the "Persistance of Ignorance" site www.ignorancia.org
and that helped me immensely.

It's default is 5
Set it to something insanely high like 64 and you'll be laughing!

Check it out:

#version 3.6;
global_settings{assumed_gamma 1.8 max_trace_level 64}

#include "colors.inc"
#include "textures.inc"
#include "glass.inc"
#include "metals.inc"
#include "golds.inc"
#include "stones.inc"
#include "woods.inc"
#include "shapes.inc"
#include "shapes2.inc"
#include "functions.inc"
#include "math.inc"
#include "transforms.inc"

#declare r=10;
#declare rot=<50,-10,0>;
camera
{
 angle 40
 location<0,0,-r>
 rotate rot
 look_at<0,1.8,0>
 right (image_width/image_height)*x
}

//light_source{<15,25,-25> rgb 1 area_light 3*x 3*z 4 4}
light_source{<15,25,-25> rgb 1}

plane
{
 y 0
 pigment
 {
  //rgb 1
  checker rgb 1 rgb 0
 }
}

#declare tex=texture{pigment{rgb<1,0,0>}finish{specular 0.8 roughness 0.07
reflection 0.3}}


merge
{
 difference
 {
  cone{<0,0,0>0.8<0,1,0>0.3}
  cone{<0,-0.01,0>0.7<0,1.01,0>0.2}
 }
 torus{0.75 0.05 clipped_by{plane{y 0}}}

 lathe
 {
  cubic_spline
  5 <1.0,-0.3> <0.3,0><0.2,0.8><0.3,1.5> <0.5,2>
  translate<0,1,0>
 }

 merge
 {
  difference
  {
   sphere{0 1}
   sphere{0 0.9}
   plane{-y 0}
  }
  torus{0.95 0.05}
  difference
  {
   sphere{0 0.9001}
   plane{-y,0.25}
   material{texture{pigment{rgbf<1,0.6,0,0.9>}finish{ambient 3 reflection
0.2}}interior{ior 1.3}}
  }
  scale<1,1.6,1>
  translate<0,4,0>
 }


 //texture{tex}
 material
 {
  texture{pigment{rgbf<1,1,1,0.9>}finish{specular 1 roughness 0.03}}
  interior{ior 1.5}
 }
 translate<0,0.05,0>
}

Just cut and paste and THEN make sense of it.

Captain


Post a reply to this message

From: Oleguer Vilella
Subject: Re: Can't get glass to look right
Date: 26 Nov 2004 17:04:06
Message: <41a7a856@news.povray.org>
Not sure if it's the thingh that you want...
The code is:
======================================
#version 3.6;
global_settings{assumed_gamma 1.5 max_trace_level 10}

#include "colors.inc"
#include "textures.inc"
#include "glass.inc"
#include "metals.inc"
#include "golds.inc"
#include "stones.inc"
#include "woods.inc"
#include "shapes.inc"
#include "shapes2.inc"
#include "functions.inc"
#include "math.inc"
#include "transforms.inc"

#declare r=10;
#declare rot=<50,-10,0>;
camera
{
 angle 40
 location<0,0,-r>
 rotate rot
 look_at<0,1.8,0>
 right (image_width/image_height)*x
}

//light_source{<15,25,-25> rgb 1 area_light 3*x 3*z 4 4}
light_source{<15,25,-25> rgb 1}

plane
{
 y 0
 pigment
 {
  //rgb 1
  checker rgb 1 rgb 0
 }
}

#declare tex=texture{pigment{rgb<1,0,0>}finish{specular 0.8 roughness 0.02
reflection 0.1}}


merge
{
 difference
 {
  cone{<0,0,0>0.8<0,1,0>0.3}
  cone{<0,-0.01,0>0.7<0,1.01,0>0.2}
 }
 torus{0.75 0.05 clipped_by{plane{y 0}}}

 lathe
 {
  cubic_spline
  5 <1.0,-0.3> <0.3,0><0.2,0.8><0.3,1.5> <0.5,2>
  translate<0,1,0>
 }

 merge
 {
  difference
  {
   sphere{0 1}
   sphere{0 0.9}
   plane{-y 0}
  }
  torus{0.95 0.05}
  difference
  {
   sphere{0 0.9001}
   plane{-y,0.25}
   material{texture{pigment{rgbf<1,0.6,0,0.9>}finish{ambient 3 reflection
0.2}}interior{ior 1.3}}
  }
  scale<1,1.6,1>
  translate<0,4,0>
 }


 //texture{tex}
 material
 {
  texture{pigment{rgbf<1,1,1,0.9>}finish{specular 0.2 roughness 0.03}}
  interior{ior 1.3 }
 }
 translate<0,0.05,0>
}
=======================================
Now is transparent and you can see the checker through the glass.

Best regards,
Oleguer



news:web.41a7a0161bf351e2290632e60@news.povray.org...
> MAX TRACE LEVEL is the key!
>
> Cheap explanation:
> Pov returns a black color for every ray that DOES NOT hit some solid
object
> after it bounces around max_trace_level number of times (eg 5 times) and
> THAT is why the ball is opaque. Jaime Vives Piqueres has a file called
> "glasswater.pov" on the "Persistance of Ignorance" site www.ignorancia.org
> and that helped me immensely.
>
> It's default is 5
> Set it to something insanely high like 64 and you'll be laughing!
>
> Check it out:
>
> #version 3.6;
> global_settings{assumed_gamma 1.8 max_trace_level 64}
>
> #include "colors.inc"
> #include "textures.inc"
> #include "glass.inc"
> #include "metals.inc"
> #include "golds.inc"
> #include "stones.inc"
> #include "woods.inc"
> #include "shapes.inc"
> #include "shapes2.inc"
> #include "functions.inc"
> #include "math.inc"
> #include "transforms.inc"
>
> #declare r=10;
> #declare rot=<50,-10,0>;
> camera
> {
>  angle 40
>  location<0,0,-r>
>  rotate rot
>  look_at<0,1.8,0>
>  right (image_width/image_height)*x
> }
>
> //light_source{<15,25,-25> rgb 1 area_light 3*x 3*z 4 4}
> light_source{<15,25,-25> rgb 1}
>
> plane
> {
>  y 0
>  pigment
>  {
>   //rgb 1
>   checker rgb 1 rgb 0
>  }
> }
>
> #declare tex=texture{pigment{rgb<1,0,0>}finish{specular 0.8 roughness 0.07
> reflection 0.3}}
>
>
> merge
> {
>  difference
>  {
>   cone{<0,0,0>0.8<0,1,0>0.3}
>   cone{<0,-0.01,0>0.7<0,1.01,0>0.2}
>  }
>  torus{0.75 0.05 clipped_by{plane{y 0}}}
>
>  lathe
>  {
>   cubic_spline
>   5 <1.0,-0.3> <0.3,0><0.2,0.8><0.3,1.5> <0.5,2>
>   translate<0,1,0>
>  }
>
>  merge
>  {
>   difference
>   {
>    sphere{0 1}
>    sphere{0 0.9}
>    plane{-y 0}
>   }
>   torus{0.95 0.05}
>   difference
>   {
>    sphere{0 0.9001}
>    plane{-y,0.25}
>    material{texture{pigment{rgbf<1,0.6,0,0.9>}finish{ambient 3 reflection
> 0.2}}interior{ior 1.3}}
>   }
>   scale<1,1.6,1>
>   translate<0,4,0>
>  }
>
>
>  //texture{tex}
>  material
>  {
>   texture{pigment{rgbf<1,1,1,0.9>}finish{specular 1 roughness 0.03}}
>   interior{ior 1.5}
>  }
>  translate<0,0.05,0>
> }
>
> Just cut and paste and THEN make sense of it.
>
> Captain
>
>
>


Post a reply to this message

From: Warp
Subject: Re: Can't get glass to look right
Date: 27 Nov 2004 08:34:11
Message: <41a88253@news.povray.org>
Captain Chemistry <njj### [at] studentmonasheduau> wrote:
> MAX TRACE LEVEL is the key!

  Well, the questions and tips in the documentation would have told
you the same thing...

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

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