POV-Ray : Newsgroups : povray.general : Overlaping objects with different ior values : Re: Overlaping objects with different ior values Server Time
6 Aug 2024 06:13:48 EDT (-0400)
  Re: Overlaping objects with different ior values  
From: Christopher James Huff
Date: 22 Jul 2002 12:37:45
Message: <chrishuff-CD7B74.11304922072002@netplex.aussie.org>
In article <3d3b1cf6@news.povray.org>, Micha Riser <mri### [at] gmxnet> 
wrote:

> The reason why I came up with this question was that I am writing my own 
> little ray-tracer and have to find a way to handle refraction with csgs.

Well, the method I'm considering with my own raytracer is to just forbid 
overlapping transparent objects. After a ray enters a shape, the tracer 
will only test against that shape until it exits again. Things will be 
arranged so that each shape only has one material, so it won't enter 
through a surface with one material and exit through one with a 
different material. Non-refracting objects would be exempt from this, it 
would be very undesireable for media containers.

One potential problem: exiting into the interior of a shape that is 
overlapping. I'll probably just ignore this condition, it would be 
impossible to say which object it entered into when several are 
overlapping. It would be possible to check this condition, just check 
the exit point to see if it is inside any other object, but that would 
slow things down. Maybe for a scene debugging mode...

Another odd little trick I've been wanting to try: normally, when you 
hit a surface like glass, you have to trace a refracted ray and a 
reflected ray. With many transparent objects, this can create a lot of 
rays very quickly.
The trick would be to randomly choose refraction or reflection. The rays 
would never "branch", they would just take a random path through all the 
possible paths. You would then take several samples for each pixel, each 
sample would take a different path and you would get a fair 
approximation for the pixel without tracing every single ray. I have no 
idea how well this would actually work, but it seems like an interesting 
idea.

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

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