is it just me, or does mantra not handle refraction very well?
a simple example:
take a sphere and put another sphere inside it roughly half the size.
give each sphere its own glass shader (vex glass).
zero out the specular(s) so you can see what's going on better.
add a plane with some kind of pattern (checks or somethign).
leave the ior alone for now (1.2 default, i think)
render it.
you'll see two levels of distortion – one inside the other. but that is incorrect, unless i'm insane. going from a material of 1.2 ior to another material of 1.2 ior should not alter the path of the ray of light – it should continue in a straight line, shouldn't it? ior is a relative thing.
i'm also somewhat suspicious of the ray exit math, as i seem to be getting a ponderously large amount of total internal refraction from things like spheres with modest ior's (like 1.2). i'm conerned that rather than the ray “unbending” on exit, it's getting the same bend it got when it first hit the glass sphere.
can anybody confirm this?
index of refraction
3636 1 1-
- fathomgames
- Member
- 3 posts
- Joined: Sept. 2006
- Offline
-
- wolfwood
- Member
- 4363 posts
- Joined: July 2005
- Offline
There is a good thread on glass Glass [od] [odforce.net]
(I might be wrong and Mario will beat me when he arrives….but I'll try to answer anyways)
Index of refraction is the exit medium's IOR relative to the entry medium's IOR. Assuming your ray is entering the glass sphere from the air then your ratio would be ~1/1.2 (the ratio calculation occurs in the shader). Now the problem that you are having is that when a refracted ray hits the second sphere its IOR ratio is computed as 1/1.2 although technically it should be 1.2/1.2. To fix your problem just set your inner sphere's IOR to be 1.
you'll see two levels of distortion – one inside the other. but that is incorrect, unless i'm insane. going from a material of 1.2 ior to another material of 1.2 ior should not alter the path of the ray of light – it should continue in a straight line, shouldn't it? ior is a relative thing.
(I might be wrong and Mario will beat me when he arrives….but I'll try to answer anyways)
Index of refraction is the exit medium's IOR relative to the entry medium's IOR. Assuming your ray is entering the glass sphere from the air then your ratio would be ~1/1.2 (the ratio calculation occurs in the shader). Now the problem that you are having is that when a refracted ray hits the second sphere its IOR ratio is computed as 1/1.2 although technically it should be 1.2/1.2. To fix your problem just set your inner sphere's IOR to be 1.
if(coffees<2,round(float),float)
-
- Quick Links

