The projected image of the ipad is more visible on the floor than I expected. |
Monday, July 20, 2015
Glass spheres in a ray tracer
In an earlier post I was wondering whether the image projected on the floor was a bug. I got a dielectric sphere from Amazon and just set up a ugly ducking Cornell Box made out of foam-core. Apparently, spheres are more effective lenses than I realized and it is probably not a bug.
I'll be doing a more full spectral validation of my renderer this week. It's fun in an artsy crafty first grade maker movement kind of way!
Sunday, July 19, 2015
Real Utah teapots
The "Utah teapot" is an iconic 3D graphics model made by hand measurement of Martin Newell's teapot in 1975 so it is now a 40 year old model! It became so popular mainly because Utah distributed it on the internet (Utah was the 4th site on the ArpaNet so they were already used to it) and so it was the only model most people had for some time. The real teapot is on display in Mountain View and details can be found at wikipedia. Because the teapot was manufactured, you can get one of its cousins. They are occassionally for sale on ebay and come in two sizes, as this screenshot from an ebay listing at the time of this writing shows shows (it is selling the big one for $119 and searching for "Melitta Teapot" will show various types including some of the right shape when you are lucky):
I am guessing the smaller teapot is the size of the "real" teapot but I don't know (Newell was a married grad student at the time, and it was pre-Grande size drinks).
Here's the one I own, with some money for scale:
My real agenda for this post is to ask who has the best model for the teapot? The classic one is not solid and I know many people have done solid models, but I don't know where to get them.
I am guessing the smaller teapot is the size of the "real" teapot but I don't know (Newell was a married grad student at the time, and it was pre-Grande size drinks).
Here's the one I own, with some money for scale:
My real agenda for this post is to ask who has the best model for the teapot? The classic one is not solid and I know many people have done solid models, but I don't know where to get them.
Friday, July 10, 2015
When you see diffuse inter-reflection
Of course we see diffuse inter-reflection all the time in painted rooms, but mainly it makes them have a big "ambient" more or less, and it's hard to tell what is there. Games like Mirror's Edge made isolated effects more obvious by cranking up the effect both by model design and by multiplication. If you want to crank it up in model design, I saw a good real world juxtaposition today about 100 meters apart with the same overall environmental lighting.
On the left there is surely a big "splash" of indirect light at the base of the container. But there are several things working against it:
On the left there is surely a big "splash" of indirect light at the base of the container. But there are several things working against it:
- The container's albedo is pretty low (I would guess 25%)
- There is no hue to the container
- There is almost as much direct lighting hitting the pavement (Sun angle around 30 degrees)
- MUCH more direct sunlight hitting the yellow object (Sun directions almost tangent to wall)
- Hue contrast of indirect illuminator
- Indirect illuminator has relatively high albedo (it may in fact be fluorescent)
Monday, July 6, 2015
Slightly simplified Cornell Box data
I just put my new renderer through the Cornell Box test using this data from the Cornell lab. I didn't want to type in all those numbers for the boxes, nor deal with the slightly wonky walls that aren't necessarily planar (the real walls aren't). So here is my geometry for it (in millimeters like the Cornell measurements):
Box itself: (0,0,0) to (555,555,555)
Small block: (0,0,0) to (165,165,165), rotate around Y -0.314 radians, move (130,0,65)
Big block: (0,0,0) to (165,330,165), rotate around Y +0.3925 radians, move (265,0,295)
For fun I made the materials of the block glass and copper. I used the metal Fresnel equations from this very nice post by S Legarde.
This is still brute force so the rays just have to be lucky enough to hit the light (100k initial rays per pixel)
Box itself: (0,0,0) to (555,555,555)
Small block: (0,0,0) to (165,165,165), rotate around Y -0.314 radians, move (130,0,65)
Big block: (0,0,0) to (165,330,165), rotate around Y +0.3925 radians, move (265,0,295)
For fun I made the materials of the block glass and copper. I used the metal Fresnel equations from this very nice post by S Legarde.
This is still brute force so the rays just have to be lucky enough to hit the light (100k initial rays per pixel)
Friday, July 3, 2015
Debugging refraction in a ray tracer
That picture I suspected had a refraction bug did. It's always hard to tell-- that is one reason refraction hack can work so well. I found a good debugging case so I will share.
Suppose you have a plate (closed box shape in my code) of glass of refractive index n. What ray will go into it with easy to understand outcome? Here is one:
Recall Snell's law that n sin(theta) = n' sin(theta'). That implies that for an incident ray from vacuum (my renderer will kill inhabitants immediately) at 45 degrees into a medium with refractive index sqrt(2), the refracted ray will have sin(theta') = 1/2. There can't be any reflection on the next bounce because you would need sin(theta) = sqrt(6)/2, so you will get total internal reflection all the way until the other end of the glass plate. I add some green exponential attenuation and voila (hopefully right):
Suppose you have a plate (closed box shape in my code) of glass of refractive index n. What ray will go into it with easy to understand outcome? Here is one:
![]() |
Pink is the cross section of the solid glass pane which continues to the right. |
![]() |
Refraction looks plausible. Maybe that quasi reflection of the sphere in the floor is a caustic? |
Thursday, July 2, 2015
Shadow rays and I are getting a divorce
Like most batch rendering people I have a love-hate relationship with shadow rays. They are wonderfully simple and can easily get you effects like accurate shadows of an eclipse. And yet without getting fancy you start having car interiors turn black because the shadow rays hit the windows. And brute force methods give better pictures given huge amounts of rays. But I think I am finally believing my own BS and thinking computers are fast enough. In my new rendering project I am abandoning shadow rays so the floor under the glass is automatically illuminated. Note the quasi-TV is the only light source in the room. No importance sampling here yet-- just getting the functionality in. (I think there is still a bug in the glass but getting close).
Tuesday, June 30, 2015
A new iOS photo app: Subjective
We have a new iOS photo app out that combines some features of our previous apps. The basic idea we have been pursuing for a while is based on the subjective refraction test from optometry where a person uses their own judgment for which of a set of things is better. A/B testing is a more randomized version of this basic idea.
We first have you pick a category of editing (e.g., is it an outdoor landscape or is it food or do you want to make a stencil version like the Obama HOPE poser?). It shows the image being edited as a background:
Now three screens of choose best of 4:
And here's the product.
You can of course go more conventionally and adjust contract and color temperature and saturation (one screen for each). I like this for food. Here's before:
and after. Is it better? I think so, but it's SUBJECTIVE!
We first have you pick a category of editing (e.g., is it an outdoor landscape or is it food or do you want to make a stencil version like the Obama HOPE poser?). It shows the image being edited as a background:
Pick one of the filter families-- like Stencil |
Now three screens of choose best of 4:
Now pick best of four 3 times |
And voila! |
And here's the product.
You can of course go more conventionally and adjust contract and color temperature and saturation (one screen for each). I like this for food. Here's before:
and after. Is it better? I think so, but it's SUBJECTIVE!
Subscribe to:
Posts (Atom)