Optical
systems are everywhere in the modern world, they are in almost any device. There
are several optical systems in a vehicle, in a mobile phones, etc. The design
of such systems is a complex process. Currently, computer simulation is widely
used for it. Simulation results can be presented both in quantitative and
qualitative form. And of course, one of the main means of qualitative
presentation of the results is their scientific visualization.
One
of the main goals of a qualitative presentation of the results is the ability
to quickly visually evaluate the result without spending significant time and
resources on the analysis of the numerical output data. The use of color for
these purposes cannot be overemphasized. It is precisely the right colors that
make it possible to understand at a glance the correctness or fallacy of the
design, to see what its deficits and mistakes are, to understand the ways of
its further development. Therefore, the correct choice of colors in the
scientific visualization of simulation results is extremely important.
The
classical Monte Carlo ray tracing [1] is a powerful technique for modeling
almost all effects in geometric optics. This
method
is now one of the most popular ones for lighting simulation of complicated
scenes consisting of great number of geometrical objects with different surface
and medium properties.
A drawback of all stochastic
methods is the undesirable noise. There are many techniques of scientific
visualization which help to investigate the scene of optical device, in
particular investigate the influence of simulation noise. But we focus on one
of them: this is a visualization of ray trajectories which are calculated
during simulation of complicated optical systems [2, 3]. These rays are
displayed directly in the viewport of the lighting simulation program, or in
the viewport of the computer-aided design (CAD) system to which the lighting
simulation module is attached as a plugin. This way of the presentation of the
simulation result allows significantly simplify its interrogation. A designer
just sees the cases of incorrect trajectories, understands causes of their
appearance and eliminates them. Ray visualization tools are often applied in
optical system design [4, 5]. Also this way is useful for software developers,
as means of debugging and optimizing algorithms [6, 7].
For display of some particular ray trajectories, display
criteria are used. This technique allows displaying only rays satisfying to the
specified criteria. For example, one can set hitting some particular object as
a criterion, or particular event type occurred with ray (for example, reflection
or refraction only, etc.). Building complicated criteria which consist of
several conditions combined with logical operators AND, OR, NOT is also
possible [7].
In the paper we present a ray visualization technique with
rays colored with artificial colors. We emphasize the role of color in technique.
Coloring of the visualized rays or their segments according to the conditions
specified by the designer allows you to quickly conduct a qualitative analysis
of the optical system under development. The application of this technique
significantly speeds up the complex and time-consuming process of the design of
the optical systems.
A similar approach and analysis of the use of color in
industrial design tasks has not been found in the literature known to us.
In
lighting simulation system [8] developed by us in the Keldysh Institute of
Applied Mathematics RAS, three coloring modes are currently used for displaying
trajectories of rays: natural color mode, artificial color mode with criterion
applied to an entire ray (starting from the light source to the moment of ray
absorption or collecting by sensors), and artificial color mode with criterion
applied to each ray segment. The simplest mode is natural coloring mode. In
this mode each ray segment is displayed with the same color as the color which
this light has in reality. No additional settings are required in this case.
This mode can be useful for analyzing color distortion in an optical system [7].
But
if we would like to demonstrate some desirable effect or, contrary, wrong
behavior of light then it is possible to color these rays by artificial colors.
So a color mode allowed painting of each ray with some color specified by
certain criterion should be applied here. In some cases, visualization of rays satisfying
only to one criterion is insufficient. Often it is also necessary to show other
rays or all traced rays, but the rays satisfying to the criterion should be
somehow highlighted to be noticeable. For this case, coloring of rays according
to the certain conditions has been developed. In this mode the rays satisfying
to some criteria are painted with a color explicitly specified by a program
user. User should build a list of criteria with colors corresponding to each
criterion. Also he should set the default color which is used for painting rays
not satisfying to the defined criteria. In such a way, it becomes possible to simultaneously
demonstrate trajectories of rays painted with different colors that satisfy to
different criteria.
First
of all this mode is convenient because it allows seeing ratio of quantity of
rays satisfying to some criterion by quantity of all other rays, or quotas of
rays satisfying to different criteria. One more case, when color criteria method
is useful, is investigation of rays deviated from expected trajectory in the
optical system. At the same time it is possible to compare “expected”
trajectory with “incorrect” ones and find particular place (or places) where
trajectories have gone in wrong direction. This provides quickly and easily
discovering of mistakes or wrong design of the optical systems.
The
list of events [9] that can be used as conditions for color criteria are:
•
Ray starting at a certain light source;
•
Ray hitting on a certain object;
•
Ray hitting on any object with certain material
applied;
•
Ray hitting on some observer (virtual sensor);
•
Type of optical event happened with ray (reflection,
refraction, absorption) on a scene object; this
criterion can be useful, for example, to detect stray reflections on a lens system
which cause highlights [10];
•
Ray killing, i.e. indefinite state of the ray at
the end of its trajectory. This happens usually if the scene is set
incorrectly, or if some computational error took place.
The
main difference of the color criteria used in our system from the general criteria
for ray visualization [11] is the impossibility of creating complex criteria
with several conditions combined with logical operators. This implementation was
made for the sake of the GUI simplification and ease of use.
Sometimes
it is also insufficient to display the entire ray in one color. Most often this
happens if the ray satisfies several criteria simultaneously. In this case, it
is advisable to paint with the criterion color not the entire ray but only those
segments of the ray that directly satisfy the criterion. Besides, this mode can
be useful if you need to evaluate the directions of rays after an event has occurred,
and compare these directions with the directions of other rays. The segments of
other rays may have almost the same directions, and so may be indistinguishable
from the segments of interest. Coloring of the segments of interest in a
different color allows to highlight them.
In
the lighting simulation complex developed by us, the segment is visualized
according to color criteria if its starting point satisfies them. For example,
if the criterion implies that a ray hits a certain object and some ray is
reflected from this object, then the color corresponding to the criterion will
be painted on the segment just after reflection, and not on the segment before
it. We assume that this is quite natural: an event at the beginning of a
segment changes its color (“behavior”) after the event has occured.
One
case where color criteria proved to be useful in the design of an optical
system was the design of a light guiding plate for a push-button cell phone.
This plate is made of transparent plastic and is used as a light guide to illuminate
the buttons. It had perforations and edges of a certain shape located in
certain places. All these elements are intended to split the light from two
LEDs into several beams and direct them to the phone button areas.
Fig. 1. Visualization
of rays hitting the “4” button (orange) and the “7” button (green).
Lighting
simulation of this plate found insufficient illumination of the button with the
number “4”. Although it is located in the second row, closer to the LEDs, it
was lit less than the buttons of the third row which are further away from the
light sources. This was most noticeable when comparing this button with the
adjacent “7” button. This problem first appeared when rendering the built
model, but was later confirmed using analysis of propagation of rays by visualizing
them with a color criterion. The criteria were as following: the rays hitting
the “4” button were painted orange; the rays hitting the ‘7’ button were
painted green (Fig. 1). All other rays were hidden using the general ray
display criterion. In Fig. 1 one can see that number of rays hitting the “4”
button is noticeably less than number of rays hitting the “7” button.
Further
analysis has shown that the reason of such behavior is shape and size of the
cutouts which are located on the side of the phone keyboard marked by digits 1
and 2 in the Fig. 2. These cutouts should reflect rays which then should hit
lower button rows. As it was discovered, after reflection from the upper cutout
(number 1) most of rays didn’t reflect from the lower cutout (number 2) and hit
the “4” button. But they propagated further and hit the “7” button in different
ways.
To check this hypothesis, the following criterion
had been built: rays hit the lower cutout (number 2) were painted orange, while
the rest of rays were painted green. Also the general display criterion was:
only rays which hit the upper cutout (number 1) are shown. Result of these criteria
application can be seen in Fig. 2.
Fig.
2. Upper and lower cutouts of the light-guiding plate.
Enlarging
the lower cutout (number 2) with simultaneous reduction of the upper cutout (number
1) corrected the behavior of the light rays. As a result the illumination of
all buttons becomes more uniform.
Next
example of use of the color criteria is design of the headlight of a
motorcycle. Here color criteria help to evaluate many design parameters.
First, the
visualization of the colored rays is useful for basic headlight reflector efficiency
analysis. For the purpose of this analysis, a virtual measurement device
(called an observer) was placed at some distance from the headlight. This
observer is an analogue of a real screen which is used to calibrate the
headlight beam. After applying the color criterion where rays which hit this
observer were painted orange and the rest of rays were painted green, the
effectiveness of the headlight reflector can be visually assessed. Result can
be seen in Fig. 3.
Fig. 3. Evaluation
of the headlight efficiency.
By
the comparative number of orange and green rays, it is possible to evaluate the
overall efficiency of the headlight reflector and by the prevailed directions
of the diverged rays, one can understand in which direction the light beam has shifted
the most.
It
should be noted that there is a red ray in Fig. 3 and this color was not
specified by the user. It indicates the “killed” rays, i.e. undesirable rays
caused by errors in the object model or in the simulation algorithm.
To
clarify the reasons of the appearance of the diverged rays, an additional color
criterion was built. This time per-segment coloring mode was selected. The segments
after reflection from the headlight reflector were painted purple while all
other segments and rays were painted green. Also the general display criterion
was set: only rays that did not hit the observer were shown. The result of ray
visualization with these criteria is shown in Fig. 4.
Fig. 4.
Reflected segments painted with purple color.
It
should be noted that a sufficiently large number of rays hit reflector
undergoes secondary reflection of the rays from the reflector sides. This can
be seen from the number of purple segments followed one after another: most
often they are two or three in one ray. In order to reduce the number of such
rays and so increase the efficiency of the reflector, its shape was slightly
changed in some places; in particular, the shape and size of its fillets.
One
more additional efficiency test for the headlight was the analysis of absorbed
rays. The analysis consists of estimation of their number in relation to the
number of all rays emitted from the lamp bulb, as well as their allocation and determination
of the reasons of their appearance. On Fig. 5 the absorbed rays are highlighted
in blue while the rest of rays are colored green.
Fig. 5.
Visualization of absorbed rays (in blue).
One
can see that the total amount of absorbed rays is very small, and they are
concentrated mostly near the lamp mount. It is an acceptable situation and no further
improvement is required in such a case.
The
last considered example of the use of color criteria is analysis of the
parameters of the photo camera lens system. As in the previous case, the first
test to be carried out is a general check of the lens system efficiency. To do
this, the following color criterion was created: rays hit the last lens at the exit
from the system were painted orange and the remaining rays were painted green.
The test showed that the relative number of rays that did not pass the required
path is very small, which indicates the correct design of the lens system as a
whole. This can be seen in Fig. 6.
Fig. 6.
Efficiency test of the lens system
But
additionally it was needed to find the main reasons for the appearance of rays that
did not pass the required trajectory till the end. There can be two such
reasons: either absorption or secondary reflection of the ray and exit back
through the entrance lens. The second case requires special attention because
it can lead to the appearance of glare which would significantly degrade the quality
of the lens system [12, 13]. To identify such cases the following coloring
criterion was constructed: the absorbed rays were painted purple and the secondary
reflected rays were painted green. At the same time, a general ray display
criterion was established, according to which only rays that did not pass the exit
lens were displayed. Thus, all displayed rays except absorbed ones should pass
back through the entrance lens. As a result of this test, excessive amount of
such rays was found, as seen in Fig. 7.
Fig. 7.
Rays which haven’t passed through the outlet lens
Since
such a phenomenon is highly undesirable, it is necessary to find and eliminate its
reason. For this, an additional color criterion was built using per-segment
coloring mode. The criterion condition was reflection from any lens. This lens
system includes many lenses, so it was easier to set the event type (specular
reflection or Fresnel reflection) rather than specific objects as a criterion
condition. At the same time, a general display criterion was set to: only rays
which have not passed through the exit lens and are not absorbed are shown. The
result is shown in Fig. 8.
Fig. 8.
Not absorbed rays that have not passed through the exit lens
It
can be seen here that most of the reflections took place just on the first
lens. Therefore, two ways were used to improve the characteristics of the lens system:
changing of the material of the entrance lens, as well as increasing the size
of the light shield around it.
Light
ray visualization is a powerful instrument for analyzing optical systems. The ability
to display rays using color criteria makes this analysis more efficient. This
provides a faster and easier search for errors made in the design of such
systems. The efficiency of the proposed method has been tested on the design of
many different optical systems, including lens systems, light guides and
backlights, lighting devices with reflectors, and so on.
The role of color in the ray visualization technique is
significant. Coloring of the visualized rays or their segments according to the
conditions specified by the designer allows you to quickly conduct a
qualitative analysis of the optical system under development. The use of this
technique significantly speeds up the complex and time-consuming process of the
design of the optical systems.
1.
Pharr
M., Humphreys G., Physically Based Rendering, Elsevier, 2004.
2.
Wernert
E. A unified environment for presenting, developing and analyzing graphics
algorithms // Computer Graphics, 31(3), 1997, pp. 26-28.
3.
Kopylov
E.A., Dmitriev K.A. Light propagation visualization as a tool for 3D scene analysis
in lighting design, Computers & Graphics, 24(1), 2000, pp. 31-39.
4.
Reshidko,
D.,
Sasian, J.,
A
method for the design of unsymmetrical optical systems using freeform surfaces,
Proceedings of SPIE
10590,
International Optical Design
Conference (IODC),
UNSP 105900V,
2017. DOI: 10.1117/12.2285134
5.
Bogdanov N.N., Zhdanov A.D., Zhdanov D.D., Potyomin I.S.,
Analysis of Errors in the Relief of Scattering Microstructires in
Light-conducting Systems Modelling
// Light & Engineering,
26(3), 2018, pp. 22-28.
6.
Andrey Zhdanov, Dmitry Zhdanov, Vadim Sokolov, Igor Potemin,
Sergey Ershov, Vladimir Galaktionov. Problems of the realistic image synthesis
in media with a gradient index of refraction // Proc. SPIE 11548, Optical
Design and Testing X, 115480W, 2020. DOI: 10.1117/12.2574159
7.
Barladyan
B. Kh., Birukov E.D., Shapiro L.Z., Voloboy A.G., Visualization of ray
propagation in physically accurate lighting simulation // Scientific
Visualization, 10(4), 2018, pp. 75-92,
DOI: 10.26583/sv.10.4.06
8.
Barladian B.Kh., Voloboy A.G., Galaktionov V.A., and Shapiro L.Z., Integration
of Realistic Computer Graphics into Computer-Aided Design and Product Lifecycle
Management Systems // Programming and Computer Software, 44(4), 2018, pp.
225–232. DOI:
10.1134/S0361768818040047
9.
Birukov
E.D., Ryzhova I.G., Voloboy A.G. Usage of Color During Visualization of Rays
Propagation Simulated with Monte-Carlo Method // CEUR Workshop Proceedings, V.
3027, pp. 399-405. Proceedings of the 31st International Conference on Computer
Graphics and Vision (GraphiCon 2021), Nizhniy Novgorog, Russia, 2021. DOI:
10.20948/graphicon-2021-3027-399-405
10.
Zhdanov D.D., Garbul A.A., Maǐorov
V.A., Potemin I.S., Sokolov V.G.,
Indeterminate ray tracing in problems
of the analysis of light scattering and the design of illuminating systems,
Journal
of Optical Technology. 81(6), 2014, pp. 322-326.
11.
Barladian B.Kh., Birukov E.D., Shapiro L.Z.,
Voloboy A.G. Effective algorithm for visualization of the pre-calculated rays
//Proceedings of the 28th International Conference on Computer Graphics and
Vision GraphiCon 2018, Tomsk, Russia, 2018, pp. 36-39.
12.
Raut H.K., Ganesh V.A., Nairb A.S., Ramakrishna S.
Anti-reflective coatings: A critical, in-depth review. Energy &
Environmental Science, 4(10), 2011, pp. 3779–3804, DOI: 10.1039/c1ee01297e.
13.
Jun-Chao Z., Li-Min X., Ming F., Hong-Bo H. Wide-angle
and broadband graded-refractive-index antireflection coatings. Chinese Physics
B. 22 (4): 044201, 2013. DOI: 10.1088/1674-1056/22/4/04420