Open vitalitylearning2021 opened 1 year ago
_hit_pos
are positions of the first hit along the ray, even if the ray continues and has multiple segments. This was useful for several applications until now, especially for research work like yours. In this way you have all the information exposed - the face involved and the hit. From this you can calculate required angles and prepare next ray segment direction. The workflow in this case is:
Note, you can use flat material if you calculate next segment on your own. It is much faster than the default diffuse material.
Hit info for multiple segments is not available in PlotOptiX. Performance and memory would suffer a lot, and segments depend on the material logic that is specific to material shaders (how rays are refracted or what pdf function is used to draw the outgoing direction). So far I had no good use case to develop in this direction.
Thank you very much for your help. I would then ask the following questions:
rt.set_param(max_accumulation_frames = 1)
?on_rt_accum_done
stage by the displayResults
function. How should I loop to trigger OptiX, make synchronizations and fetch information on multiple intersections? Should I use global variables?rt.setup_material("m_flat", m_flat)
and then rt.set_data("corner", mat="m_flat")
to set it up?Sorry for the many questions and thanks in advance for any help.
Hi,
rt.set_uint("path_seg_range", 1, 1)
and flat material for objects in the scene. This will limit each ray to the first intersection and avoid calculations used for physical materials.rt.set_texture_2d("origins", next_origins)
rt.set_texture_2d("directions", next_dirs, refresh=True)
refresh=True
will trigger the launch. Otherwise you can update everything w/o refreshing and trigger launch with refresh_scene()
No worries about questions! :) This way I can always spot some improvements.
Good day, I need to follow a ray along its path and acquire information of all its multiple intersections. To this end, I'm considering the following example involving the scattering from a corner reflector:
I have the following questions:
1) I'm setting
path_seg_range
to enable multiple reflections. However, it seems the line does not have an effect. If I comment it out, the results seem to be the same. 2) I access the hit positions and hit distances by thert._hit_pos
array. However, for my purposes, I need to know all the hit positions and distances per ray. Is that possible by PlotOptiX?