POV-Ray : Newsgroups : povray.newusers : How to refract light sources properly? Server Time
31 Oct 2024 18:55:50 EDT (-0400)
  How to refract light sources properly? (Message 1 to 2 of 2)  
From: Chuck
Subject: How to refract light sources properly?
Date: 3 Feb 2013 16:00:01
Message: <web.510ece923fdcbd685dcec4c10@news.povray.org>
Hello,

I am quite new to Pov-ray, so maybe my question is a bit basic.

I am trying to model a LED torch and would like to add a lense. However, the
lense I managed to create distorts the physical objects depneding on the
refraction index -- but apparently not the light sources?!

i.e., the light sources are placed at the bases of seven cones (placed in the
main element) and shine towards a plane (just for testing). But the lense I
place above does not change the light path. But it 'works' to distort the
physical objects.

I switched photons on, assuming that they will find the right path through the
lense, but without success

The test code is available at:
https://gist.github.com/e63f56363ace292c6534#file-ledlense-pov

Cheers and many thanks for ideas,
  Thomas


Post a reply to this message

From: clipka
Subject: Re: How to refract light sources properly?
Date: 3 Feb 2013 17:33:36
Message: <510ee5c0@news.povray.org>
Am 03.02.2013 21:55, schrieb Chuck:
> Hello,
>
> I am quite new to Pov-ray, so maybe my question is a bit basic.
>
> I am trying to model a LED torch and would like to add a lense. However, the
> lense I managed to create distorts the physical objects depneding on the
> refraction index -- but apparently not the light sources?!
>
> i.e., the light sources are placed at the bases of seven cones (placed in the
> main element) and shine towards a plane (just for testing). But the lense I
> place above does not change the light path. But it 'works' to distort the
> physical objects.
>
> I switched photons on, assuming that they will find the right path through the
> lense, but without success

So far you have only designated a light source that should take part in 
caustics computations, but no "optically active" objects that you'd like 
to interact with that light.

You'll need to designate the lens as a "photon target". Do this using

object {
   Linse
   translate <0,50,0>
   texture{ T_Glass3 }
   interior{ I_Glass }
   photons {
     target
     refraction on
     reflection on
     collect off
   }
}

You should also do the same for the reflector.


This is done because in normal scenes the objects that cause caustics 
are comparatively small and far away from the light source: A glass of 
wine, a crystal ball, a vase, a precious stone - that sort of stuff. In 
such a scene, if POV-Ray would always shoot photons in all directions to 
see where they end up it would take ages to complete where classic 
backward raytracing would take just a few moments; so POV-Ray will only 
shoot photons in the direction of those objects which you tell it to 
(via the "target" keyword), and all other regions in the image will be 
computed with classic backward raytracing.


I'm not perfectly sure whether you also need a 
global_settings{photons{...}} block.


Post a reply to this message

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