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?
Re: Volumetric Gradient index rendering
Have you got some results using the ray marching technik for volumes on gradient index rendering?
I am very interested because I want to model the GRIN-Lenses for Neuroscience experiments. Latest publications show that aquatic animals usually don't have cornea lenses like mammals living on land. Instead they have eyes where the "distribution of the crystallin proteins across the lens creates a gradient refractive index (GRIN) or GRIN lens". I.e eyes, where the IOR changes within the eyes depending on position in the eye ball. So the light rays form a curve instead of a polygon line.
It would be perfect if I could model that in Luxcore by a heterageneous volume with position specific IOR.
I am very interested because I want to model the GRIN-Lenses for Neuroscience experiments. Latest publications show that aquatic animals usually don't have cornea lenses like mammals living on land. Instead they have eyes where the "distribution of the crystallin proteins across the lens creates a gradient refractive index (GRIN) or GRIN lens". I.e eyes, where the IOR changes within the eyes depending on position in the eye ball. So the light rays form a curve instead of a polygon line.
It would be perfect if I could model that in Luxcore by a heterageneous volume with position specific IOR.