<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://oxeyegames.com/wiki/skins/common/feed.css?270"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://oxeyegames.com/wiki/index.php?action=history&amp;feed=atom&amp;title=SetMaterial</id>
		<title>SetMaterial - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://oxeyegames.com/wiki/index.php?action=history&amp;feed=atom&amp;title=SetMaterial"/>
		<link rel="alternate" type="text/html" href="http://oxeyegames.com/wiki/index.php?title=SetMaterial&amp;action=history"/>
		<updated>2026-05-18T11:07:23Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.16.0</generator>

	<entry>
		<id>http://oxeyegames.com/wiki/index.php?title=SetMaterial&amp;diff=306&amp;oldid=prev</id>
		<title>Jeb at 20:16, 2 January 2010</title>
		<link rel="alternate" type="text/html" href="http://oxeyegames.com/wiki/index.php?title=SetMaterial&amp;diff=306&amp;oldid=prev"/>
				<updated>2010-01-02T20:16:20Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 20:16, 2 January 2010&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 32:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 32:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;| zwrite || Whether the object should write ''to'' the z buffer. Default is true.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;| zwrite || Whether the object should write ''to'' the z buffer. Default is true.&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&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: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;| materialType || The base material type. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The documentation isn't finished for this setting, but &lt;/del&gt;1 is solid (no transparency), 11 is &amp;quot;add color&amp;quot;, 12 is &amp;quot;texture with alpha values&amp;quot; and 13 is &amp;quot;texture with alpha AND vertex alpha.&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;| materialType || The base material type. 1 is solid (no transparency), 11 is &amp;quot;add color&amp;quot;, 12 is &amp;quot;texture with alpha values&amp;quot; and 13 is &amp;quot;texture with alpha AND vertex alpha.&amp;quot; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;See [[Material Types]].&lt;/ins&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&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: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;| clockwiseCull || Whether culling should be done clockwise or counter-clockwise.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;| clockwiseCull || Whether culling should be done clockwise or counter-clockwise.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Jeb</name></author>	</entry>

	<entry>
		<id>http://oxeyegames.com/wiki/index.php?title=SetMaterial&amp;diff=292&amp;oldid=prev</id>
		<title>Jeb: Created page with '{{VideoMethod | video.setMaterial(materialSettings) | Sets the texture material that will be used for the next set of triangles. | {{MethodParam|materialSettings|A table|A table ...'</title>
		<link rel="alternate" type="text/html" href="http://oxeyegames.com/wiki/index.php?title=SetMaterial&amp;diff=292&amp;oldid=prev"/>
				<updated>2009-12-27T22:22:09Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#39;{{VideoMethod | video.setMaterial(materialSettings) | Sets the texture material that will be used for the next set of triangles. | {{MethodParam|materialSettings|A table|A table ...&amp;#39;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{VideoMethod&lt;br /&gt;
|&lt;br /&gt;
video.setMaterial(materialSettings)&lt;br /&gt;
|&lt;br /&gt;
Sets the texture material that will be used for the next set of triangles.&lt;br /&gt;
|&lt;br /&gt;
{{MethodParam|materialSettings|A table|A table containing the settings, see below.}}&lt;br /&gt;
|&lt;br /&gt;
Returns nothing.&lt;br /&gt;
}}&lt;br /&gt;
=== Table Settings ===&lt;br /&gt;
&lt;br /&gt;
The material settings table contains the settings that should be used for the following triangles. Each setting is set by assigning its name to value in the table, for example&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   { lighting = false }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
means that 3d lighting should be turned off.&lt;br /&gt;
&lt;br /&gt;
All settings are optional.&lt;br /&gt;
&lt;br /&gt;
{| border=2 cellpadding=3 cellspacing=0 style=&amp;quot;margin: 0 0 1em 1em; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#c7c7e0&amp;quot;| '''Setting'''&lt;br /&gt;
|style=&amp;quot;background:#c7c7e0&amp;quot;| '''Description'''&lt;br /&gt;
|-&lt;br /&gt;
| texture || The name of the texture (TGA or JPEG) that should be used. Default is none.&lt;br /&gt;
|-&lt;br /&gt;
| lighting || Whether 3d lighting should be used or not. Default is true.&lt;br /&gt;
|-&lt;br /&gt;
| zbuffer || Whether 3d z buffer should be used or not. Default is true (i.e. pixels that are behind stuff wont be rendered).&lt;br /&gt;
|-&lt;br /&gt;
| zwrite || Whether the object should write ''to'' the z buffer. Default is true.&lt;br /&gt;
|-&lt;br /&gt;
| materialType || The base material type. The documentation isn't finished for this setting, but 1 is solid (no transparency), 11 is &amp;quot;add color&amp;quot;, 12 is &amp;quot;texture with alpha values&amp;quot; and 13 is &amp;quot;texture with alpha AND vertex alpha.&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| clockwiseCull || Whether culling should be done clockwise or counter-clockwise.&lt;br /&gt;
|-&lt;br /&gt;
| mirrorU || Whether textures should be mirrored along the U axis (i.e. when coordinates are outside of 0..1).&lt;br /&gt;
|-&lt;br /&gt;
| mirrorV || Same as mirrorU, but for V coordinates.&lt;br /&gt;
|-&lt;br /&gt;
| aa || Ambient alpha.&lt;br /&gt;
|-&lt;br /&gt;
| ar || Ambient red.&lt;br /&gt;
|-&lt;br /&gt;
| ag || Ambient green.&lt;br /&gt;
|-&lt;br /&gt;
| ab || Ambient blue.&lt;br /&gt;
|-&lt;br /&gt;
| da || Diffuse alpha.&lt;br /&gt;
|-&lt;br /&gt;
| dr || Diffuse red.&lt;br /&gt;
|-&lt;br /&gt;
| dg || Diffuse green.&lt;br /&gt;
|-&lt;br /&gt;
| db || Diffuse blue.&lt;br /&gt;
|-&lt;br /&gt;
| sa || Specular alpha.&lt;br /&gt;
|-&lt;br /&gt;
| sr || Specular red.&lt;br /&gt;
|-&lt;br /&gt;
| sg || Specular green.&lt;br /&gt;
|-&lt;br /&gt;
| sb || Specular blue.&lt;br /&gt;
|-&lt;br /&gt;
| ea || Emissive alpha.&lt;br /&gt;
|-&lt;br /&gt;
| er || Emissive red.&lt;br /&gt;
|-&lt;br /&gt;
| eg || Emissive green.&lt;br /&gt;
|-&lt;br /&gt;
| eb || Emissive blue.&lt;br /&gt;
|-&lt;br /&gt;
| shininess || Shininess (sharpness of specular).&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
&lt;br /&gt;
If you want to use materials for 2d methods, you need to call [[useMaterialFor2d]].&lt;br /&gt;
&lt;br /&gt;
Creating tables on the fly may cause memory leak problems, so it's recommended that you cache your material settings. For example,&lt;br /&gt;
&lt;br /&gt;
'''DON'T'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   local function someRenderMethod()&lt;br /&gt;
      video.setMaterial({ texture = &amp;quot;image.jpg&amp;quot;, lighting = false, materialType = 1 })&lt;br /&gt;
      -- render&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but '''DO'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   local material = { texture = &amp;quot;image.jpg&amp;quot;, lighting = false, materialType = 1 }&lt;br /&gt;
   local function someRenderMethod()&lt;br /&gt;
      video.setMaterial(material)&lt;br /&gt;
      -- render&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jeb</name></author>	</entry>

	</feed>