<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.povray.org/content?action=history&amp;feed=atom&amp;title=Reference%3ARainbow</id>
	<title>Reference:Rainbow - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.povray.org/content?action=history&amp;feed=atom&amp;title=Reference%3ARainbow"/>
	<link rel="alternate" type="text/html" href="https://wiki.povray.org/content?title=Reference:Rainbow&amp;action=history"/>
	<updated>2026-04-06T16:31:04Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.povray.org/content?title=Reference:Rainbow&amp;diff=7006&amp;oldid=prev</id>
		<title>Jholsenback: 1 revision: Reference Migration Initial Load</title>
		<link rel="alternate" type="text/html" href="https://wiki.povray.org/content?title=Reference:Rainbow&amp;diff=7006&amp;oldid=prev"/>
		<updated>2012-03-15T19:08:42Z</updated>

		<summary type="html">&lt;p&gt;1 revision: Reference Migration Initial Load&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:08, 15 March 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Jholsenback</name></author>
	</entry>
	<entry>
		<id>https://wiki.povray.org/content?title=Reference:Rainbow&amp;diff=7005&amp;oldid=prev</id>
		<title>Jholsenback: 1 revision: Initial Load (TF)</title>
		<link rel="alternate" type="text/html" href="https://wiki.povray.org/content?title=Reference:Rainbow&amp;diff=7005&amp;oldid=prev"/>
		<updated>2012-03-11T22:25:11Z</updated>

		<summary type="html">&lt;p&gt;1 revision: Initial Load (TF)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Atmospheric Effects]]&lt;br /&gt;
{{#indexentry:rainbow, keyword}}&lt;br /&gt;
{{#indexentry:keyword, rainbow}}&lt;br /&gt;
&amp;lt;p&amp;gt;Rainbows are implemented using fog-like, circular arcs. Their syntax&lt;br /&gt;
is:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RAINBOW:&lt;br /&gt;
  rainbow { [RAINBOW_IDENTIFIER] [RAINBOW_ITEMS...] }&lt;br /&gt;
RAINBOW_ITEM:&lt;br /&gt;
  direction &amp;amp;lt;Dir&amp;amp;gt; | angle Angle | width Width |&lt;br /&gt;
  distance Distance | COLOR_MAP | jitter Jitter | up &amp;amp;lt;Up&amp;amp;gt; |&lt;br /&gt;
  arc_angle Arc_Angle | falloff_angle Falloff_Angle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{#indexentry:default values, rainbow}}&lt;br /&gt;
&amp;lt;p&amp;gt;Rainbow default values:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
arc_angle     : 180.0&lt;br /&gt;
falloff_angle : 180.0&lt;br /&gt;
jitter        : 0.0&lt;br /&gt;
up            : y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{#indexentry:direction, rainbow}}&lt;br /&gt;
{{#indexentry:keyword, direction}} &lt;br /&gt;
{{#indexentry:angle, rainbow}}&lt;br /&gt;
{{#indexentry:keyword, angle}} &lt;br /&gt;
{{#indexentry:width, rainbow}}&lt;br /&gt;
{{#indexentry:keyword, width}}&lt;br /&gt;
&amp;lt;p&amp;gt;The required &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; vector determines the direction of the&lt;br /&gt;
(virtual) light that is responsible for the rainbow. Ideally this is an&lt;br /&gt;
infinitely far away light source like the sun that emits parallel light rays.&lt;br /&gt;
The position and size of the rainbow are specified by the required &amp;lt;code&amp;gt;angle&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;width&amp;lt;/code&amp;gt; keywords. To understand how they work you should &lt;br /&gt;
first know how the rainbow is calculated.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
For each ray the angle between the rainbow's direction vector and the&lt;br /&gt;
ray's direction vector is calculated. If this angle lies in the interval&lt;br /&gt;
from &amp;lt;em&amp;gt;&amp;lt;code&amp;gt; Angle-Width/2&amp;lt;/code&amp;gt;&amp;lt;/em&amp;gt; to &amp;lt;em&amp;gt;&amp;lt;code&amp;gt;&lt;br /&gt;
Angle+Width/2&amp;lt;/code&amp;gt;&amp;lt;/em&amp;gt; the rainbow is hit by the ray. The color is then&lt;br /&gt;
determined by using the angle as an index into the rainbow's color_map.&lt;br /&gt;
After the color has been determined it will be mixed with the background&lt;br /&gt;
color in the same way like it is done for fogs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{#indexentry:jitter, rainbow}}&lt;br /&gt;
{{#indexentry:keyword, jitter}}  &lt;br /&gt;
&amp;lt;p&amp;gt;Thus the angle and width parameters determine the angles under which the&lt;br /&gt;
rainbow will be seen. The optional &amp;lt;code&amp;gt; jitter&amp;lt;/code&amp;gt; keyword can be used&lt;br /&gt;
to add random noise to the index. This adds some irregularity to the rainbow&lt;br /&gt;
that makes it look more realistic.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{#indexentry:distance, rainbow}}&lt;br /&gt;
{{#indexentry:keyword, distance}}&lt;br /&gt;
&amp;lt;p&amp;gt;The required &amp;lt;code&amp;gt;distance&amp;lt;/code&amp;gt; keyword is the same like the one used&lt;br /&gt;
with fogs. Since the rainbow is a fog-like effect it is possible that the&lt;br /&gt;
rainbow is noticeable on objects. If this effect is not wanted it can be&lt;br /&gt;
avoided by using a large distance value. By default a sufficiently large&lt;br /&gt;
value is used to make sure that this effect does not occur.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{#indexentry:color_map, rainbow}}&lt;br /&gt;
&amp;lt;p&amp;gt;The &amp;lt;code&amp;gt;color_map&amp;lt;/code&amp;gt; statement is used to assign a color map that&lt;br /&gt;
will be mapped onto the rainbow. To be able to create realistic rainbows it&lt;br /&gt;
is important to know that the index into the color map increases with the&lt;br /&gt;
angle between the ray's and rainbow's direction vector. The index is&lt;br /&gt;
zero at the innermost ring and one at the outermost ring. The filter and&lt;br /&gt;
transmittance values of the colors in the color map have the same meaning as&lt;br /&gt;
the ones used with fogs (see the section [[Reference:Fog|:Fog|Fog]]).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The default rainbow is a 360 degree arc that looks like a circle. This is no&lt;br /&gt;
problem as long as you have a ground plane that hides the lower, non-visible&lt;br /&gt;
part of the rainbow. If this is not the case or if you do not want the&lt;br /&gt;
full arc to be visible you can use the optional keywords &amp;lt;code&amp;gt;up&amp;lt;/code&amp;gt;,&lt;br /&gt;
&amp;lt;code&amp;gt; arc_angle&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;falloff_angle&amp;lt;/code&amp;gt; to specify a smaller&lt;br /&gt;
arc.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{#indexentry:arc_angle, rainbow}}&lt;br /&gt;
{{#indexentry:keyword, arc_angle}} &lt;br /&gt;
{{#indexentry:falloff_angle, rainbow}}&lt;br /&gt;
{{#indexentry:keyword, falloff_angle}}&lt;br /&gt;
&amp;lt;p&amp;gt;The &amp;lt;code&amp;gt;arc_angle&amp;lt;/code&amp;gt; keyword determines the size of the arc in degrees&lt;br /&gt;
(from 0 to 360 degrees). A value smaller than 360 degrees results in an arc&lt;br /&gt;
that abruptly vanishes. Since this does not look nice you can use the&lt;br /&gt;
&amp;lt;code&amp;gt;falloff_angle&amp;lt;/code&amp;gt; keyword to specify a region in which the rainbow&lt;br /&gt;
will smoothly blend into the background making it vanish softly. The falloff&lt;br /&gt;
angle has to be smaller or equal to the arc angle.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{#indexentry:up, rainbow}}&lt;br /&gt;
{{#indexentry:keyword, up}}&lt;br /&gt;
&amp;lt;p&amp;gt;The &amp;lt;code&amp;gt; up&amp;lt;/code&amp;gt; keyword determines were the zero angle position is. By&lt;br /&gt;
changing this vector you can rotate the rainbow about its direction. You&lt;br /&gt;
should note that the arc goes from &amp;lt;em&amp;gt;-Arc_Angle/2&amp;lt;/em&amp;gt; to &amp;lt;em&amp;gt;&lt;br /&gt;
+Arc_Angle/2&amp;lt;/em&amp;gt;. The soft regions go from &amp;lt;em&amp;gt;-Arc_Angle/2&amp;lt;/em&amp;gt; to &amp;lt;em&amp;gt;&lt;br /&gt;
-Falloff_Angle/2&amp;lt;/em&amp;gt; and from &amp;lt;em&amp;gt;+Falloff_Angle/2&amp;lt;/em&amp;gt; to &amp;lt;em&amp;gt;&lt;br /&gt;
+Arc_Angle/2&amp;lt;/em&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The following example generates a 120 degrees rainbow arc that has a falloff&lt;br /&gt;
region of 30 degrees at both ends:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rainbow {&lt;br /&gt;
  direction &amp;amp;lt;0, 0, 1&amp;amp;gt;&lt;br /&gt;
  angle 42.5&lt;br /&gt;
  width 5&lt;br /&gt;
  distance 1000&lt;br /&gt;
  jitter 0.01&lt;br /&gt;
  color_map { Rainbow_Color_Map }&lt;br /&gt;
  up &amp;amp;lt;0, 1, 0&amp;amp;gt;&lt;br /&gt;
  arc_angle 120&lt;br /&gt;
  falloff_angle 30&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;It is possible to use any number of rainbows and to combine them with&lt;br /&gt;
other atmospheric effects.&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jholsenback</name></author>
	</entry>
</feed>