<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://c4engine.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Mathematical_Shader_Processes</id>
	<title>Mathematical Shader Processes - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://c4engine.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Mathematical_Shader_Processes"/>
	<link rel="alternate" type="text/html" href="https://c4engine.com/wiki/index.php?title=Mathematical_Shader_Processes&amp;action=history"/>
	<updated>2026-05-14T19:40:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://c4engine.com/wiki/index.php?title=Mathematical_Shader_Processes&amp;diff=675&amp;oldid=prev</id>
		<title>Eric Lengyel at 06:21, 6 January 2025</title>
		<link rel="alternate" type="text/html" href="https://c4engine.com/wiki/index.php?title=Mathematical_Shader_Processes&amp;diff=675&amp;oldid=prev"/>
		<updated>2025-01-06T06:21:59Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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 06:21, 6 January 2025&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-l12&quot;&gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;{{Process|Cosine|Shader_cos.png|Scalar '''A'''|Scalar|Calculates the cosine of the input '''A''', where the input is measured in radians.}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;{{Process|Cosine|Shader_cos.png|Scalar '''A'''|Scalar|Calculates the cosine of the input '''A''', where the input is measured in radians.}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&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;{{Process|Cross Product|Shader_xpd.png|3D vectors '''A''' and '''B'''|3D vector|Calculates the cross product of the inputs '''A''' and '''B'''.}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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;{{Process|Cross Product|Shader_xpd.png|3D vectors '''A''' and '''B'''|3D vector|Calculates the cross product of the inputs '''A''' and '''B'''&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;If one of the input vectors is in tangent space and the other is in world space, then additional shader code is generated to transform the tangent-space vector into world space before the cross product is evaluated&lt;/ins&gt;.}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;{{Process|Divide|Shader_div.png|Value '''A''', Scalar '''B'''|Value of size matching '''A'''|Calculates the quotient of each component of the input '''A''' and the scalar input '''B'''.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;{{Process|Divide|Shader_div.png|Value '''A''', Scalar '''B'''|Value of size matching '''A'''|Calculates the quotient of each component of the input '''A''' and the scalar input '''B'''.&lt;/div&gt;&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-l18&quot;&gt;Line 18:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 20:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;''Tip:'' If you're dividing by a constant value, then it would be more efficient to multiply by the reciprocal of the constant. For example, you should multiply by 0.5 instead of dividing by 2.0.}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;''Tip:'' If you're dividing by a constant value, then it would be more efficient to multiply by the reciprocal of the constant. For example, you should multiply by 0.5 instead of dividing by 2.0.}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&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;{{Process|Dot Product 3D|Shader_dp3.png|3D vectors '''A''' and '''B'''|Scalar|Calculates the dot product of the inputs '''A''' and '''B'''.}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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;{{Process|Dot Product 3D|Shader_dp3.png|3D vectors '''A''' and '''B'''|Scalar|Calculates the dot product of the inputs '''A''' and '''B'''&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;If one of the input vectors is in tangent space and the other is in world space, then additional shader code is generated to transform the tangent-space vector into world space before the dot product is evaluated&lt;/ins&gt;.}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;{{Process|Dot Product 4D|Shader_dp4.png|4D vectors '''A''' and '''B'''|Scalar|Calculates the dot product of the inputs '''A''' and '''B'''.}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;{{Process|Dot Product 4D|Shader_dp4.png|4D vectors '''A''' and '''B'''|Scalar|Calculates the dot product of the inputs '''A''' and '''B'''.}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Eric Lengyel</name></author>
	</entry>
	<entry>
		<id>https://c4engine.com/wiki/index.php?title=Mathematical_Shader_Processes&amp;diff=646&amp;oldid=prev</id>
		<title>Eric Lengyel at 02:54, 6 January 2025</title>
		<link rel="alternate" type="text/html" href="https://c4engine.com/wiki/index.php?title=Mathematical_Shader_Processes&amp;diff=646&amp;oldid=prev"/>
		<updated>2025-01-06T02:54:54Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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 02:54, 6 January 2025&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-l77&quot;&gt;Line 77:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 77:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;{{Process|Subtract|Shader_sub.png|Values '''A''' and '''B'''|Value of size matching larger of '''A''' and '''B'''|Calculates the componentwise difference of the inputs '''A''' and '''B'''.}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;{{Process|Subtract|Shader_sub.png|Values '''A''' and '''B'''|Value of size matching larger of '''A''' and '''B'''|Calculates the componentwise difference of the inputs '''A''' and '''B'''.}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|-&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Process|Sum of Products|Shader_sumproducts.png|Values '''A''', '''B''', '''C''', and '''D'''|Value of size matching largest of '''A''', '''B''', '''C''', and '''D'''|Calculates the componentwise products of the inputs '''A''' and '''B''' and the componentwise products of the inputs '''C''' and '''D''' and then calculates the componentwise sum of the results.}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;|}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;|}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Eric Lengyel</name></author>
	</entry>
	<entry>
		<id>https://c4engine.com/wiki/index.php?title=Mathematical_Shader_Processes&amp;diff=431&amp;oldid=prev</id>
		<title>Eric Lengyel: Created page with &quot;This is a list of the mathematical shader processes that are available in the Shader Editor under the Math tab.  {| {{Table}} {{Tablehead|Process|Description}} |- {{Process|Absolute Value|Shader_abs.png|Value '''A'''|Value of size matching '''A'''|Calculates the absolute value of each component of the input '''A'''.}} |- {{Process|Add|Shader_add.png|Values '''A''' and '''B'''|Value of size matching larger of '''A''' and '''B'''|Calculates the componentwise sum of the...&quot;</title>
		<link rel="alternate" type="text/html" href="https://c4engine.com/wiki/index.php?title=Mathematical_Shader_Processes&amp;diff=431&amp;oldid=prev"/>
		<updated>2023-07-15T11:58:30Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;This is a list of the mathematical shader processes that are available in the &lt;a href=&quot;/wiki/index.php?title=Shader_Editor&quot; title=&quot;Shader Editor&quot;&gt;Shader Editor&lt;/a&gt; under the Math tab.  {| {{Table}} {{Tablehead|Process|Description}} |- {{Process|Absolute Value|Shader_abs.png|Value &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;|Value of size matching &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;|Calculates the absolute value of each component of the input &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;.}} |- {{Process|Add|Shader_add.png|Values &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;|Value of size matching larger of &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;|Calculates the componentwise sum of the...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This is a list of the mathematical shader processes that are available in the [[Shader Editor]] under the Math tab.&lt;br /&gt;
&lt;br /&gt;
{| {{Table}}&lt;br /&gt;
{{Tablehead|Process|Description}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Absolute Value|Shader_abs.png|Value '''A'''|Value of size matching '''A'''|Calculates the absolute value of each component of the input '''A'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Add|Shader_add.png|Values '''A''' and '''B'''|Value of size matching larger of '''A''' and '''B'''|Calculates the componentwise sum of the inputs '''A''' and '''B'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Average|Shader_avg.png|Values '''A''' and '''B'''|Value of size matching larger of '''A''' and '''B'''|Calculates the componentwise average of the inputs '''A''' and '''B'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Cosine|Shader_cos.png|Scalar '''A'''|Scalar|Calculates the cosine of the input '''A''', where the input is measured in radians.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Cross Product|Shader_xpd.png|3D vectors '''A''' and '''B'''|3D vector|Calculates the cross product of the inputs '''A''' and '''B'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Divide|Shader_div.png|Value '''A''', Scalar '''B'''|Value of size matching '''A'''|Calculates the quotient of each component of the input '''A''' and the scalar input '''B'''.&lt;br /&gt;
&lt;br /&gt;
''Tip:'' If you're dividing by a constant value, then it would be more efficient to multiply by the reciprocal of the constant. For example, you should multiply by 0.5 instead of dividing by 2.0.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Dot Product 3D|Shader_dp3.png|3D vectors '''A''' and '''B'''|Scalar|Calculates the dot product of the inputs '''A''' and '''B'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Dot Product 4D|Shader_dp4.png|4D vectors '''A''' and '''B'''|Scalar|Calculates the dot product of the inputs '''A''' and '''B'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Exp Base 2|Shader_ex2.png|Scalar '''A'''|Scalar|Calculates 2 raised to the power given by the input '''A'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Expand|Shader_expand.png|Value '''A'''|Value of size matching '''A'''|Multiplies each component of the input '''A''' by 2.0 and then subtracts 1.0.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Floor|Shader_flr.png|Value '''A'''|Value of size matching '''A'''|Calculates the floor of each component of the input '''A'''. To calculate a ceiling, negate the input and output of the Floor process.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Fraction|Shader_frc.png|Value '''A'''|Value of size matching '''A'''|Calculates the fraction of each component of the input '''A'''. The fraction of a number is the difference between that number and its floor.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Invert|Shader_invert.png|Value '''A'''|Value of size matching '''A'''|Subtracts each component of the input '''A''' from 1.0.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Linear Interpolate|Shader_lrp.png|Values '''A''', '''B''', and '''t'''|Value of size matching largest of '''A''', '''B''', and '''t'''|Calculates the linear interpolation between the components of '''A''' and '''B''' using the components of the input '''t''' as the interpolation parameter.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Log Base 2|Shader_lg2.png|Scalar '''A'''|Scalar|Calculates the logarithm base 2 of the input '''A'''. If the input is not positive, then the result is undefined.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Magnitude 3D|Shader_magnitude3d.png|3D vector '''A'''|Scalar|Calculates the magnitude of the input '''A'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Maximum|Shader_max.png|Values '''A''' and '''B''' (required), value '''C''' (optional)|Value of size matching larger of '''A''', '''B''', and '''C'''|Calculates the componentwise maximum of the inputs '''A''', '''B''', and '''C'''. If input '''C''' is omitted, then the maximum of only '''A''' and '''B''' is calculated.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Minimum|Shader_min.png|Values '''A''' and '''B''' (required), value '''C''' (optional)|Value of size matching larger of '''A''', '''B''', and '''C'''|Calculates the componentwise minimum of the inputs '''A''', '''B''', and '''C'''. If input '''C''' is omitted, then the minimum of only '''A''' and '''B''' is calculated.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Multiply|Shader_mul.png|Values '''A''' and '''B'''|Value of size matching larger of '''A''' and '''B'''|Calculates the componentwise product of the inputs '''A''' and '''B'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Multiply Add|Shader_mad.png|Values '''A''', '''B''', and '''C'''|Value of size matching largest of '''A''', '''B''', and '''C'''|Calculates the componentwise product of the inputs '''A''' and '''B''' and then adds the components of the input '''C'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Normalize 3D|Shader_normalize3d.png|3D vector '''A'''|3D vector|Normalizes the input '''A'''. If the input is the zero vector, then the result is undefined.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Power|Shader_pow.png|Scalars '''A''' and '''B'''|Scalar|Calculates the input '''A''' raised to the power of the input '''B'''. If the input '''A''' is negative, then the result is undefined. If the input '''A''' is zero and the input '''B''' is not positive, then the result is undefined.&lt;br /&gt;
&lt;br /&gt;
''Tip:'' If you're just squaring a value, then it would be more efficient to multiply the value by itself. That is, you should calculate '''A'''&amp;amp;nbsp;&amp;amp;times;&amp;amp;nbsp;'''A''' using the '''Multiply''' process instead of raising '''A''' to the power of 2.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Reciprocal|Shader_rcp.png|Scalar '''A'''|Scalar|Calculates the reciprocal of the input '''A'''. If the input is zero, then the result is undefined.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Reciprocal Square Root|Shader_rsq.png|Scalar '''A'''|Scalar|Calculates the reciprocal square root of the input '''A'''. If the input is not positive, then the result is undefined.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Round|Shader_round.png|Value '''A'''|Value of size matching '''A'''|Rounds each component of the input '''A''' to the nearest integer.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Saturate|Shader_sat.png|Value '''A'''|Value of size matching '''A'''|Clamps each component of the input '''A''' to the range [0,1].}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Set if Equal|Shader_seq.png|Value '''A''' (required), Value '''B''' (optional)|Value of size matching larger of '''A''' and '''B'''|For each component of the inputs '''A''' and '''B''', the corresponding component of the output is set to 1.0 if the component of '''A''' is equal to the same component of '''B''', and 0.0 otherwise. If input '''B''' is omitted, then it is assumed to be a vector of zeros.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Set if Greater Equal|Shader_sge.png|Value '''A''' (required), Value '''B''' (optional)|Value of size matching larger of '''A''' and '''B'''|For each component of the inputs '''A''' and '''B''', the corresponding component of the output is set to 1.0 if the component of '''A''' is greater than or equal to the same component of '''B''', and 0.0 otherwise. If input '''B''' is omitted, then it is assumed to be a vector of zeros.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Set if Greater Than|Shader_sgt.png|Value '''A''' (required), Value '''B''' (optional)|Value of size matching larger of '''A''' and '''B'''|For each component of the inputs '''A''' and '''B''', the corresponding component of the output is set to 1.0 if the component of '''A''' is greater than the same component of '''B''', and 0.0 otherwise. If input '''B''' is omitted, then it is assumed to be a vector of zeros.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Set if Less Equal|Shader_sle.png|Value '''A''' (required), Value '''B''' (optional)|Value of size matching larger of '''A''' and '''B'''|For each component of the inputs '''A''' and '''B''', the corresponding component of the output is set to 1.0 if the component of '''A''' is less than or equal to the same component of '''B''', and 0.0 otherwise. If input '''B''' is omitted, then it is assumed to be a vector of zeros.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Set of Less Than|Shader_slt.png|Value '''A''' (required), Value '''B''' (optional)|Value of size matching larger of '''A''' and '''B'''|For each component of the inputs '''A''' and '''B''', the corresponding component of the output is set to 1.0 if the component of '''A''' is less than the same component of '''B''', and 0.0 otherwise. If input '''B''' is omitted, then it is assumed to be a vector of zeros.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Set if Not Equal|Shader_sne.png|Value '''A''' (required), Value '''B''' (optional)|Value of size matching larger of '''A''' and '''B'''|For each component of the inputs '''A''' and '''B''', the corresponding component of the output is set to 1.0 if the component of '''A''' is not equal to the same component of '''B''', and 0.0 otherwise. If input '''B''' is omitted, then it is assumed to be a vector of zeros.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Sine|Shader_sin.png|Scalar '''A'''|Scalar|Calculates the sine of the input '''A''', where the input is measured in radians.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Square Root|Shader_sqrt.png|Scalar '''A'''|Scalar|Calculates the square root of the input '''A'''. If the input is negative, then the result is undefined.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Process|Subtract|Shader_sub.png|Values '''A''' and '''B'''|Value of size matching larger of '''A''' and '''B'''|Calculates the componentwise difference of the inputs '''A''' and '''B'''.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Shader Editor]]&lt;br /&gt;
* [[Basic Shader Processes]]&lt;br /&gt;
* [[Complex Shader Processes]]&lt;br /&gt;
* [[Interpolant Shader Processes]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Shaders]]&lt;/div&gt;</summary>
		<author><name>Eric Lengyel</name></author>
	</entry>
</feed>