POV-Ray : Newsgroups : povray.newusers : emission penetration into glass Server Time
29 Oct 2024 22:45:10 EDT (-0400)
  emission penetration into glass (Message 1 to 4 of 4)  
From: Tomohiro
Subject: emission penetration into glass
Date: 14 Jun 2010 21:10:02
Message: <web.4c16d22d5a261937ad62c3830@news.povray.org>
I would like to build an image that a laser beam penetrates and
focused into a piece of glass. I tried to express the laser beam
as a transparent object with emission. The following is a source
code for that. Please try #declare GLASS=1 and GLASS=0 and compare
the images. The result has two problems:
1. Laser beam is hardly visible inside the glass, even if the part
   of laser beam of the glass is cut using CSG.
2. The usage of CSG gives a distinct outline of the beam, which looks
   strange.
Could you please tell me how to solve the problem?


#declare GLASS = 1;

camera{ location <15,20,-40> look_at <0,0,0> }
light_source{ <-50,200,-200> rgb<1,1,1> }
background{rgb 0.1}

#if (GLASS)
  difference{
    box{<-10,-5,-20>,<10,5,20>}
    cone{<0,50,0>,10.0001,<0,0,0>,0.0001}
    sphere{<0,0,0>,1 scale<4,8,4>}
    material{
      texture{
        pigment{color rgbt<.98, .98, .98, .9>}
        finish{ ambient 0.1 diffuse 0.1 reflection 0.2 specular 0.8 roughness
0.01 phong 1 phong_size 400}
      }
      interior{ior 1.03}
    }
  }
#end

union{
  cone{<0,50,0>,10,<0,0,0>,0
    pigment{color rgbf<1,1,1,1>}
    interior{media{ emission rgb<.2, .1, 0> }}
    hollow
  }
  sphere { <0,0,0>, 1
    pigment {color rgbf<1,1,1,1>}
    interior{media{ emission rgb<.2, .2, .2> density{spherical color_map{[0 rgb
0][0.5 rgb 1][1 rgb 3]}} }}
    hollow
    scale <4,8,4>
  }
}


Post a reply to this message

From: Christian Froeschlin
Subject: Re: emission penetration into glass
Date: 15 Jun 2010 05:17:38
Message: <4c174532$1@news.povray.org>
Tomohiro wrote:

> 1. Laser beam is hardly visible inside the glass, even if the part
>    of laser beam of the glass is cut using CSG.

This is caused by coincident surfaces of the cutout geometry
and the media containers. POV-Ray can't handle the case very
well when the scene contains two surfaces which exactly match,
even if that would best represent the real world geometry. So
you have to make the hole slightly larger (scale by 1.001).

Or do not cut out any hole at all, the reason you don't get
effect in that case is that you forgot to make the glass box
itself "hollow".

Some suggestions for the glass

o I'd use a fully clear pigment (rgbt 1) for the glass
   and remove ambient, diffuse from the finish.

o Also remove phong since you already use specular.

o Consider adding conserve_energy to the finish

o The ior is much too low for glass, it should be
   somewhere around 1.5. Although it may then no longer
   produce the type of image your looking for.

o You may need to increase max_trace_level, to do so
   add something like global_settings {max_trace_level 20}
   at the beginning of your scene file.

> 2. The usage of CSG gives a distinct outline of the beam, which looks
>    strange.

The problem is that there is no simple "conical" pattern which would
fall off in the way you need. You would need to define your own density
function based on the cone geometry. Alternatively, consider that a
laser should have a cylindrical shape anyway then you can use the
cylindrical pattern.


Post a reply to this message

From: Alain
Subject: Re: emission penetration into glass
Date: 15 Jun 2010 12:51:39
Message: <4c17af9b$1@news.povray.org>

> I would like to build an image that a laser beam penetrates and
> focused into a piece of glass. I tried to express the laser beam
> as a transparent object with emission. The following is a source
> code for that. Please try #declare GLASS=1 and GLASS=0 and compare
> the images. The result has two problems:
> 1. Laser beam is hardly visible inside the glass, even if the part
>     of laser beam of the glass is cut using CSG.
> 2. The usage of CSG gives a distinct outline of the beam, which looks
>     strange.
> Could you please tell me how to solve the problem?
>

Normaly, for a laser, I prefer to use a light_source with the parallel 
and cylinder attributes and use some scattering media to make it 
visible. Make sure that the "target" object is hollow so that it to will 
contain the media.

Then, do a photons scene.


Alain


Post a reply to this message

From: Tomohiro
Subject: Re: emission penetration into glass
Date: 20 Jun 2010 02:40:01
Message: <web.4c1db6b93459a719b15656eb0@news.povray.org>
Thank you very much for your help.

Christian Froeschlin <chr### [at] chrfrde> wrote:
> This is caused by coincident surfaces of the cutout geometry
> and the media containers. POV-Ray can't handle the case very
> well when the scene contains two surfaces which exactly match,
> even if that would best represent the real world geometry. So
> you have to make the hole slightly larger (scale by 1.001).

Unfortunately this did not work (my original code already has
this trick), but...

> Or do not cut out any hole at all, the reason you don't get
> effect in that case is that you forgot to make the glass box
> itself "hollow".

This worked very well.

> > 2. The usage of CSG gives a distinct outline of the beam, which looks
> >    strange.
>
> The problem is that there is no simple "conical" pattern which would
> fall off in the way you need. You would need to define your own density
> function based on the cone geometry. Alternatively, consider that a
> laser should have a cylindrical shape anyway then you can use the
> cylindrical pattern.

The laser consisted of two cones and one sphere (to express spark).
I enlarged very large sphere whose density is nonzero near the center.
This succeeded to remove the strange outline of the spark.


Post a reply to this message

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