<?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%3ASlope_Pattern</id>
	<title>Reference:Slope Pattern - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.povray.org/content?action=history&amp;feed=atom&amp;title=Reference%3ASlope_Pattern"/>
	<link rel="alternate" type="text/html" href="https://wiki.povray.org/content?title=Reference:Slope_Pattern&amp;action=history"/>
	<updated>2026-10-09T07:09:35Z</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:Slope_Pattern&amp;diff=10250&amp;oldid=prev</id>
		<title>Jholsenback: technical correction</title>
		<link rel="alternate" type="text/html" href="https://wiki.povray.org/content?title=Reference:Slope_Pattern&amp;diff=10250&amp;oldid=prev"/>
		<updated>2020-04-12T17:47:23Z</updated>

		<summary type="html">&lt;p&gt;technical correction&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:47, 12 April 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l9&quot; &gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;The &amp;lt;code&amp;gt;slope&amp;lt;/code&amp;gt; pattern uses the normal of a surface to calculate the slope&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;The &amp;lt;code&amp;gt;slope&amp;lt;/code&amp;gt; pattern uses the normal of a surface to calculate the slope&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;at a given point. It then creates the pattern value dependent on the slope and optionally&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;at a given point. It then creates the pattern value dependent on the slope and optionally&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;the altitude. It can be used for pigments, normals and textures, but not for media densities.For pigments the syntax is:&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;the altitude. It can be used for pigments, normals and textures, but not for media densities &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;or functions&lt;/ins&gt;. For pigments the syntax is:&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;pigment {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;pigment {&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:Slope_Pattern&amp;diff=7032&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:Slope_Pattern&amp;diff=7032&amp;oldid=prev"/>
		<updated>2012-03-15T19:08:48Z</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:Slope_Pattern&amp;diff=7031&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:Slope_Pattern&amp;diff=7031&amp;oldid=prev"/>
		<updated>2012-03-11T22:28:07Z</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:Patterns]]&lt;br /&gt;
{{#indexentry:altitude}}&lt;br /&gt;
{{#indexentry:slope, keyword}}&lt;br /&gt;
{{#indexentry:slope, pattern}}&lt;br /&gt;
{{#indexentry:keyword, slope}}&lt;br /&gt;
{{#indexentry:pattern, slope}} &lt;br /&gt;
{{#indexentry:altitude, slope}}&lt;br /&gt;
{{#indexentry:keyword, altitude}}&lt;br /&gt;
&amp;lt;p&amp;gt;The &amp;lt;code&amp;gt;slope&amp;lt;/code&amp;gt; pattern uses the normal of a surface to calculate the slope&lt;br /&gt;
at a given point. It then creates the pattern value dependent on the slope and optionally&lt;br /&gt;
the altitude. It can be used for pigments, normals and textures, but not for media densities.For pigments the syntax is:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pigment {&lt;br /&gt;
  slope {&lt;br /&gt;
    &amp;amp;lt;Direction&amp;amp;gt; [, Lo_slope, Hi_slope ]&lt;br /&gt;
    [ altitude &amp;amp;lt;Altitude&amp;amp;gt; [, Lo_alt, Hi_alt ]]&lt;br /&gt;
    }&lt;br /&gt;
  [PIGMENT_MODIFIERS...]&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The slope value at a given point is dependent on the angle between the &amp;lt;code&amp;gt;&amp;amp;lt;Direction&amp;amp;gt;&amp;lt;/code&amp;gt; vector and the normal of the surface at that point.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;For example:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; When the surface normal points in the opposite direction of the &amp;lt;code&amp;gt;&amp;amp;lt;Direction&amp;amp;gt;&amp;lt;/code&amp;gt; vector (180 degrees), the slope is 0.0.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; When the surface normal is perpendicular to the &amp;lt;code&amp;gt;&amp;amp;lt;Direction&amp;amp;gt;&amp;lt;/code&amp;gt; vector (90 degrees), the slope is 0.5.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; When the surface normal is parallel to the &amp;lt;code&amp;gt;&amp;amp;lt;Direction&amp;amp;gt;&amp;lt;/code&amp;gt; vector (0 degrees), the slope is 1.0.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;When using the simplest variant of the syntax:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
slope { &amp;amp;lt;Direction&amp;amp;gt; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;the pattern value for a given point is the same as the slope value. &amp;lt;code&amp;gt;&amp;amp;lt;Direction&amp;amp;gt;&amp;lt;/code&amp;gt; is a 3-D vector and will usually be &amp;lt;code&amp;gt;&amp;amp;lt;0,-1,0&amp;amp;gt;&amp;lt;/code&amp;gt; for landscapes, but any direction can be used.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;By specifying &amp;lt;code&amp;gt;Lo_slope&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Hi_slope&amp;lt;/code&amp;gt; you get more control:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
slope { &amp;amp;lt;Direction&amp;amp;gt;, Lo_slope, Hi_slope }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;Lo_slope&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Hi_slope&amp;lt;/code&amp;gt; specifies which range of slopes are used, so you can control which slope values return which pattern values. &amp;lt;code&amp;gt;Lo_slope&amp;lt;/code&amp;gt; is the slope value that returns 0.0 and &amp;lt;code&amp;gt;Hi_slope&amp;lt;/code&amp;gt; is the slope value that returns 1.0.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;For example, if you have a height_field and &amp;lt;code&amp;gt;&amp;amp;lt;Direction&amp;amp;gt;&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;&amp;amp;lt;0,-1,0&amp;amp;gt;&amp;lt;/code&amp;gt;, then the slope values would only range from 0.0 to 0.5 because height_fields cannot have overhangs. If you do not specify &amp;lt;code&amp;gt;Lo_slope&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Hi_slope&amp;lt;/code&amp;gt;, you should keep in mind that the texture for the flat (horizontal) areas must be set at 0.0 and the texture for the steep (vertical) areas at 0.5 when designing the texture_map. The part from 0.5 up to 1.0 is not used then. But, by setting &amp;lt;code&amp;gt;Lo_slope&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Hi_slope&amp;lt;/code&amp;gt; to 0.0 and 0.5 respectively, the slope range will be stretched over the entire map, and the texture_map can then be defined from 0.0 to 1.0.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;By adding an optional &amp;lt;code&amp;gt;&amp;amp;lt;Altitude&amp;amp;gt;&amp;lt;/code&amp;gt; vector:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
slope {&lt;br /&gt;
  &amp;amp;lt;Direction&amp;amp;gt;&lt;br /&gt;
  altitude &amp;amp;lt;Altitude&amp;amp;gt;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;the pattern will be influenced not only by the slope but also by a special gradient. &amp;lt;code&amp;gt;&amp;amp;lt;Altitude&amp;amp;gt;&amp;lt;/code&amp;gt; is a  3-D vector that specifies the direction of the gradient. When &amp;lt;code&amp;gt;&amp;amp;lt;Altitude&amp;amp;gt;&amp;lt;/code&amp;gt; is specified, the pattern value is a weighted average of the slope value and the gradient value. The weights are the lengths of the vectors &amp;lt;code&amp;gt;&amp;amp;lt;Direction&amp;amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;lt;Altitude&amp;amp;gt;&amp;lt;/code&amp;gt;. So if &amp;lt;code&amp;gt;&amp;amp;lt;Direction&amp;amp;gt;&amp;lt;/code&amp;gt; is much longer than &amp;lt;code&amp;gt;&amp;amp;lt;Altitude&amp;amp;gt;&amp;lt;/code&amp;gt; it means that the slope has greater effect on the results than the gradient. If on the other hand &amp;lt;code&amp;gt;&amp;amp;lt;Altitude&amp;amp;gt;&amp;lt;/code&amp;gt; is longer, it means that the gradient has more effect on the results than the slope.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;When adding the &amp;lt;code&amp;gt;&amp;amp;lt;Altitude&amp;amp;gt;&amp;lt;/code&amp;gt; vector, the default gradient is defined from 0 to 1 units along the specified axis. This is fine when your object is defined within this range, otherwise a correction is needed. This can be done with the optional &amp;lt;code&amp;gt;Lo_alt&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Hi_alt&amp;lt;/code&amp;gt; parameters:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
slope {&lt;br /&gt;
  &amp;amp;lt;Direction&amp;amp;gt;&lt;br /&gt;
  altitude &amp;amp;lt;Altitude&amp;amp;gt;, Lo_alt, Hi_alt&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;They define the range of the gradient along the axis defined by the &amp;amp;lt;Altitude&amp;amp;gt; vector.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;For example, with an &amp;lt;code&amp;gt;&amp;amp;lt;Altitude&amp;amp;gt;&amp;lt;/code&amp;gt; vector set to y and an object going from -3 to 2 on &lt;br /&gt;
the y axis, the &amp;lt;code&amp;gt;Lo_alt&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Hi_alt&amp;lt;/code&amp;gt; parameters should be set to -3 and 2 respectively.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p class=&amp;quot;Note&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; You should be aware of the following pitfalls when using the &amp;lt;code&amp;gt;slope&amp;lt;/code&amp;gt; pattern.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;You may use the turbulence keyword inside slope pattern definitions but it may cause unexpected results. Turbulence is a 3-D distortion of a pattern. Since slope is only defined on surfaces of objects, a 3-D turbulence is not applicable to the slope component. However, if you are using altitude, the altitude component of the pattern will be affected by turbulence.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;If your object is larger than the range of altitude you have specified, you may experience unexpected discontinuities. In that case it is best to adjust the &amp;lt;code&amp;gt;Lo_alt&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Hi_alt&amp;lt;/code&amp;gt; values so they fit to your object.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The slope pattern does not work for the sky_sphere, because the sky_sphere is a background feature and does not have a surface. similarly, it does not work for media densities.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;As of version 3.7 the &amp;lt;code&amp;gt;slope&amp;lt;/code&amp;gt; pattern has been  extended to specify a reference point instead of a direction; the new syntax variant is as follows:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
slope {&lt;br /&gt;
  point_at &amp;amp;lt;ReferencePoint&amp;amp;gt; [, Lo_Slope, Hi_Slope ]&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p class=&amp;quot;Note&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; This variant currently does &amp;lt;em&amp;gt;not&amp;lt;/em&amp;gt; allow for the &amp;lt;code&amp;gt;altitude&amp;lt;/code&amp;gt; keyword to be used.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The functionality is similar to MegaPOV's &amp;lt;code&amp;gt;aoi &amp;amp;lt;ReferencePoint&amp;amp;gt;&amp;lt;/code&amp;gt; pattern, except that the values are reversed, i.e. range from 0.0 for surfaces facing away from the point in question, to 1.0 for surfaces facing towards that point; thus, &amp;lt;code&amp;gt;slope { &amp;amp;lt;Vector&amp;amp;gt; }&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;slope { point_at &amp;amp;lt;Vector&amp;amp;gt;*VeryLargeNumber }&amp;lt;/code&amp;gt; have virtually the same effect.&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jholsenback</name></author>
	</entry>
</feed>