Question about detector behaviour with total internal and Fresnel reflection

70 views
Skip to first unread message

Theo Husby

unread,
Nov 4, 2025, 1:59:54 PM11/4/25
to mcx-users
Hi Dr. Fang,

I'm simulating a semi-infinite tissue volume where an optical fiber placed in contact with the top surface is used as a detector. In MCX I'm using a detector and only counting photons with trajectories that lie within the fiber's NA (accounting for the tissue's index of refraction). I had some basic questions about how total internal reflection and Fresnel reflections interact with detectors.
  1. Are photons only detected only if they exit the volume and are terminated? 
    • e.g. If a photon packet is incident with a detector surface, but is totally internally reflected such that it does not leave the volume, is it detected? I couldn't tell from your FAQ post
  2. Do Fresnel reflections create new photon packets with their own initial weight and partial path length, or do they scale the weight of the packet by the fraction that's reflected and add to the packet's pre-reflection partial path length?
    • i.e. if I use mcxdetweight to calculate reflectance, will I have inaccurate results because the partial path length includes the Fresnel reflection component?
Thanks,
Theo Husby

Qianqian Fang

unread,
Nov 7, 2025, 11:41:42 PM11/7/25
to mcx-...@googlegroups.com, Theo Husby

see my replies below

On 11/4/25 13:59, Theo Husby wrote:
Hi Dr. Fang,

I'm simulating a semi-infinite tissue volume where an optical fiber placed in contact with the top surface is used as a detector. In MCX I'm using a detector and only counting photons with trajectories that lie within the fiber's NA (accounting for the tissue's index of refraction). I had some basic questions about how total internal reflection and Fresnel reflections interact with detectors.
  1. Are photons only detected only if they exit the volume and are terminated? 


yes


    • e.g. If a photon packet is incident with a detector surface, but is totally internally reflected such that it does not leave the volume, is it detected? I couldn't tell from your FAQ post


it is not detected, nor should it be detected.


  1. Do Fresnel reflections create new photon packets with their own initial weight and partial path length, or do they scale the weight of the packet by the fraction that's reflected and add to the packet's pre-reflection partial path length?


neither 

MCX/MMC uses a random number generator to create a random number between 0-1. if this number is greater than reflection coeff R_total, then, the photon packet will transmit through the boundary to the next medium (following Fresnel's law); it will keep its weight 100%, and continue;

if it is less than R_total, then it take the reflection path, while keeping its weight 100%. no weight is scaled or lost during this process. Statistically, this approach matches exactly the energy split at the boundary.


    • i.e. if I use mcxdetweight to calculate reflectance, will I have inaccurate results because the partial path length includes the Fresnel reflection component?


no. there is no scaling or loss at reflection/transmission.


Thanks,
Theo Husby
--
You received this message because you are subscribed to the Google Groups "mcx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mcx-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mcx-users/af68f7b3-ea3e-476f-9ec4-a72b5aebb82fn%40googlegroups.com.

Theo Husby

unread,
Nov 10, 2025, 4:49:25 PM11/10/25
to mcx-users
Perfect! Thanks for the clarifications!

Theo Husby

unread,
Jun 12, 2026, 4:51:22 PM (12 days ago) Jun 12
to mcx-users
Hi Dr. Fang, 

8-months later, I have a follow-up question: Given your reply to my first question that photons are only detected if they pass through the boundary between media types into a zero-labeled voxel, does detphoton.v describe the direction of the photon after it passes into the non-zero voxel, or before? I.e. If a photon packet is passing from medium 1 to 0 and the two media have different refractive indices, do I need to use snell's law to account for the index change after I convert detphoton.v into an angle, or is that already handled in the simulation?

Cheers,
Theo

Hirvi Pauliina

unread,
Jun 17, 2026, 3:32:50 PM (7 days ago) Jun 17
to mcx-users

Dear Theo,

Thanks for the excellent questions, these have also been relevant in my research. 

I would recommend checking Dr. Fang's reply to my question number 4) in:  https://groups.google.com/g/mcx-users/c/a_v6-2gOMgk/m/m60goldNBgAJ

My understanding is that the exit direction is the photon's direction after it has crossed the exterior boundary into the zero-voxel. The code computes the refracted direction using Snell's law before the simulation is terminated. Thus, there is no need to apply Snell's law again afterward. 

The source code has been modified since the commit in 2017, but I think currently the refraction at exterior boundary is handled in: https://github.com/fangq/mcx/blob/7826eb9172848ff6e94e233599ab5f2ff10e8b65/src/mcx_core.cu#L2776

The function transmit() implements Snell's law in a clever way, which makes sense once you realize that:
cos(angle_2) = sqrt(1 - n_1^2/n_2^2 * (1 - cos(angle_1)^2)),
and that the normalization in the end is harmless since the vector entering the normalization step is already in unit length. 

Hope this helps! And Dr. Fang, please feel free to correct me if I'm wrong, for example, if saving the exit directions causes some difference. 

Best regards,
Pauliina Hirvi


From: mcx-...@googlegroups.com <mcx-...@googlegroups.com> on behalf of Theo Husby <theo...@gmail.com>
Sent: Friday, June 12, 2026 11:51 PM
To: mcx-users <mcx-...@googlegroups.com>
Subject: Re: [mcx-users] Question about detector behaviour with total internal and Fresnel reflection
 

Theo Husby

unread,
Jun 18, 2026, 10:33:57 AM (7 days ago) Jun 18
to mcx-users
Hi Pauliina,

Thanks for the detailed response! I missed your earlier question and Dr. Fang's response while I was searching around before I asked.

Much appreciated :)

Cheers,
Theo

Reply all
Reply to author
Forward
0 new messages