Axial Lights II (Ghostbuster?)

Have questions about the equipment used for macro- or micro- photography? Post those questions in this forum.

Moderators: rjlittlefield, ChrisR, Chris S., Pau

mjkzz
Posts: 1455
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Axial Lights II (Ghostbuster?)

Post by mjkzz »

by "faint third one", I meant the third faint one on the lower side, it is the refracted ray and its corresponding reflected ray out on the other side is too weak to be seen

mjkzz
Posts: 1455
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Axial Lights II (Ghostbuster?)

Post by mjkzz »

OK, can not stop thinking :D.

In the physics class PDF, I believe the percentage of reflection is total percentage loss, ie, loss on first surface plus loss on 2nd surface. So if R is reflectivity, the the total loss is R + (1-R) * R. From Wiki, formula based on Fresnel equations is as below:
reflectivity_formula.png
Then calculating R for the range 40 to 50 for glass with n=1.52, gives about 4% to 6%, meaning the secondary rays and transmitted rays has a ratio of (0.04)*(0.04) = 9.3 stops and (0.06)*(0.06) = 8.1 stop. With an 8bit camera, that literally means, even if you have a dot of 255 value, its ghost would be clipped to zero. NO ghost :D

Here is a graph of reflectivity vs incident angle using newly discovered and highly recommended site where you can actually type in an expression and plot a graph with it. Note, when we talk about percent of amount of light, we are talking about the square of the r [edit] the power ratio.
reflectivity_graph.png
Hope this clarifies things a bit

mjkzz
Posts: 1455
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Axial Lights II (Ghostbuster?)

Post by mjkzz »

If you look at the formula for the secondary rays, it will have intensity of (1-R)^2*R^2, plotting it and you will see a local maxima at R=0.5. If you can do some calculus by taking derivatives, same. Note, it actually is a maxima because R can not be greater than 1. That corresponds to about 82 degrees (edit, 1.44 rad) of incident angle.
axial_localmaxima.png

mjkzz
Posts: 1455
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Axial Lights II (Ghostbuster?)

Post by mjkzz »

Regarding Rik's double pane windows, I think scattering is occurring there. Here is a setup I tried and I actually risked my eyes by looking into the laser through these two thick acrylic boards. Unfortunately, when I tried to re-arrange things to photograph it, I broke the laser

Once major test is to shine the laser head on to the boards, ie, at normal. So in this case, there will be no or minimum reflection to the side (will have straight back reflection). What I saw was that I see multiple lines if I view it from an angle, say 45 degrees. But there is only one line coming out. This suggests there are some kind of scattering on the surface of these boards (after all, they are part of frameless picture frame for photos from 15 years ago). I did not count how many lines as I was kinda nervous looking into a laser. The scattering of light is a game changer

But, those groups of images in Rik's images suggest something more than scattering -- they seem to be further apart from original xmas light. Because these xmas lights are emitting lights, there will be all kind of incident angles hitting the glass and starting certain angle, reflectivity becomes high, and with scattering, an image will start to form and seen by camera. The images might appear stretched out due to high reflectivity starts after incident angle becomes larger and somehow I think integration along some path is happening.

Anyways, I think the double pane thing is beyond my ability to analyse it :D
doublepane.jpg

mjkzz
Posts: 1455
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Axial Lights II (Ghostbuster?)

Post by mjkzz »

Last post :D

Here is a graph showing incident angle x vs number of stops the "ghost" is weaker. The 0.89 is radian where you maintain -8 stops, so translating that into degree is 51 degrees, taking 45 degrees out, we get 6 degrees. I think this is about the same as half angle of view for a 100mm macro set at 1:1 (like Canon 100mm macro) in horizontal direction. For lenses like Laowa 100mm set at 2x, this is not a problem at all. And most importantly, the cut off is -8 stops. Raising cutoff to -7 stops, still significant, it is about at 57.3 degrees, take 45 degrees out, we get 12.3 degree. I think that is more than enough, even for a non-macro lens where you probably will not get 1:1 magnification.

Given narrow angle of view, if we ignore light paths that has two or more reflections occurring, I think it is pretty safe to use my original diagram :D As really, that is what I observed, so in a sense, I am extremely lucky in many aspects, that is really beginner's luck :D
reflectivity_stops.png

mjkzz
Posts: 1455
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Axial Lights II (Ghostbuster?)

Post by mjkzz »

Made a video about how light ray behave when it shines over a glass. Since I have ZERO knowledge in optics, I think this might be very useful for others like me (if there is any) because I find it fascinating, never thought about it nor could imagine it -- things get really interesting when incident angle is very large, at some point, internal reflection starts occurring, not quite total but amazing. Here are some key points:

1. If I swing the incident angle even between 35 and 55 (-+ 10degrees), I really do not see any secondary rays, they are so faint even if I zoom in.
2. At 65 degrees (45+20), very, very faint secondary rays, I have to zoom in and look for it hard
3. At extreme incident angles, internal reflection start to occur

All these seem to play out well with what I have learned, and of course, if the simulation was built upon the theories I learned, it should :D But it is really what I observed, too, so I believe it. If it is true, I think this stuff should be "common knowledge", ie, a "given" for other related discussions here. Here is the video I made. The tool is free to use, so I highly recommend people building it themselves. Here is the site. Important note: the glass there is called "half-plane", you can think of it as glass with INFINITE thickness, however, you can use two to build a glass with certain thickness. Have fun.

Here is an image to entice reader to try it themselves :D
RayGlass.png

rjlittlefield
Site Admin
Posts: 22294
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Re: Axial Lights II (Ghostbuster?)

Post by rjlittlefield »

mjkzz wrote:
Fri Jan 28, 2022 5:44 pm
... [ray tracing] tool .... Here is the site.
Thank you very much for finding this tool!

For my purposes, this tool has several very nice features:
  • It properly simulates ray-splitting by refraction/reflection.
  • It is open-source and simple enough to modify. (Source code available at https://github.com/ricktu288/ray-optics )
  • It was written by somebody other than me.
So, with those things in mind, let me try explaining the double-pane reflections.

First, here is a screen capture of the program's output using the public site:
Image

If you look very Very closely at the upper section, you can see a second ray that emerges close to first one.

By pulling the screen capture into Photoshop and adding a levels adjustment, some further information becomes apparent:

Image

Interesting! Now we can see that there is a second pair of reflections, widely separated from the first!

But why are there only two rays in each pair?

It turns out there are two reasons for this:
1. The screen capture is only 8 bits deep, so that any weaker reflections will never register in the display. No amount of levels adjusting will make a third pair visible.
2. The program is written to totally discard any ray whose power is less than 0.01.

To work around these issues, I made two changes to the source code:
1. Rather than draw each ray with a visual intensity that matches its power, instead draw each ray at a fixed power. (We'll access the actual power a different way later.)
2. Reduce the threshold so that rays are discarded only if their power drops below 0.0000001 . (The program needs some non-zero threshold to avoid infinite recursion that ends in an out-of-memory error.)

With these changes, and zooming out to see more context, a more informative pattern appears. Now we have widely separated groups of closely spaced rays, similar to the widely spaced groups of closely spaced reflections that we see in the physical world.

Image

With much more careful study of this diagram, we might eventually figure out that each of those output "rays" actually consists of some number of individual rays, which were created by splitting at surfaces and then subsequently reflected and refracted so as to take exactly the same outgoing path.

Here I have marked up the previous diagram to show three distinct paths that contribute to the final output in the fourth "ray" of the third group.

Image

It is not immediately evident from the picture, but there are a LOT more than three paths that contribute to that final output, which I will hereafter call a "spot" to clarify that it's actually the combination of a bunch of individual rays.

If we number the spots and groups starting from 0, then the combination at [Group J, Spot K] is made up of all paths that reflect across the big central gap J times, and reflect within each pane of glass another K times.

I don't know a simple formula for counting all those paths, but it is straightforward to write a program that counts them up by starting at the origin and working outward, keeping track of how the counts change at each surface where partial reflection causes incoming rays on two paths to merge onto the same outgoing paths.

Alternatively (or in addition, since I did both), we can tap into one of the program's object types, a thing called "Detector" where the program adds up the power of multiple rays as they cross some defined region of space. The standard Detector was not very good for my analysis here, because (A) it did not count contributions, and (B) it only printed two digits of accuracy. However, it was straightforward to modify the program to keep track of ray counts and to print more digits.

Adding several of these tweaked detectors to the simulation shown above, we get this:

Image

According to this output, the fourth group contains spots whose number of contributing rays, and total power, are:
spot 0: 1 ray, total power 0.00008256
spot 1: 8 rays, total power 0.00026001
spot 2: 36 rays, total power 0.00037070
spot 3: 117 rays, total power 0.00031907
spot 4: 265 rays, total power 0.00018619

The last two counts are not quite correct, because some especially low power rays were discarded by the 0.0000001 threshold. Without the threshold those would be 120 and 330, according to my totally independent program that counts without thresholds.

But the general pattern of power distribution is correct, and it captures & explains an aspect of the physical situation that would otherwise be quite puzzling.

To illustrate the puzzling aspect, here is an ordinary image shot with an ordinary camera and lens, with a light source that consists of an ordinary LED with a small aperture added in front of it.

The whole scene:

Image

and zoomed in to just the part I want to look at:

Image

In this photo, look at Group 4, and notice that Spots 1, 2, and 3, indicated by the lighter gray arrows, are all brighter than Spot 0, indicated by the darker gray arrow.

If we consider only that increasing dot numbers go along with increasing numbers of reflections, then this relationship makes no sense. Spot 0 comes from light that was reflected only 8 times, while Spots 1, 2, and 3 come from light that was reflected 10, 12, and 14 times. More reflections give brighter spots? How can this be??

The answer to this conundrum comes in the number of overlapping paths that create each spot. In group 3, the number of contributing paths are these:
Spot 0: 1 ray
Spot 1: 10 rays
Spot 2: 55 rays
Spot 3: 220 rays
Spot 4: 715 rays
Spot 5: 2002 rays
Spot 6: 5005 rays
Spot 6: 11440 rays (barely recorded)

So, increasing numbers of reflections are accompanied by increasing numbers of paths. As long as the gain in number of paths is enough to make up for loss per reflection, the spots get brighter. It would be interesting to pursue some more numbers along that line of thought, but I'll leave that as an open end for now.

Anyway, what we have here is a very nice match between theory and observation, where the theory incorporates only refraction and reflection. No doubt other effects such as absorption and scattering are occurring in the physical world, but they are not major contributors to the reflection pattern that is seen.

That's enough for tonight.

--Rik

mjkzz
Posts: 1455
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Axial Lights II (Ghostbuster?)

Post by mjkzz »

Thank you very much for finding this tool!
Thank you for the top notch analysis with this tool and wow, you even modified the code, kowtows!!! I figure it would be invaluable for this community, particularly in the hands of experts like you.

Yes, the first thing came up to my mind was the incident angle hitting the double pane glasses when I saw your pictures, yes, I believe scattering is occurring, not sure how much and that is where I got scared off and took the easy path (of single ray passing one glass) :D

One thing though, I think if we use a point light source (vs a single ray) in your analysis, those rays you are counting will have significant intensity -- there will be other rays with infinitely close incident angle to the ray being analysed, from the point source hitting the same spot, thus increasing intensity. This summation of other contributing rays means taking integral of some sort when the difference of incident angle is sufficiently small and over a range (at some point, when reflectivity is very small, most lights get refracted, passing through the glass, hence we do not see anything before first, and at some points when reflectivity is close to 1, little get refracted).

This is, of course, just a thought, HOWEVER, your method of counting rays is a super cool approximation of point light source using parallel rays to simplify visualisation. The other way to analyze this is to use some game engine, like Unreal Engine, with ray tracing capabilities. In that case, even scattering can be done, too.

Anyways, thanks for clearing my mind about that, saved me from finding a ray tracing engine to simulate this (see, that double pane window is still on my mind :D)

rjlittlefield
Site Admin
Posts: 22294
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Re: Axial Lights II (Ghostbuster?)

Post by rjlittlefield »

mjkzz wrote:
Sun Jan 30, 2022 1:47 am
One thing though, I think if we use a point light source (vs a single ray) in your analysis, those rays you are counting will have significant intensity -- there will be other rays with infinitely close incident angle to the ray being analysed, from the point source hitting the same spot, thus increasing intensity. This summation of other contributing rays means taking integral of some sort when the difference of incident angle is sufficiently small and over a range (at some point, when reflectivity is very small, most lights get refracted, passing through the glass, hence we do not see anything before first, and at some points when reflectivity is close to 1, little get refracted).
Sure, ultimately the brightness seen by the camera is an integral across all paths that correspond to each pixel. In the real world, this is accomplished by light sources that generate EM waves that bounce around and eventually deposit energy on the sensor. Unfortunately modeling the waves directly takes too much computation, even in the modern era. So instead, modeling light as individual rays is a discrete approximation that gives useful results quickly.

There are two common ways for the rays to be propagated. The one that I used is to trace rays from the source outward. An alternate approach is to trace rays backward from the sinks, that is, from sensor back through the lens and out into the world. This is what CGI programs like game engines do.

In either approach, to do physically accurate reflections for a large scene is computationally expensive. In the scene that I photographed, some of the visible dots come from paths that would have required considering over 10,000 rays (16 reflections, with some pruning). Most of those rays, for most pixels, in fact do not contribute to the final image, but it's tough to know which are which without trying all of them.

The way this problem is handled depends on the rendering engine. In Blender, you can specify the depth to which each ray is to be followed. Specifying depth 16 might accurately capture the groups of dots in my photo. (Edit: I'm not sure if Blender handles ray splitting at transparent objects.) But if it does, you would have to wait quite a long time to see the picture. When there are time constraints, some shortcuts have to be taken. The documentation for Blender states simply that "(n.b. Reflections are not available in the Game Engine)". Unreal Engine is more clever; it does support reflections in real-time mode, but this seems to be accomplished by artistically placed shortcuts rather than objectively accurate simulation. That's a very useful trick for games, perhaps not so much for analyzing optics systems.

--Rik

kaleun96
Posts: 231
Joined: Sat Oct 20, 2018 3:47 pm
Location: Stockholm, Sweden

Re: Axial Lights II (Ghostbuster?)

Post by kaleun96 »

Just speed-reading this thread for now as it's getting late but already I see some good ideas and clarifications have come from it!

I saw mjkzz asking a few times about specific setups that had documented ghosting so I thought I'd quickly share in case it is useful in helping troubleshoot the possible causes. I should also mention I got ghosting using Lou's idea of photographing the reflection of the coin off the glass instead of through the glass. So the camera would be horizontal and the light source vertical. Here's an extremely crap diagram that might help explain how I've set mine up (at least the most recent iteration) for the usual method of axial lighting.

The black lines represent a 3D printed plastic box. At one end, it has a hole in the end of the box that a Godox TT350 flash adapts to (perfect fit, i.e. no gaps around). At the other end, the wall is not a wall but a flap that is angled at 45 degrees to direct reflections downwards. The entirety of the box is lined with black felt so the reflections are minimal (there is barely a hint of light reflecting off the 45 degree flap at the other end and down and out of the box). Just to be sure, I've also tried having a surface lined with black felt at the bottom of the 45 degree flap just to make doubly-sure reflections weren't making it all that way back.

The blue is the Godox TT350 flash. The yellow is the camera lens.

The red line represents a Schott Mirona beamsplitter (this stuff, specifically). It has AR coating on one side and high reflectance coating on the other, according to the description this helps remove "double reflection". It is thick at 4mm but I haven't noticed thin pieces of beamsplitter glass removing ghosting either and I bought this piece mainly to see if it removed ghosting. It is placed at a 45 degree angle (a 3D printed mount) that slots into the box and where the black horizontal lines are dotted, this represents this part of the top of the box is open so the lens can image the subject.

The green is a 3D printed cylinder that the coin subjects are placed inside. Not drawn is that the side of the cylinder facing the glass is cut at a 45 degree angle so it can be placed closer to the glass if necessary.
diagram.jpg
- Cam

mjkzz
Posts: 1455
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Axial Lights II (Ghostbuster?)

Post by mjkzz »

The way this problem is handled depends on the rendering engine. In Blender, you can specify the depth to which each ray is to be followed. Specifying depth 16 might accurately capture the groups of dots in my photo. (Edit: I'm not sure if Blender handles ray splitting at transparent objects.) But if it does, you would have to wait quite a long time to see the picture. When there are time constraints, some shortcuts have to be taken. The documentation for Blender states simply that "(n.b. Reflections are not available in the Game Engine)". Unreal Engine is more clever; it does support reflections in real-time mode, but this seems to be accomplished by artistically placed shortcuts rather than objectively accurate simulation. That's a very useful trick for games, perhaps not so much for analyzing optics systems.
Sure, not all game engines work the way ray tracing should be done. Like the latest Unreal Engine, I think it is doing some kind of pseudo ray tracing so that they can render a scene in real time for games. I did not dig too deep into UE, but one of the application is for architectural rendering. It takes hours, if not days, to "bake" (as they call it) a scene, even with "server farm" that I wrote a blog about. In this case, I think a game engine might help, but it is way too complicated, at least for me :D

On the other hand, there might be some open source, true ray tracing apps out there. :D

mjkzz
Posts: 1455
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Re: Axial Lights II (Ghostbuster?)

Post by mjkzz »

Image

cool, I was thinking along the line of using LEDs instead of flash. I also made the bottom part as a slot so that I can insert and move coins (my intended goal) easily.

Post Reply Previous topicNext topic