 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I might ramble here, but anyway...
Just thinking about variable IOR today, and I reread the section of the
VFAQ on it. Basically, by specifying variable IOR as a property of
media, the density of the media could be used to vary the IOR. By
supersampling the media enough, it should be possible to get decently
accurate images (even though they may take days or weeks to render {but,
this has never stopped POVers before, has it?}). It should be even
possible to get a more or less accurate derivative of the density
function, and guess the correct length for the next ray segment.
Anyway, however slow it is (again - has slowness ever stopped POVers
before?), does anyone else think it might be time to try it out? Used
properly, this would allow some great effects. Mostly, I'm thinking of
subtle heat shimmers in landscape scenes - but I'm sure there are others.
...Chambers
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Chambers wrote:
> I might ramble here, but anyway...
>
> Just thinking about variable IOR today, and I reread the section of the
> VFAQ on it.
To be frank - if you have read the VFAQ and still think variable IOR
would make sense in raytracing you probably either have not read it
thoroughly or did not fully understand it.
The explanation mentions media to illustrate the approach necessary to
try simulating variable IOR but makes it very clear and explains why the
results would be completely dissatisfying. While scattering media has
an inherent smoothing effect - small features as well as errors in the
simulation are smoothed out - refraction of light has not!
This is a property of the underlying mathematical equations describing
the physical effects and therefore you can't overcome this by more
intelligent simulation techniques.
And if you don't believe this you can easily test it yourself BTW - the
VFAQ mentions how: Replace your single object with a lot of smaller
ones with slightly different IOR. This will give you a realistic
impression of the quality of results and the rendering speed of such a
simulation.
Christoph
--
POV-Ray tutorials, include files, Landscape of the week:
http://www.imagico.de/ (Last updated 31 Oct. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Chambers nous apporta ses lumieres en ce 10/02/2006 20:29:
> I might ramble here, but anyway...
>
> Just thinking about variable IOR today, and I reread the section of the
> VFAQ on it. Basically, by specifying variable IOR as a property of
> media, the density of the media could be used to vary the IOR. By
> supersampling the media enough, it should be possible to get decently
> accurate images (even though they may take days or weeks to render {but,
> this has never stopped POVers before, has it?}). It should be even
> possible to get a more or less accurate derivative of the density
> function, and guess the correct length for the next ray segment.
>
> Anyway, however slow it is (again - has slowness ever stopped POVers
> before?), does anyone else think it might be time to try it out? Used
> properly, this would allow some great effects. Mostly, I'm thinking of
> subtle heat shimmers in landscape scenes - but I'm sure there are others.
>
> ...Chambers
You may try simulating that using merged, nested objects with progressively higher
iors. You need to
crank up the max_trace_level. You will get discontinuitys.
The best aproach is to modulate the curvature of the object or use normal
manipulation. Progressive
glasses use exactly that thecnique: the curve is NOT constant! The inside of the lense
get flater
over the area with higher strenght. You need an isosurface to acheive that.
In fact, you ONLY encounter intentional man-made variable ior in fiber optiques. In
nature, you find
it in the athmosphere and in heat induced turbulence in water and air (like in and
over a flame).
--
Alain
-------------------------------------------------
But I thought YOU did the backups...
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
IMHO, would it not be possible to simulate a sphere of continually
increasing ior towards its centre? If a ray intersects the sphere close to
90 degrees to the normal the ior is low because the air is very thin on the
outside. As the angle of intersection gets closer to the circle's normal the
ior increases because going towards the centre the ior increases. I think
this would be the first step in the right direction.
-Nekar Xenos-
--
The truth is out there...
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Nekar Xenos <go_### [at] yahoo com> wrote:
> IMHO, would it not be possible to simulate a sphere of continually
> increasing ior towards its centre? If a ray intersects the sphere close to
> 90 degrees to the normal the ior is low because the air is very thin on the
> outside. As the angle of intersection gets closer to the circle's normal the
> ior increases because going towards the centre the ior increases. I think
> this would be the first step in the right direction.
If there is an object inside that sphere, how would you calculate where
this curved line intersects that object?
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Warp" <war### [at] tag povray org> wrote in message
news:43fb7e4b@news.povray.org...
> If there is an object inside that sphere, how would you calculate where
> this curved line intersects that object?
>
How about taking the ray on a circular path in one direction as the ior goes
up and changing the direction when the ior goes down resulting in an
s-shaped path.
-Nekar Xenos-
--
"The truth is out there..."
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Nekar Xenos <go_### [at] yahoo com> wrote:
> > If there is an object inside that sphere, how would you calculate where
> > this curved line intersects that object?
> How about taking the ray on a circular path in one direction as the ior goes
> up and changing the direction when the ior goes down resulting in an
> s-shaped path.
What? Did you even understand my question?
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Warp" <war### [at] tag povray org> wrote in message
news:44002edb@news.povray.org...
> Nekar Xenos <go_### [at] yahoo com> wrote:
>> > If there is an object inside that sphere, how would you calculate
>> > where
>> > this curved line intersects that object?
>
>> How about taking the ray on a circular path in one direction as the ior
>> goes
>> up and changing the direction when the ior goes down resulting in an
>> s-shaped path.
>
> What? Did you even understand my question?
>
> --
> - Warp
I meant to replace my intitial suggestion with the second one. Is it not
possible to test intersection of a circle with an object? Please excuse me,
but I (obviosly)don't know how a raytracer is programmed. How is
intersection of a straight ray done? I was thinking of just replacing the
formula for the straight ray with the formula of a circle.
--
-Nekar Xenos-
----------------------------------------
"The truth is out there..."
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Nekar Xenos <go_### [at] yahoo com> wrote:
> I meant to replace my intitial suggestion with the second one. Is it not
> possible to test intersection of a circle with an object? Please excuse me,
> but I (obviosly)don't know how a raytracer is programmed. How is
> intersection of a straight ray done? I was thinking of just replacing the
> formula for the straight ray with the formula of a circle.
How would a ray travelling in a circular path be any feasible way of
emulating variable ior? I'm not even sure it's physically possible to
have an object with an ior such that light travels in a circular path
through it regardless of the direction.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp nous apporta ses lumieres en ce 25/02/2006 06:50:
> Nekar Xenos <go_### [at] yahoo com> wrote:
>
>>I meant to replace my intitial suggestion with the second one. Is it not
>>possible to test intersection of a circle with an object? Please excuse me,
>>but I (obviosly)don't know how a raytracer is programmed. How is
>>intersection of a straight ray done? I was thinking of just replacing the
>>formula for the straight ray with the formula of a circle.
>
>
> How would a ray travelling in a circular path be any feasible way of
> emulating variable ior? I'm not even sure it's physically possible to
> have an object with an ior such that light travels in a circular path
> through it regardless of the direction.
>
Gravity lense, in any direction not directly aimed at it's center. As those don't have
a deffinite
center (each constituent object been a "center"), ray's paths looks rather like a
drunken man path.
Note to self: I need to create such a lense in POV-Ray one day.
--
Alain
-------------------------------------------------
After any salary raise, you will have less money at the end of the month than you did
before.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Alain <ele### [at] netscape net> wrote:
> Gravity lense, in any direction not directly aimed at it's center.
Except that gravity does not make anything go in a circular path except
in very exceptional circumstances (which in case of light could happen
only at a certain distance from a black hole).
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <4400447f@news.povray.org>, war### [at] tag povray org says...
> Nekar Xenos <go_### [at] yahoo com> wrote:
> > I meant to replace my intitial suggestion with the second one. Is it not
> > possible to test intersection of a circle with an object? Please excuse me,
> > but I (obviosly)don't know how a raytracer is programmed. How is
> > intersection of a straight ray done? I was thinking of just replacing the
> > formula for the straight ray with the formula of a circle.
>
> How would a ray travelling in a circular path be any feasible way of
> emulating variable ior? I'm not even sure it's physically possible to
> have an object with an ior such that light travels in a circular path
> through it regardless of the direction.
>
Now... A Spline Path could work though, maybe? I mean your basically just
doing the same thing you do with any object, make a determination of
where it is likely to intersect. I am sure you could find some averaging
function to determine where the bounding box intersection is for a
"straight" line that would hit the same point. As well as something to
find the final "direction". If no other objects are intersected, you just
continue the ray from that final point on the surface of the object. If
intersection tests of a bounding box for something inside is detected,
then you calculate along the spline path, until you hit. When it leaves
the interior of the object you stop doing the extra calculations and
continue on a normal strait path.
Or something more or less like that. The only real question is, given an
object, can you determine an averaged IOR for the ray and a final
direction, allowing you to shortcut the calculations when no
intersections are possible. Of course, I don't know how media might be
effected by such a thing...
--
void main () {
If Schrödingers_cat is alive
call functional_code()
else
call crash_windows();
}
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Patrick Elliott <sha### [at] hotmail com> wrote:
> Now... A Spline Path could work though, maybe?
And sampling along a spline (iow. splitting the spline into very small
parts and making a whole ray-scene intersection test for each small part)
is exactly what would make it prohibitively slow.
Would it really be worth the effort?
Radiosity requires lots of sampling, but the results can be spectacular.
Media also requires lots of sampling, but the results can also be quite
spectacular. Variable IOR would probably require even more sampling, yet
I highly doubt the end result will look any spectacular.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Warp" <war### [at] tag povray org> wrote in message
news:44014e05@news.povray.org...
> Patrick Elliott <sha### [at] hotmail com> wrote:
>> Now... A Spline Path could work though, maybe?
>
> And sampling along a spline (iow. splitting the spline into very small
> parts and making a whole ray-scene intersection test for each small part)
> is exactly what would make it prohibitively slow.
> Would it really be worth the effort?
>
> Radiosity requires lots of sampling, but the results can be spectacular.
> Media also requires lots of sampling, but the results can also be quite
> spectacular. Variable IOR would probably require even more sampling, yet
> I highly doubt the end result will look any spectacular.
>
> --
> - Warp
Heat haze, bullet trails and sunsets can all be quite spectacular. I tried
doing a planetary scene coming in from outer space and landing on the
planet. I got double sun mirages at stages, maybe variable ior could have
fixed it?
--
-Nekar Xenos-
----------------------------------------
"The truth is out there..."
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Among other things, Warp saw fit to write:
> And sampling along a spline (iow. splitting the spline into very small
> parts and making a whole ray-scene intersection test for each small part)
> is exactly what would make it prohibitively slow.
> Would it really be worth the effort?
>
> Radiosity requires lots of sampling, but the results can be spectacular.
> Media also requires lots of sampling, but the results can also be quite
> spectacular. Variable IOR would probably require even more sampling, yet
> I highly doubt the end result will look any spectacular.
Could it maybe be "faked" in some way, similarly to how the caustics keyword
fakes photons?
I'm not sure what kind of effect it would give, I'm just throwing some white
noise into the discussion :-)
--
light_source{9+9*x,1}camera{orthographic look_at(1-y)/4angle 30location
9/4-z*4}light_source{-9*z,1}union{box{.9-z.1+x clipped_by{plane{2+y-4*x
0}}}box{z-y-.1.1+z}box{-.1.1+x}box{.1z-.1}pigment{rgb<.8.2,1>}}//Jellby
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <44014e05@news.povray.org>, war### [at] tag povray org says...
> Patrick Elliott <sha### [at] hotmail com> wrote:
> > Now... A Spline Path could work though, maybe?
>
> And sampling along a spline (iow. splitting the spline into very small
> parts and making a whole ray-scene intersection test for each small part)
> is exactly what would make it prohibitively slow.
> Would it really be worth the effort?
>
But, is it actually slower than for a regular line? I mean, sure, the
calculation may require a few more math steps, but intersections still
require the same sort of testing, even for a straight line right? Maybe I
am wrong.
> Radiosity requires lots of sampling, but the results can be spectacular.
> Media also requires lots of sampling, but the results can also be quite
> spectacular. Variable IOR would probably require even more sampling, yet
> I highly doubt the end result will look any spectacular.
>
Depends. What about an object where the variable IOR is based on a
pattern, similar to what you can do with media? Right now you can't even
simulate that, at least unless you wanted to glue together hundreds of
discrete objects, all approximate shapes and all with different IORs. We
really can't be sure what effect would result, without trying it. And for
that matter, from what I understand, there are real world materials that
actually have a "different" IOR depending on the angle of incidence of
the light hitting it (I think I remember reading about some anyway).
--
void main () {
If Schrödingers_cat is alive
call functional_code()
else
call crash_windows();
}
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <l2l### [at] badulaque unex es>, me### [at] privacy net says...
> Among other things, Warp saw fit to write:
>
> > And sampling along a spline (iow. splitting the spline into very small
> > parts and making a whole ray-scene intersection test for each small part)
> > is exactly what would make it prohibitively slow.
> > Would it really be worth the effort?
> >
> > Radiosity requires lots of sampling, but the results can be spectacular.
> > Media also requires lots of sampling, but the results can also be quite
> > spectacular. Variable IOR would probably require even more sampling, yet
> > I highly doubt the end result will look any spectacular.
>
> Could it maybe be "faked" in some way, similarly to how the caustics keyword
> fakes photons?
>
> I'm not sure what kind of effect it would give, I'm just throwing some white
> noise into the discussion :-)
>
Well, as I pointed out in a reply, yeah, for some cases, others, like a
complex pattern based IOR would be either impossible or prohibitively
complex to manage, nor could any simulation deal with materials with odd
properties, like IOR differing by the angle light enters.
--
void main () {
If Schrödingers_cat is alive
call functional_code()
else
call crash_windows();
}
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Patrick Elliott <sha### [at] hotmail com> wrote:
> But, is it actually slower than for a regular line? I mean, sure, the
> calculation may require a few more math steps, but intersections still
> require the same sort of testing, even for a straight line right? Maybe I
> am wrong.
You have to test a straight line against the scene once. A spline would
have to be tested hundreds or thousands of times.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> Radiosity requires lots of sampling, but the results can be spectacular.
> Media also requires lots of sampling, but the results can also be quite
> spectacular. Variable IOR would probably require even more sampling, yet
> I highly doubt the end result will look any spectacular.
This is probably the best argument against it I've heard. I'm sure
someone will eventually write a patch to do it, and we'll see at that
point whether your argument is justified.
Personally, I think that if used well, it could aid in realism the same
way that radiosity, focal blur, et al can - that is, when the viewer
doesn't realize that the effect is there, that's when it has the
greatest benefit.
...Chambers
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp nous apporta ses lumieres en ce 27/02/2006 01:09:
> Patrick Elliott <sha### [at] hotmail com> wrote:
>
>>But, is it actually slower than for a regular line? I mean, sure, the
>>calculation may require a few more math steps, but intersections still
>>require the same sort of testing, even for a straight line right? Maybe I
>>am wrong.
>
>
> You have to test a straight line against the scene once. A spline would
> have to be tested hundreds or thousands of times.
>
You'd need some spacing for the tests. To small and it takes for ever. To large and
you can go right
trough several objects. Then, it a test get inside an object, take a new point between
the last and
next to last, test again until you reach a sufficient confidence value.
It will take very long if you only have simple primitives, and now the fun beggin when
you add
torus, superellipsoids, sphere_sweeps and the nightmare is on you as soon as you add
some
isosurfaces. And you *think* that radiosity with photons, scathering media,
reflections and
transparcy, togheter with many area_lights, and area_light photons make for long
render time? Does
anybody have a cluster of 100GHz computers at hand?
--
Alain
-------------------------------------------------
REMEMBER: WHATEVER HAPPENS, HAPPENS FOR A REASON.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Jellby" <me### [at] privacy net> wrote in message
news:l2l### [at] badulaque unex es...
> Could it maybe be "faked" in some way, similarly to how the caustics
> keyword
> fakes photons?
>
The Pov Reference Manual says under "Language Things that don't work as one
expects":
"
"Can I specify variable IOR for an object? Is there any patch that can do
this? Is it possible?"
Short answer: No.
Long answer:
There are basically two ways of defining variable IOR for an object: IOR
changing on the surface of the object and IOR changing throughout inside the
object.
The first one is physically incorrect. For uniform IOR it simulates physical
IOR quite correctly since for objects with uniform density the light bends
at the surface of the object and nowhere else. However if the density of the
object is not uniform but changes throughout its volume, the light will bend
inside the object, while travelling through it, not only on the surface of
the object.
This is why variable IOR on the surface of the object is incorrect and the
possibility of making this was removed in POV-Ray 3.1. "
I wonder why they kept faked caustics in Pov-Ray when we have photons that
can do it better, and took out surface variable ior leaving us with no
replacement.
--
-Nekar Xenos-
----------------------------------------
"The truth is out there..."
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Nekar Xenos nous apporta ses lumieres en ce 01/03/2006 10:40:
> I wonder why they kept faked caustics in Pov-Ray when we have photons that
> can do it better, and took out surface variable ior leaving us with no
> replacement.
>
>
Faked caustics are way faster and good enough in many situations. A prime example been
the light
play on the bottom of a water body.
--
Alain
-------------------------------------------------
'I can resist anything but temptation.'
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
We've all been thinking along the lines of doing it with a statement similar
to media which is very complex. How about something simpler, like
fade_colour? If the ior gets denser at a specific rate like fade_colour
does, will this not make it more feasable to do?
--
-Nekar Xenos-
----------------------------------------
"The truth is out there..."
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Nekar Xenos" <go_### [at] yahoo com> wrote:
> We've all been thinking along the lines of doing it with a statement similar
> to media which is very complex. How about something simpler, like
> fade_colour? If the ior gets denser at a specific rate like fade_colour
> does, will this not make it more feasable to do?
>
>
> --
> -Nekar Xenos-
> ----------------------------------------
> "The truth is out there..."
The effect of a changing ior is not so much affected by the rate of change
of its value, but its change relative to the direction of travel of the
light ray. In order for it to affect the direction, it needs to interact
with a change in iro along a surface not perpendicular to its line of
travel. So this would require, not only discrete sampling to determine the
ior along the light path, but also some sort of adaptive sampling to
determine an effective angle of incidence for the change in ior. This
would not be entrely impossible, however, it would significantly increase
the calculations and overead involved and probably not give significantly
noticeable results versus what could be faked much more easily.
-tgq
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |