POV-Ray : Newsgroups : povray.programming : Ray collision export, spectral rendering, and dispersion at relective grati= Server Time
28 Mar 2024 10:04:03 EDT (-0400)
  Ray collision export, spectral rendering, and dispersion at relective grati= (Message 1 to 4 of 4)  
From: Alexander jahn
Subject: Ray collision export, spectral rendering, and dispersion at relective grati=
Date: 5 Apr 2018 09:25:01
Message: <web.5ac62302d6268304836910ac0@news.povray.org>
Hello all,
for a simulation project of an optical system I would like to use POV-ray as a
standard in ray-tracing applications.
POV-ray already covers most of the necessary features but three things are
missing I think. I would like to ask here as extensive googling didn't lead to
any answer.

a) is it possible to export text of the individual ray collision and
diffraction?

For example

output.txt:
From To Source Destination DestinationType FromX FromY ToX ToY DeltaX DeltaY
Magnitude BeamAngle SurfaceNormalAngle WavelengthNM
Beam Origin Refraction Origin Ray 1 Dbeam 1 Crown lens Lens -5,0000 0,0000e+00
-5,0000e-04 -0,2700 4,9995 -0,2700 5,0068 -3,0910 180,0000 650,0000
Refraction Refraction Crown lens Crown lens Lens -5,0000e-04 -0,2700 0,7497
-0,2966 0,7502 -0,0267 0,7507 -2,0357 174,3253 650,0000
....
+ another 500,000 lines like this
(this output is 2D and is a normal export of
https://arachnoid.com/OpticalRayTracer/ )

I am interested in this text output as I will simulate my light-sensor as a
sphere, the rays that collide with this sphere are "detected".

b) Is it possible to apply the attribute "wavelength" to an individual ray?
In my setup, the wavelength of the light is very important, but most ray-tracers
do not include that info afaik.
The response to this question is important for question c)

c) Is it possible to simulate a reflective refraction grating?
Example
https://www.thorlabs.com/images/TabImages/Littrow_Configuration_D1-780.gif
The main issue that I see is that it is not a particle effect, but rather an
interference effect, using a ray-model of light is not the best way I guess.

But anyways, with a simplified model of a diffraction grating, it should be
possible to deliver reasonable results.

I imagine that the rays need to be refracted on a surface based on the angle
between ray and surface normal as well as wavelength-attribute of the ray (see
question b).


If some of this features already exist please point me into that direction. For
the missing feature, I'd like to include that feature myself in the code and
publish that on github, I'd like to request ideas how to implement that if
possible.

Thank you very much for your time and feedback

Alex


Post a reply to this message

From: Bald Eagle
Subject: Re: Ray collision export, spectral rendering, and dispersion at relective g=
Date: 5 Apr 2018 10:10:01
Message: <web.5ac62dd787838d14c437ac910@news.povray.org>
"Alexander jahn" <jah### [at] gmailcom> wrote:

> a) is it possible to export text of the individual ray collision and
> diffraction?
>
> For example
>
> output.txt:
> From To Source Destination DestinationType FromX FromY ToX ToY DeltaX DeltaY
> Magnitude BeamAngle SurfaceNormalAngle WavelengthNM
> Beam Origin Refraction Origin Ray 1 Dbeam 1 Crown lens Lens -5,0000 0,0000e+00
> -5,0000e-04 -0,2700 4,9995 -0,2700 5,0068 -3,0910 180,0000 650,0000
> Refraction Refraction Crown lens Crown lens Lens -5,0000e-04 -0,2700 0,7497
> -0,2966 0,7502 -0,0267 0,7507 -2,0357 174,3253 650,0000
> ....
> + another 500,000 lines like this
> (this output is 2D and is a normal export of
> https://arachnoid.com/OpticalRayTracer/ )
>
> I am interested in this text output as I will simulate my light-sensor as a
> sphere, the rays that collide with this sphere are "detected".

POV-Ray itself won't do that, but I suppose you might be able to do something
with the trace() function.  Might take a while.

> b) Is it possible to apply the attribute "wavelength" to an individual ray?
> In my setup, the wavelength of the light is very important, but most ray-tracers
> do not include that info afaik.
> The response to this question is important for question c)

If you somehow encode your "wavelength" as an rgb value, then I suppose it could
be possible.  For the moment, POV-Ray doesn't handle light in a realistic sense
like that.   But the following are the closest I can think of off the top of my
head:

http://www.ignorancia.org/en/index.php?page=Lightsys
http://www.lilysoft.org/CGI/SR/Spectral%20Render.htm

> c) Is it possible to simulate a reflective refraction grating?
> Example
> https://www.thorlabs.com/images/TabImages/Littrow_Configuration_D1-780.gif
> The main issue that I see is that it is not a particle effect, but rather an
> interference effect, using a ray-model of light is not the best way I guess.


Mmmmmm.   Dunno - but check out:
https://www.youtube.com/watch?v=xjMjWtntm9k

That might help you decide for yourself, or you could contact the author and see
how he went about it.


Post a reply to this message

From: Bald Eagle
Subject: Re: Ray collision export, spectral rendering, and dispersion at relective g=
Date: 5 Apr 2018 10:20:00
Message: <web.5ac6303287838d14c437ac910@news.povray.org>
With regard to the interference pattern, you might be able to define functions
to use as patterns in 3D space.

I'm thinking that if you define them with sinusoidal functions, the waves ought
to produce an interference pattern.

I did something like this in 2D.
http://news.povray.org/povray.binaries.animations/thread/%3C56dc130f%40news.povray.org%3E/
What you want to do is certainly more challenging.

Have a look at:


http://news.povray.org/povray.newusers/thread/%3CPkHU2EAlyv89Ewfz%40econym.demon.co.uk%3E/

http://news.povray.org/povray.general/thread/%3Cweb.4aadc07b57c09743f211c3700@news.povray.org%3E/?ttop=354036&toff=250

Also, Bill Pokorny plays around with some complicated projects - he might chime
in with something useful, and clipka might have some thoughts on addressing this
as well.

Just a few quick ideas.


Post a reply to this message

From: clipka
Subject: Re: Ray collision export, spectral rendering, and dispersion at relective grati=
Date: 5 Apr 2018 12:10:48
Message: <5ac64a88$1@news.povray.org>
Am 05.04.2018 um 15:22 schrieb Alexander jahn:

> a) is it possible to export text of the individual ray collision and
> diffraction?

Nope.

In POV-Ray, by design raytracing is only employed as a means to create
images, not as a goal in and of itself.

You /might/ be able to coax POV-Ray into writing /some/ rudimentary
ray-object collision "log" by using photons and writing the photon map
to a file, but that log would be far less detailed, IIRC have some
binary format, and would also require some tinkering with the scene to
set it up for this purpose.

Adding a dedicated "ray logging" mechanism to the code may be possible,
but probably non-trivial, especially since contemporary POV-Ray uses
symmetric multithreading so you can't just naively dump ray-object
intersection information to a file "on the fly".

> b) Is it possible to apply the attribute "wavelength" to an individual ray?
> In my setup, the wavelength of the light is very important, but most ray-tracers
> do not include that info afaik.
> The response to this question is important for question c)

For some mechanisms POV-Ray does indeed tag rays as monochromatic with
an associated wavelength, namely whenever dispersion comes into play.
(Note however that the tag and wavelength are only evaluated in
subsequent dispersive refraction events; colour computations are
/always/ done on an RGB basis.)

> c) Is it possible to simulate a reflective refraction grating?
> Example
> https://www.thorlabs.com/images/TabImages/Littrow_Configuration_D1-780.gif
> The main issue that I see is that it is not a particle effect, but rather an
> interference effect, using a ray-model of light is not the best way I guess.

At present, POV-Ray provides no way to model such a thing. I'm sure such
a feature could be added (given enough time and energy), but probably
only via a stochastic approach. (Someone would also have to come up with
a neat syntax for the feature, so that it fits nicely into POV-Ray's
current system of material properties.)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.