Hello everybody,
I would like to trace rays through gradient index media, which rather bend the rays then refract them. I already wrote a small program which is fast enough and is embedded in a ray-tracer which works on basis of meshes. The general principle is, that the volume is connected to a surface and as soon as a ray hits this surface the subsequent calculation is performed step-wise through the volume, with fixed intervals, until the end of it is reached where it switches back again to surface based ray-tracing. With a sufficiently small step-size this approach turned out to be still reasonably fast.
Now I was wondering if it would be somehow possible to define such a functionality into LuxCore. I don't know if such a functionality would ever be useful for a broad range of people. Not being able to detect collisions inside the volume limits adds some complexity on how to define the scene. I would be very happy if somebody could give me either some help or show me where i would have to implement such functionality.
Volumetric Gradient index rendering
Re: Volumetric Gradient index rendering
This is the exact definition of heterogeneous volume in LuxCore (aka ray marching). It is exactly how it works. You may have to define a new scattering function but it is all you are likely to have to do.Pau1 wrote: ↑Sat Mar 12, 2022 3:20 pm I would like to trace rays through gradient index media, which rather bend the rays then refract them. I already wrote a small program which is fast enough and is embedded in a ray-tracer which works on basis of meshes. The general principle is, that the volume is connected to a surface and as soon as a ray hits this surface the subsequent calculation is performed step-wise through the volume, with fixed intervals, until the end of it is reached where it switches back again to surface based ray-tracing. With a sufficiently small step-size this approach turned out to be still reasonably fast.
Re: Volumetric Gradient index rendering
Now I feel a bit bad for not knowing, but yes it totally makes sense that this works the same way. That are really great news for me.
I have to say, I never worked with the source of LuxCore until now. Could you point me to some files at the repository which I can read as a start to understand how heterogeneous volumes are implement and how to define a new scattering function?
I have to say, I never worked with the source of LuxCore until now. Could you point me to some files at the repository which I can read as a start to understand how heterogeneous volumes are implement and how to define a new scattering function?