Skip to main content
Solved

Non-sequential mode how to force ray to interact only once with one surface

  • September 5, 2024
  • 3 replies
  • 112 views

Erkang Wang

Hi, 

I have a hemisphere reflective target, I want each ray to be reflected by the target only once. Could you tell me where to set this up or what filter should I use?

Thanks a lot.

Best answer by David.Nguyen

@Erkang Wang 

 

I’m not sure how to force a single reflection from an object from the ray tracing perspective. However, you could perhaps use a Filter String in your viewer to only display rays that have been reflected once (I’m assuming this is what you were asking for when you wrote “what filter should I use?”. Take this simple example:

The bottom object is Object 4, and its upper face (1) has been made reflective. You could get the ray that reflect only once from the bottom object with a filter string like so:

R4.1 & X_HIT(4.1, 1)

R4.1 means that the ray must be reflected by Face 1 of Object 4. X_HIT(4.1, 1) means that the ray must hit Face 1 of Object 4 one and only one time. The & is a logical AND. See the result below:

Note that in this instance, it would have been enough to do X_HIT(4.1, 1), since the surface is purely reflective. But R4.1 ensures that the ray is not only hitting Object 4 but that it is indeed reflected from this object.

I hope this helps.

Take care,

 

David

View original
Did this topic help you find an answer to your question?

3 replies

David.Nguyen
Luminary
Forum|alt.badge.img+2
  • Luminary
  • 1122 replies
  • Answer
  • September 6, 2024

@Erkang Wang 

 

I’m not sure how to force a single reflection from an object from the ray tracing perspective. However, you could perhaps use a Filter String in your viewer to only display rays that have been reflected once (I’m assuming this is what you were asking for when you wrote “what filter should I use?”. Take this simple example:

The bottom object is Object 4, and its upper face (1) has been made reflective. You could get the ray that reflect only once from the bottom object with a filter string like so:

R4.1 & X_HIT(4.1, 1)

R4.1 means that the ray must be reflected by Face 1 of Object 4. X_HIT(4.1, 1) means that the ray must hit Face 1 of Object 4 one and only one time. The & is a logical AND. See the result below:

Note that in this instance, it would have been enough to do X_HIT(4.1, 1), since the surface is purely reflective. But R4.1 ensures that the ray is not only hitting Object 4 but that it is indeed reflected from this object.

I hope this helps.

Take care,

 

David


Erkang Wang
  • Author
  • Infrared
  • 8 replies
  • September 6, 2024
David.Nguyen wrote:

@Erkang Wang

 

I’m not sure how to force a single reflection from an object from the ray tracing perspective. However, you could perhaps use a Filter String in your viewer to only display rays that have been reflected once (I’m assuming this is what you were asking for when you wrote “what filter should I use?”. Take this simple example:

The bottom object is Object 4, and its upper face (1) has been made reflective. You could get the ray that reflect only once from the bottom object with a filter string like so:

R4.1 & X_HIT(4.1, 1)

R4.1 means that the ray must be reflected by Face 1 of Object 4. X_HIT(4.1, 1) means that the ray must hit Face 1 of Object 4 one and only one time. The & is a logical AND. See the result below:

Note that in this instance, it would have been enough to do X_HIT(4.1, 1), since the surface is purely reflective. But R4.1 ensures that the ray is not only hitting Object 4 but that it is indeed reflected from this object.

I hope this helps.

Take care,

 

David

works very well. Thank you, David. I guess it still waste some computational power? since ray trace has to include those multi-reflected beams ?


David.Nguyen
Luminary
Forum|alt.badge.img+2
  • Luminary
  • 1122 replies
  • September 6, 2024

@Erkang Wang

 

You are absolutely correct. There might be a way to optimize the ray tracing, but this is very design-dependant and without seeing a file, it is hard to say how you could do that in your application.

Take care,

 

David


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings