<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://springrts-wiki.p2004a.com/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ivand</id>
	<title>Spring - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://springrts-wiki.p2004a.com/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ivand"/>
	<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/wiki/Special:Contributions/Ivand"/>
	<updated>2026-11-08T18:24:18Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Roadmap&amp;diff=16023</id>
		<title>Roadmap</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Roadmap&amp;diff=16023"/>
		<updated>2021-05-24T20:16:58Z</updated>

		<summary type="html">&lt;p&gt;Ivand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== release Springlobby x64 ==&lt;br /&gt;
Date: Monday, 21.12.2020&lt;br /&gt;
&lt;br /&gt;
* windows 64 bit will be required&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== release 105.0 ==&lt;br /&gt;
Date: 1.1.2021&lt;br /&gt;
&lt;br /&gt;
(=maintenance branch)&lt;br /&gt;
* official linux build will require glibc &amp;gt;= 2.29&lt;br /&gt;
* No win32 support due to memory limitations&lt;br /&gt;
after this release, only 64 Bit builds will be made. win32 and linux32 builds won&#039;t be made any more and the maintenance branch will be dropped after this release.&lt;br /&gt;
&lt;br /&gt;
== release 105.1 ==&lt;br /&gt;
Date: 01.08.2021(?)&lt;br /&gt;
&lt;br /&gt;
(=transition branch)&lt;br /&gt;
* BAR branch in the essence&lt;br /&gt;
* No breaking changes yet. 99-100% compatible with 105.0.&lt;br /&gt;
* Built, packaged and released on github builder (Ubuntu 18.04) with GCC 10 for Linux and GCC 9.3 MinGW for Windows.&lt;br /&gt;
* Downgrade glibc requirement to what 18.04 uses.&lt;br /&gt;
* Has OpenGL 4.3 grade Lua API for VAO/VBO&lt;br /&gt;
* [Stretch goal] Implement (subset) of GL4 rendering for units and features. No support for CUS?&lt;br /&gt;
Moving on I have no intent to aim for the develop, but instead port develop parts into the transition gradually.&lt;br /&gt;
&lt;br /&gt;
== release 106.0 ==&lt;br /&gt;
Date: ~end of 2021 / Q1 2022(?)&lt;br /&gt;
&lt;br /&gt;
(=follow up on 105.1 codebase)&lt;br /&gt;
* Retain existing (old) OpenGL Lua API for games&lt;br /&gt;
* Implement develop&#039;s renderbuffers or alike with fallback option to earlier OGL 3.0 like caps&lt;br /&gt;
* [Tentative] Remove 3do, FFP rendering mode (no advmapshading, no advunitshading), ARB shaders&lt;br /&gt;
* [Tentative] Possibly remove and redo Custom Unit Shading framework. Replace it with something less disconnected from the rest of the engine draw code. Big design/implementation task, but necessary.&lt;br /&gt;
* Port over develop rendering methods for utility elements: Engine GUI, fonts and alike&lt;br /&gt;
* Implement GL4 rendering for units and features&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Engine Dev]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Roadmap&amp;diff=16022</id>
		<title>Roadmap</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Roadmap&amp;diff=16022"/>
		<updated>2021-05-24T11:15:45Z</updated>

		<summary type="html">&lt;p&gt;Ivand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== release Springlobby x64 ==&lt;br /&gt;
Date: Monday, 21.12.2020&lt;br /&gt;
&lt;br /&gt;
* windows 64 bit will be required&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== release 105.0 ==&lt;br /&gt;
Date: 1.1.2021&lt;br /&gt;
&lt;br /&gt;
(=maintenance branch)&lt;br /&gt;
* official linux build will require glibc &amp;gt;= 2.29&lt;br /&gt;
* No win32 support due to memory limitations&lt;br /&gt;
after this release, only 64 Bit builds will be made. win32 and linux32 builds won&#039;t be made any more and the maintenance branch will be dropped after this release.&lt;br /&gt;
&lt;br /&gt;
== release 105.1 ==&lt;br /&gt;
Date: 01.08.2021(?)&lt;br /&gt;
&lt;br /&gt;
(=transition branch)&lt;br /&gt;
* BAR branch in the essence&lt;br /&gt;
* no breaking changes yet. 99-100% compatible with 105.0.&lt;br /&gt;
* built, packaged and released on github builder (Ubuntu 18.04) with GCC 10 for Linux and GCC 9.3 MinGW for Windows.&lt;br /&gt;
* downgrade glibc requirement to what 18.04 uses.&lt;br /&gt;
* has OpenGL 4.3 grade Lua API for VAO/VBO&lt;br /&gt;
Moving on I have no intent to aim for the develop, but instead port develop parts into the transition gradually.&lt;br /&gt;
&lt;br /&gt;
== release 106.0 ==&lt;br /&gt;
Date: ~end of 2021 / Q1 2022(?)&lt;br /&gt;
&lt;br /&gt;
(=follow up on 105.1 codebase)&lt;br /&gt;
* Retain existing (old) OpenGL Lua API for games&lt;br /&gt;
* Implement develop&#039;s renderbuffers or alike with fallback option to earlier OGL 3.0 like caps&lt;br /&gt;
* [Tentative] Remove 3do, FFP rendering mode (no advmapshading, no advunitshading), ARB shaders&lt;br /&gt;
* [Tentative] Possibly remove and redo Custom Unit Shading framework. Replace it with something less disconnected from the rest of the engine draw code. Big design/implementation task, but necessary.&lt;br /&gt;
* Port over develop rendering methods for utility elements: Engine GUI, fonts and alike&lt;br /&gt;
* Implement GL4 rendering for units and features&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Engine Dev]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Roadmap&amp;diff=16021</id>
		<title>Roadmap</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Roadmap&amp;diff=16021"/>
		<updated>2021-05-24T11:04:13Z</updated>

		<summary type="html">&lt;p&gt;Ivand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== release Springlobby x64 ==&lt;br /&gt;
Date: Monday, 21.12.2020&lt;br /&gt;
&lt;br /&gt;
* windows 64 bit will be required&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== release 105.0 ==&lt;br /&gt;
Date: 1.1.2021&lt;br /&gt;
&lt;br /&gt;
(=maintenance branch)&lt;br /&gt;
* official linux build will require glibc &amp;gt;= 2.29&lt;br /&gt;
* No win32 support due to memory limitations&lt;br /&gt;
after this release, only 64 Bit builds will be made. win32 and linux32 builds won&#039;t be made any more and the maintenance branch will be dropped after this release.&lt;br /&gt;
&lt;br /&gt;
== release 105.1 ==&lt;br /&gt;
Date: 01.09.2021(?)&lt;br /&gt;
&lt;br /&gt;
(=transition branch)&lt;br /&gt;
* BAR branch in the essence&lt;br /&gt;
* no breaking changes yet. 99-100% compatible with 105.0.&lt;br /&gt;
* built, packaged and released on github builder (Ubuntu 18.04) with GCC 10 for Linux and GCC 9.3 MinGW for Windows.&lt;br /&gt;
* downgrade glibc requirement to what 18.04 uses.&lt;br /&gt;
* has OpenGL 4.3 grade Lua API for VAO/VBO&lt;br /&gt;
&lt;br /&gt;
Moving no intent to aim for the develop from my side, instead port develop parts into the transition gradually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Engine Dev]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Roadmap&amp;diff=16020</id>
		<title>Roadmap</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Roadmap&amp;diff=16020"/>
		<updated>2021-05-24T11:00:53Z</updated>

		<summary type="html">&lt;p&gt;Ivand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== release Springlobby x64 ==&lt;br /&gt;
Date: 24.05.2021, by ivand&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== release 105.0 ==&lt;br /&gt;
Date: 1.1.2021&lt;br /&gt;
&lt;br /&gt;
(=maintenance branch)&lt;br /&gt;
* official linux build will require glibc &amp;gt;= 2.29&lt;br /&gt;
* No win32 support due to memory limitations&lt;br /&gt;
after this release, only 64 Bit builds will be made. win32 and linux32 builds won&#039;t be made any more and the maintenance branch will be dropped after this release.&lt;br /&gt;
&lt;br /&gt;
== release 105.1 ==&lt;br /&gt;
Date: 01.09.2021(?)&lt;br /&gt;
&lt;br /&gt;
(=transition branch)&lt;br /&gt;
* BAR branch in the essence&lt;br /&gt;
* no breaking changes yet. 99-100% compatible with 105.0.&lt;br /&gt;
* built, packaged and released on github builder (Ubuntu 18.04) with GCC 10 for Linux and GCC 9.3 MinGW for Windows.&lt;br /&gt;
* downgrade glibc requirement to what 18.04 uses.&lt;br /&gt;
* has OpenGL 4.3 grade Lua API for VAO/VBO&lt;br /&gt;
&lt;br /&gt;
Moving no intent to aim for the develop from my side, instead port develop parts into the transition gradually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Engine Dev]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Deprecated_Lua_GL&amp;diff=5405</id>
		<title>Deprecated Lua GL</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Deprecated_Lua_GL&amp;diff=5405"/>
		<updated>2020-06-19T21:46:14Z</updated>

		<summary type="html">&lt;p&gt;Ivand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* gl.Lighting&lt;br /&gt;
* gl.ShadeModel&lt;br /&gt;
* gl.Fog&lt;br /&gt;
* gl.AlphaTest&lt;br /&gt;
* gl.LineStipple&lt;br /&gt;
* gl.Material&lt;br /&gt;
* gl.LineWidth&lt;br /&gt;
* gl.PointSize&lt;br /&gt;
* gl.PointSprite&lt;br /&gt;
* gl.PointParameter&lt;br /&gt;
* gl.TexEnv&lt;br /&gt;
* gl.MultiTexEnv&lt;br /&gt;
* gl.TexGen&lt;br /&gt;
* gl.MultiTexGen&lt;br /&gt;
* gl.Shape&lt;br /&gt;
* gl.MultiTexCoord&lt;br /&gt;
* gl.SecondaryColor&lt;br /&gt;
* gl.FogCoord&lt;br /&gt;
* gl.EdgeFlag&lt;br /&gt;
* gl.DrawListAtUnit&lt;br /&gt;
* gl.Light&lt;br /&gt;
* gl.ClipPlane&lt;br /&gt;
* gl.CreateList&lt;br /&gt;
* gl.CallList&lt;br /&gt;
* gl.DeleteList&lt;br /&gt;
* gl.GetGlobalTexNames&lt;br /&gt;
* gl.GetGlobalTexCoords&lt;br /&gt;
&lt;br /&gt;
The following calls are emulated for convenience:&lt;br /&gt;
* gl.Color&lt;br /&gt;
* gl.Vertex&lt;br /&gt;
* gl.TexCoord&lt;br /&gt;
* gl.Normal&lt;br /&gt;
&lt;br /&gt;
* gl.BeginEnd will be probably removed, to discourage creation of JIT temporary VAO/VBO&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Potentially matrix functions like Push/Pop/Mode will be removed as well.&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Deprecated_Lua_GL&amp;diff=5404</id>
		<title>Deprecated Lua GL</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Deprecated_Lua_GL&amp;diff=5404"/>
		<updated>2020-06-19T21:45:29Z</updated>

		<summary type="html">&lt;p&gt;Ivand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* gl.Lighting&lt;br /&gt;
* gl.ShadeModel&lt;br /&gt;
* gl.Fog&lt;br /&gt;
* gl.AlphaTest&lt;br /&gt;
* gl.LineStipple&lt;br /&gt;
* gl.Material&lt;br /&gt;
* gl.LineWidth&lt;br /&gt;
* gl.PointSize&lt;br /&gt;
* gl.PointSprite&lt;br /&gt;
* gl.PointParameter&lt;br /&gt;
* gl.TexEnv&lt;br /&gt;
* gl.MultiTexEnv&lt;br /&gt;
* gl.TexGen&lt;br /&gt;
* gl.MultiTexGen&lt;br /&gt;
* gl.Shape&lt;br /&gt;
* gl.MultiTexCoord&lt;br /&gt;
* gl.SecondaryColor&lt;br /&gt;
* gl.FogCoord&lt;br /&gt;
* gl.EdgeFlag&lt;br /&gt;
* gl.DrawListAtUnit&lt;br /&gt;
* gl.Light&lt;br /&gt;
* gl.ClipPlane&lt;br /&gt;
* gl.CreateList&lt;br /&gt;
* gl.CallList&lt;br /&gt;
* gl.DeleteList&lt;br /&gt;
* gl.GetGlobalTexNames&lt;br /&gt;
* gl.GetGlobalTexCoords&lt;br /&gt;
&lt;br /&gt;
The following calls are emulated for convenience:&lt;br /&gt;
* gl.Color&lt;br /&gt;
* gl.Vertex&lt;br /&gt;
* gl.TexCoord&lt;br /&gt;
* gl.Normal&lt;br /&gt;
&lt;br /&gt;
* gl.BeginEnd will be probably removed, to discourage creation of JIT temporary VAO/VBO&lt;br /&gt;
&lt;br /&gt;
* Potentially matrix functions Push/Pop/Mode&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Deprecated_Lua_GL&amp;diff=5403</id>
		<title>Deprecated Lua GL</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Deprecated_Lua_GL&amp;diff=5403"/>
		<updated>2020-06-19T20:15:19Z</updated>

		<summary type="html">&lt;p&gt;Ivand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* gl.Lighting&lt;br /&gt;
* gl.ShadeModel&lt;br /&gt;
* gl.Fog&lt;br /&gt;
* gl.AlphaTest&lt;br /&gt;
* gl.LineStipple&lt;br /&gt;
* gl.Material&lt;br /&gt;
* gl.Color&lt;br /&gt;
* gl.LineWidth&lt;br /&gt;
* gl.PointSize&lt;br /&gt;
* gl.PointSprite&lt;br /&gt;
* gl.PointParameter&lt;br /&gt;
* gl.TexEnv&lt;br /&gt;
* gl.MultiTexEnv&lt;br /&gt;
* gl.TexGen&lt;br /&gt;
* gl.MultiTexGen&lt;br /&gt;
* gl.Shape&lt;br /&gt;
* gl.MultiTexCoord&lt;br /&gt;
* gl.SecondaryColor&lt;br /&gt;
* gl.FogCoord&lt;br /&gt;
* gl.EdgeFlag&lt;br /&gt;
* gl.DrawListAtUnit&lt;br /&gt;
* gl.Light&lt;br /&gt;
* gl.ClipPlane&lt;br /&gt;
* gl.CreateList&lt;br /&gt;
* gl.CallList&lt;br /&gt;
* gl.DeleteList&lt;br /&gt;
* gl.GetGlobalTexNames&lt;br /&gt;
* gl.GetGlobalTexCoords&lt;br /&gt;
&lt;br /&gt;
* gl.BeginEnd will be probably removed, to discourage creation of JIT temporary VAO/VBO&lt;br /&gt;
&lt;br /&gt;
* Potentially matrix functions Push/Pop/Mode&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Deprecated_Lua_GL&amp;diff=5402</id>
		<title>Deprecated Lua GL</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Deprecated_Lua_GL&amp;diff=5402"/>
		<updated>2020-06-19T20:02:53Z</updated>

		<summary type="html">&lt;p&gt;Ivand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* gl.Lighting&lt;br /&gt;
* gl.ShadeModel&lt;br /&gt;
* gl.Fog&lt;br /&gt;
* gl.AlphaTest&lt;br /&gt;
* gl.LineStipple&lt;br /&gt;
* gl.Material&lt;br /&gt;
* gl.Color&lt;br /&gt;
* gl.LineWidth&lt;br /&gt;
* gl.PointSize&lt;br /&gt;
* gl.PointSprite&lt;br /&gt;
* gl.PointParameter&lt;br /&gt;
* gl.TexEnv&lt;br /&gt;
* gl.MultiTexEnv&lt;br /&gt;
* gl.TexGen&lt;br /&gt;
* gl.MultiTexGen&lt;br /&gt;
* gl.Shape&lt;br /&gt;
* gl.MultiTexCoord&lt;br /&gt;
* gl.SecondaryColor&lt;br /&gt;
* gl.FogCoord&lt;br /&gt;
* gl.EdgeFlag&lt;br /&gt;
* gl.DrawListAtUnit&lt;br /&gt;
* gl.Light&lt;br /&gt;
* gl.ClipPlane&lt;br /&gt;
* gl.CreateList&lt;br /&gt;
* gl.CallList&lt;br /&gt;
* gl.DeleteList&lt;br /&gt;
* gl.GetGlobalTexNames&lt;br /&gt;
* gl.GetGlobalTexCoords&lt;br /&gt;
&lt;br /&gt;
* Potentially matrix functions Push/Pop/Mode&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Deprecated_Lua_GL&amp;diff=5401</id>
		<title>Deprecated Lua GL</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Deprecated_Lua_GL&amp;diff=5401"/>
		<updated>2020-06-19T20:01:21Z</updated>

		<summary type="html">&lt;p&gt;Ivand: Created page with &amp;quot;gl.Lighting gl.ShadeModel gl.Fog gl.AlphaTest gl.LineStipple gl.Material gl.Color gl.LineWidth gl.PointSize gl.PointSprite gl.PointParameter gl.TexEnv gl.MultiTexEnv gl.TexGen...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;gl.Lighting&lt;br /&gt;
gl.ShadeModel&lt;br /&gt;
gl.Fog&lt;br /&gt;
gl.AlphaTest&lt;br /&gt;
gl.LineStipple&lt;br /&gt;
gl.Material&lt;br /&gt;
gl.Color&lt;br /&gt;
gl.LineWidth&lt;br /&gt;
gl.PointSize&lt;br /&gt;
gl.PointSprite&lt;br /&gt;
gl.PointParameter&lt;br /&gt;
gl.TexEnv&lt;br /&gt;
gl.MultiTexEnv&lt;br /&gt;
gl.TexGen&lt;br /&gt;
gl.MultiTexGen&lt;br /&gt;
gl.Shape&lt;br /&gt;
gl.MultiTexCoord&lt;br /&gt;
gl.SecondaryColor&lt;br /&gt;
gl.FogCoord&lt;br /&gt;
gl.EdgeFlag&lt;br /&gt;
gl.DrawListAtUnit&lt;br /&gt;
gl.Light&lt;br /&gt;
gl.ClipPlane&lt;br /&gt;
gl.CreateList&lt;br /&gt;
gl.CallList&lt;br /&gt;
gl.DeleteList&lt;br /&gt;
gl.GetGlobalTexNames&lt;br /&gt;
gl.GetGlobalTexCoords&lt;br /&gt;
&lt;br /&gt;
Potentially matrix functions Push/Pop/Mode&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Obtaining_The_Source_Code&amp;diff=23072</id>
		<title>Template:Obtaining The Source Code</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Obtaining_The_Source_Code&amp;diff=23072"/>
		<updated>2020-05-06T16:24:49Z</updated>

		<summary type="html">&lt;p&gt;Ivand: /* Latest Stable (master branch) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Tarballs ===&lt;br /&gt;
&#039;&#039;&#039;(For playing online official games on lobby.springrts.com - the spring lobby server)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{Tarballs}}&lt;br /&gt;
&lt;br /&gt;
=== Git ===&lt;br /&gt;
[https://github.com/spring/spring Spring project page at github]&lt;br /&gt;
&lt;br /&gt;
Master repo URI: &amp;lt;code&amp;gt;{{GitCloneUrl}}&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Backup repo: &amp;lt;code&amp;gt;git://git.code.sf.net/p/springrts/code&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Branches of interest:&lt;br /&gt;
* master - latest stable, enforced for official games on lobby.springrts.com&lt;br /&gt;
* maintenance - fixes for the latest stable&lt;br /&gt;
* develop - major developments (most active, larger developments)&lt;br /&gt;
&lt;br /&gt;
Assuming the GIT command line client is installed, you can clone (get locally) the repository with the commands below.&lt;br /&gt;
&lt;br /&gt;
====Latest Stable (master branch, useless for development purposes, lives as maintenance moving forward)====&lt;br /&gt;
&amp;lt;pre&amp;gt;git clone --recursive git://github.com/spring/spring.git -b master&amp;lt;/pre&amp;gt;&lt;br /&gt;
To later update it (get the changes other people did) with:&lt;br /&gt;
&amp;lt;pre&amp;gt;git pull --rebase&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Maintenance (maintenance branch)====&lt;br /&gt;
&amp;lt;pre&amp;gt;git clone --recursive git://github.com/spring/spring.git -b maintenance&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Bleeding-edge (develop branch)====&lt;br /&gt;
&amp;lt;pre&amp;gt;git clone --recursive git://github.com/spring/spring.git -b develop&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Working with git====&lt;br /&gt;
Please note that patches to the code must be done for either develop or maintenance. Such patches can be then sent to one of the developers with repository access. If you are new to git and github, you may want to have a look at [http://help.github.com/ this guide] to get you started.&lt;br /&gt;
&lt;br /&gt;
Note: you can switch &amp;lt;code&amp;gt;branches&amp;lt;/code&amp;gt; this way:{{code|&lt;br /&gt;
# (optional) backup your current code changes&lt;br /&gt;
git stash&lt;br /&gt;
&lt;br /&gt;
# switch branch&lt;br /&gt;
git checkout $MY_OTHER_BRANCH&lt;br /&gt;
&lt;br /&gt;
# sometimes needed&lt;br /&gt;
# note, it deletes all your unstashed changes and all non-pushed commits on the new branch,&lt;br /&gt;
# but it doesn&#039;t delete untracked files.&lt;br /&gt;
#git reset --hard &lt;br /&gt;
&lt;br /&gt;
# update/sync with remote repo&lt;br /&gt;
git pull --rebase&lt;br /&gt;
&lt;br /&gt;
# (optional) if you want to apply the code changes backed-up in the first step&lt;br /&gt;
#git stash pop # reapplies your changes and DELETES the backup&lt;br /&gt;
# or&lt;br /&gt;
#git stash apply --index 0  # reapplies your changes and keep the backup (see `git stash list`)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Submodules====&lt;br /&gt;
To obtain the submodules you should clone the repository with --recursive as mentioned above.&lt;br /&gt;
If you haven&#039;t done this, you can execute the following code&lt;br /&gt;
{{code|&lt;br /&gt;
git submodule sync&lt;br /&gt;
git submodule update --init&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To update the submodules, you have to execute the same commands again or pull normally.&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11522</id>
		<title>Lua OpenGL Api</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11522"/>
		<updated>2020-03-08T15:58:11Z</updated>

		<summary type="html">&lt;p&gt;Ivand: /* PixelReadback */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
= Spring =&lt;br /&gt;
&#039;&#039;&#039;gl.GetSun&#039;&#039;&#039;&lt;br /&gt;
  &amp;lt;font style=&amp;quot;font-size:90%&amp;quot;&amp;gt;()        -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;pos&amp;quot; ) -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;shadowDensity&amp;quot; [, &amp;quot;unit&amp;quot;] ) -&amp;gt; number shadowDensity&lt;br /&gt;
  ( &amp;quot;diffuse&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;ambient&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;specular&amp;quot;      [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetAtmosphere&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Sun|Spring.SetAtmosphere]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetWaterRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | string texName | number scalar | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetWaterParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMapRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetMapRenderingParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigScreen&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;used for Unit LODs&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number screenWidth, number screenDistance ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawMiniMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;argument new in 0.82+&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;boolean tansform = true&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SlaveMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( boolean mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( int px, int py, int sx, int sy ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetViewSizes&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number x, number y&lt;br /&gt;
&lt;br /&gt;
= Matrices &amp;amp; Viewport =&lt;br /&gt;
&#039;&#039;&#039;gl.Viewport&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;&#039;gl.Translate&#039;&#039;&#039;&lt;br /&gt;
  (number x, number y, number z) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scale&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rotate&#039;&#039;&#039;&lt;br /&gt;
  ( number angle, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Billboard&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Use this to draw 2d primitives in DrawWorld().&lt;br /&gt;
To render a 2D billboarded quad in the gameworld at world position x,y,z, you do the following (at a minimum; I am skipping blending / depthtesting) here:&lt;br /&gt;
  gl.PushMatrix()&lt;br /&gt;
  gl.Texture(read what you need here)&lt;br /&gt;
  gl.Translate(x,y,z)&lt;br /&gt;
  gl.Billboard()			&lt;br /&gt;
  gl.TexRect(x1,y1,x2,y2)&lt;br /&gt;
  gl.PopMatrix()&amp;lt;/span &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MatrixMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#MatrixMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadIdentity&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( 16 numbers or a [https://github.com/spring/spring/blob/develop/rts/Lua/LuaOpenGLUtils.cpp#L60 matrix name] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Ortho&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Frustum&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushPopMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ClipPlane&#039;&#039;&#039;&lt;br /&gt;
  ( int plane, &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: $plane can only be 1 or 2&amp;lt;/font&amp;gt;&lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number A, number B, number C, number D ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Clear =&lt;br /&gt;
&#039;&#039;&#039;gl.Clear&#039;&#039;&#039;&lt;br /&gt;
  ( GL.DEPTH_BUFFER_BIT [, number cleardepth] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.STENCIL_BUFFER_BIT [, int clearstencil] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.COLOR_BUFFER_BIT | GL.ACCUM_BUFFER_BIT [, number r, number g, number b, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SwapBuffers&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Available only in LuaMenu, meant for frame-limited LuaMenu&#039;s that want identical content in both buffers.&lt;br /&gt;
&lt;br /&gt;
= ResetState/Matrices =&lt;br /&gt;
&#039;&#039;&#039;gl.ResetState&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;DON&#039;T USE IT UNLESS YOU KNOW WHAT YOU ARE DOING! Each call-in has different default states, but this function resets all states to the states below no matter what!&amp;lt;/span&amp;gt;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  ShadeModel = GL.SMOOTH&lt;br /&gt;
  Scissor    = false&lt;br /&gt;
  Texture    = false&lt;br /&gt;
  Lighting    = false,&lt;br /&gt;
  ColorMask  = true, true, true, true&lt;br /&gt;
  DepthMask  = false&lt;br /&gt;
  DepthTest  = false  (GL.LEQUAL)&lt;br /&gt;
  Culling    = false  (GL.BACK)&lt;br /&gt;
  LogicOp    = false  (GL.INVERT)&lt;br /&gt;
  AlphaTest  = false  (GL.GREATER, 0.5f)&lt;br /&gt;
  Blending   = true (GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA)&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ResetMatrices&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  Resets GL.TEXTURE matrix stack&lt;br /&gt;
  Resets GL.MODELVIEW matrix stack&lt;br /&gt;
  Resets GL.PROJECTION matrix stack&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Draw Basics =&lt;br /&gt;
&#039;&#039;&#039;gl.BeginEnd&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Drawing_Primitives|GLType]], function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Color&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b[, number a] } |&lt;br /&gt;
      number r, number g, number b[, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Vertex&#039;&#039;&#039;&lt;br /&gt;
  ( { number x, number y [, number z [, number w ]] } |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Normal&#039;&#039;&#039;&lt;br /&gt;
  (  number x, number y, number z |&lt;br /&gt;
   { number x, number y, number z } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rect&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexRect&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;texture rect&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2,&lt;br /&gt;
  [ boolean flip_s, boolean flip_t | number s1, number t1, number s2, number t2 ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Shape&#039;&#039;&#039;&lt;br /&gt;
 ( number [[Lua_ConstGL#Drawing_Primitives|GLtype]],&lt;br /&gt;
   elements = {&lt;br /&gt;
     [1] = { v | vertex   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;required&amp;lt;/font&amp;gt;&lt;br /&gt;
             n | normal   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             t | texcoord = { number x, number y },                     &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             c | color    = { number r, number g, number b, number a }  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
     },&lt;br /&gt;
     etc ...&lt;br /&gt;
   }&lt;br /&gt;
 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SecondaryColor&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b } |&lt;br /&gt;
      number r, number g, number b ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FogCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Display Lists =&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Display Lists save given vertex attributes in a static buffer, so the GPU can directly read them (without the CPU). Display Lists are a lot faster (10-60x) than standard drawing with glShape/glBeginEnd, so try to use them when ever you can. If you want to learn more about them, g00gle is your friend ;)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateList&#039;&#039;&#039;&lt;br /&gt;
  ( function [,arg1 [,arg2...]] ) -&amp;gt; number listID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CallList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Vertex Array Objects =&lt;br /&gt;
&amp;lt;span class=note&amp;gt; &amp;lt;font color=darkblue&amp;gt; Only available in &amp;quot;develop&amp;quot; branch of spring (the future 105.0+). This is conceptually similar and serve as modern OpenGL replacement to deprecated Display Lists. &amp;lt;/font&amp;gt; &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number numElements, number numIndices, [boolean persistentBuffer = false] ) -&amp;gt; number bufferID&lt;br /&gt;
&lt;br /&gt;
See what elements and indices are here: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-9-vbo-indexing/&amp;lt;br&amp;gt;&lt;br /&gt;
numElements and numIndices define the size of for elements and indices respectively. if indices are not going to be used, then set numIndices to 0&amp;lt;br&amp;gt;&lt;br /&gt;
Persistent buffers (persistentBuffer = true) are more efficient for dynamically/often updated geometry.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UpdateVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number bufferID, number elementPos, number indexPos, table tbl | function func ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
{elementPos, indexPos} define starting element in {element, index} VBO corresponding to 1st element of the supplied vertex data&amp;lt;br&amp;gt;&lt;br /&gt;
4 elements table example:&amp;lt;br&amp;gt;&lt;br /&gt;
  local verts = {&lt;br /&gt;
    p  = {0,0,0,1,  4,0,0,1,  4,4,0,1,  0,4,0,1},&lt;br /&gt;
    n  = {0,1,0  ,  0,1,0  ,  0,1,0  ,  0,1,0  },&lt;br /&gt;
    uv = {0,0,0,0,  1,0,0,0,  1,1,0,0,  0,1,0,0},&lt;br /&gt;
    c0 = {1,0,0,1,  0,1,0,1,  0,0,1,1,  1,1,1,0},&lt;br /&gt;
    i = {0, 1, 2, 2, 1, 3},            &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional, use in case of indexed VBO&amp;lt;/font&amp;gt;&lt;br /&gt;
    c1 = {...} }&lt;br /&gt;
&amp;lt;br&amp;gt;Alternatively Lua func can use gl.Vertex/gl.Color/gl.Normal/gl.TexCoord to define vertices, similarly how it used to be done in gl.BeginEnd.Note there is no function yet to define indices.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number bufferID, number primType, [number firstIndex = 0, count = numElements]  ) -&amp;gt; boolean success&lt;br /&gt;
primType can be GL.POINTS, GL.LINE_STRIP, GL.LINE_LOOP, GL.LINES, GL.LINE_STRIP_ADJACENCY, GL.LINES_ADJACENCY, GL.TRIANGLE_STRIP, GL.TRIANGLE_FAN, GL.TRIANGLES, GL.TRIANGLE_STRIP_ADJACENCY, GL.TRIANGLES_ADJACENCY and GL.PATCHES&amp;lt;br&amp;gt;&lt;br /&gt;
firstIndex specifies the starting index in the enabled arrays.&amp;lt;br&amp;gt;&lt;br /&gt;
count specifies the number of indices to be rendered.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteVertexArray&#039;&#039;&#039;&lt;br /&gt;
 ( number bufferID ) -&amp;gt; boolean success&lt;br /&gt;
Releases previously allocated VAO&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Text =&lt;br /&gt;
&#039;&#039;&#039;gl.Text&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;, number x, number y, number size [, string &amp;lt;span class=note&amp;gt;&amp;quot;options&amp;quot;&amp;lt;/span&amp;gt;] )&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
  options are:&lt;br /&gt;
    horizontal alignment:&lt;br /&gt;
       &#039;c&#039; = center&lt;br /&gt;
       &#039;r&#039; = right&lt;br /&gt;
    vertical alignment:&lt;br /&gt;
       &#039;a&#039; = ascender&lt;br /&gt;
       &#039;t&#039; = top&lt;br /&gt;
       &#039;v&#039; = vertical center&lt;br /&gt;
       &#039;x&#039; = baseline&lt;br /&gt;
       &#039;b&#039; = bottom&lt;br /&gt;
       &#039;d&#039; = descender&lt;br /&gt;
    decorations:&lt;br /&gt;
       &#039;o&#039; = black outline&lt;br /&gt;
       &#039;O&#039; = white outline&lt;br /&gt;
       &#039;s&#039; = shadow&lt;br /&gt;
    other:&lt;br /&gt;
       &#039;n&#039; = don&#039;t round vertex coords to nearest integer (font may get blurry)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
http://home.arcor.de/jkei/fontlines.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextWidth&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;) -&amp;gt; number width  &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextHeight&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;text&amp;quot; ) -&amp;gt; nil | number height, number descender, number numlines &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;further descriptions here: [[GetTextHeight]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&amp;lt;b&amp;gt;If you have multiple gl.Text calls, then you can bunch them between a gl.BeginText and gl.EndText to speedup the rendering.&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;gl.BeginText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.EndText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Unit/Feature Draw Functions =&lt;br /&gt;
&#039;&#039;&#039;gl.Unit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws an unit; on default it uses LOD, with lod&amp;lt;0 it is turned off, else it defines a specific level)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitRaw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(doesn&#039;t apply worldspace-&amp;gt;unit transformation! only works if &amp;lt;i&amp;gt;rawdraw&amp;lt;/i&amp;gt; is true )&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShape&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID, number teamID, bool rawState, bool toScreen, bool opaque ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|101.0}} The three extra boolean arguments make it so that calling only these functions is enough to get correctly rendered models; pass in &#039;false&#039; for the THIRD argument to get the fixed behavior, omit it or pass in &#039;true&#039; [default] to render with your own custom state instead. The FOURTH argument should be &#039;true&#039; if in DrawScreen and &#039;false&#039; (default) if in DrawWorld; any transforms for these two functions *MUST* include a gl.LoadIdentity call when argument #3 is false (whether they are used in DrawWorld or in DrawScreen) the FIFTH argument determines whether the model is drawn opaque (&#039;true&#039; [default]) or with translucency (&#039;false&#039;); only has an effect when argument #3 is false.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; unit space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(unit space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPiece&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the unit piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.UnitPieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Feature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureRaw&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShape&#039;&#039;&#039;&lt;br /&gt;
  ( number featureDefID, number teamID, bool custom, bool drawScreen, bool opaque  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; feature space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(feature space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePiece&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the Feature piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.FeaturePieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawListAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number listID, [ boolean midPos,&lt;br /&gt;
      number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
      number degrees, number rotX, number rotX, number rotZ ] ) -&amp;gt; nil &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawFuncAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean midPos, function [, arg1,... ]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= States (Blending,AlphaTest...) =&lt;br /&gt;
&#039;&#039;&#039;gl.Blending&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
  ( string &amp;lt;span class=note&amp;gt;mode&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99&amp;quot; | mode maybe:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.ONE, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha_add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;reset&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;color&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_COLOR, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;modulate&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.DST_COLOR, GL.ZERO&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;disable&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquation&#039;&#039;&#039;&lt;br /&gt;
  ( number mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquationSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number modeRGB, number modeAlpha ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcRGB]], number [[Lua_ConstGL#BlendingFactorDest|dstRGB]],  number [[Lua_ConstGL#BlendingFactorSrc|srcAlpha]], number [[Lua_ConstGL#BlendingFactorDest|dstAlpha]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.AlphaTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]], number threshold ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Culling&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#Culling|face]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthClamp&#039;&#039;&#039;  &amp;lt;span class=warning&amp;gt;not always available, needs GL.NV_depth_clamp!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ColorMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( boolean r, boolean g, boolean b, boolean a ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LogicOp&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#LogicOp|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Fog&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Smoothing&#039;&#039;&#039; {{removed|104.0}}&lt;br /&gt;
 ( (boolean enable | number POINT), &lt;br /&gt;
   (boolean enable | number LINE),&lt;br /&gt;
   (boolean enable | number POLYGON) ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
 ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scissor&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( int x, int y, int w, int h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LineStipple&#039;&#039;&#039;&lt;br /&gt;
  ( string any ) -&amp;gt; nil &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(use springs default line stipple)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
  ( int factor, number pattern ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number [[Lua_ConstGL#PolygonMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonOffset&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number factor, number units ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushAttrib&#039;&#039;&#039;&lt;br /&gt;
  ( [ number [[Lua_ConstGL#glPushAttrib.28.29_bits|attrib]] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopAttrib&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Stencil =&lt;br /&gt;
&#039;&#039;&#039;gl.StencilTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMask&#039;&#039;&#039;&lt;br /&gt;
  ( number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOp&#039;&#039;&#039;&lt;br /&gt;
  ( number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMaskSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOpSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= LineWidth &amp;amp; PointSize =&lt;br /&gt;
&#039;&#039;&#039;gl.LineWidth&#039;&#039;&#039;&lt;br /&gt;
  ( number width ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSize&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(values != 1 can break severely on ATI cards, see http://springrts.com/mantis/view.php?id=2390)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number size ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSprite&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable, [boolean coord_replace, boolean coord_origin_upper] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointParameter&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number v1, number v2, number v3, &lt;br /&gt;
    [ number sizeMin, number sizeMax, number sizeFade ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Textures =&lt;br /&gt;
&#039;&#039;&#039;gl.Texture&#039;&#039;&#039;&lt;br /&gt;
  ( [ number texNum, ] boolean enable | string &amp;lt;span class=note&amp;gt;name&amp;lt;/span&amp;gt; ) -&amp;gt; nil | boolean loaded&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;This is the only call-out that is needed to load and draw any texture in a Lua script. All you have to do is pass it a valid path to a valid png and it will use that image for drawing any subsequent textured rectangles. This is shown in the last line of the following list of valid strings for the name parameter.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99; text-align:left&amp;quot; |`name` may be:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | #12&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 12 buildpic&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %34:1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 34 s3o tex2 (:0-&amp;gt;tex1,:1-&amp;gt;tex2)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %-102:0&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = featureDef 102 s3o tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | !56&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = lua generated texture 56 (= return value of gl.CreateTexture)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units2&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shadow&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = shadowmap&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = specular cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(removed in the latest develop)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $reflection &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = reflection cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(can be mipmaped starting from 104.0.1-714-ga29177f. Set CubeTexGenerateMipMaps=1 in settings)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shading&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = ground shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $grass&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = grass shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $heightmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = heightmap (needs HeightMapTexture=1 set in spring config)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $minimap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = minimap texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = same as &amp;quot;$reflection&amp;quot; {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $sky_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = defined for SSMF maps that have a skyReflectModTex {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = auto generated normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF specular texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_distr&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat distribution texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat normals texture {{new|101.0}}, used as &amp;quot;$ssmf_splat_normals&amp;quot; or &amp;quot;$ssmf_splat_normals:X&amp;quot;, &#039;X&#039; can be a value between 0 and 3, defaults to 0 if &amp;quot;:X&amp;quot; is omitted&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_emission&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF emission texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_parallax&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF parallax texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = currently active info texture (los, airlos, radar, jammer)&amp;lt;br/&amp;gt; Note that textures contain no data until user switches to their respective modes and non-active textures are not updated in the background, so will go stale&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_losmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = los texture (L-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_mtlmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = metal map texture (F4-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_hgtmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = height map texture (F1-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_blkmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = blocking map texture (F2-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the map in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the map in view. {{new|95}} &amp;lt;br/&amp;gt;To translate this to world position coordinates, use:&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;No clip control / clipspace for depth is [-1,1]&#039;&#039;&#039;&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(vec3(gl_TexCoord[0].st, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x) * 2.0 - 1.0, 1.0);&lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;Default if clip control is supported / clipspace for depth is [0,1].&#039;&#039;&#039;&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(gl_TexCoord[0].st * 2.0 - 1.0, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x, 1.0);&lt;br /&gt;
&lt;br /&gt;
  worldpos.xyz = worldpos.xyz / worldpos.w; &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the models in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the models in view.  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | ${opt}:/LuaUI/images/image.png &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = load a texture from the VFS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
   possible ${opt}&#039;s are:&lt;br /&gt;
      &#039;n&#039; = nearest&lt;br /&gt;
      &#039;l&#039; = linear&lt;br /&gt;
      &#039;a&#039; = aniso&lt;br /&gt;
      &#039;i&#039; = invert&lt;br /&gt;
      &#039;g&#039; = greyed&lt;br /&gt;
      &#039;c&#039; = clamped&lt;br /&gt;
      &#039;b&#039; = border&lt;br /&gt;
      &#039;t%r,%g,%b&#039; = tint&lt;br /&gt;
      &#039;r%width,%height&#039; = resize&lt;br /&gt;
   The above ${opt}&#039;s are NOT available for .DDS textures! .dds will load faster than other image formats.&lt;br /&gt;
&lt;br /&gt;
    example: &amp;quot;:iac:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example: &amp;quot;:cr16,16:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example2: &amp;quot;:t1.0,0.5,0:/LuaUI/images/image.png&amp;quot;  (orange tint)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
  [ { &lt;br /&gt;
    [target     = number,] &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(like GL.TEXTURE_1D,GL.TEXTURE_2D,...)&amp;lt;/font&amp;gt; &amp;lt;font color=darkblue&amp;gt; (Added support for GL_TEXTURE_2D_MULTISAMPLE in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [format     = number,]&lt;br /&gt;
    [min_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [mag_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [wrap_s     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_t     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_r     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [aniso      = number,]&lt;br /&gt;
    [border     = boolean,]&lt;br /&gt;
    [fbo        = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [fboDepth   = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [samples    = number,] &amp;lt;font color=darkblue&amp;gt; specify any number here and target = GL_TEXTURE_2D_MULTISAMPLE to create multisample texture (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  } ]&lt;br /&gt;
  ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTexture&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTextureFBO&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TextureInfo&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; nil | {&lt;br /&gt;
      xsize = number,&lt;br /&gt;
      ysize = number,&lt;br /&gt;
      alpha = boolean, //not used yet&lt;br /&gt;
      type  = number,  //not used yet&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
   the format of the texture string is the same as in gl.Texture()&lt;br /&gt;
&amp;lt;/font&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number x | &lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum,&lt;br /&gt;
    number x |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexGen&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexGen&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil       &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CopyToTexture&#039;&#039;&#039;&lt;br /&gt;
  (string texture, int xoff, int yoff, int x, int y, int w, int h &lt;br /&gt;
  [,number target,number level])-&amp;gt;nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderToTexture&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string fbotexture, lua_func ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GenerateMipmap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs glGenerateMipmapEXT!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
The following are primarily intended to be used in conjunction with&lt;br /&gt;
     gl.{Unit,Feature}(objID, ..., raw=true)&lt;br /&gt;
     gl.{Unit,Feature}Shape(defID, ..., raw=true)&lt;br /&gt;
and apply a model&#039;s default textures; easier than gl.Texture(&amp;quot;$%...&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
= PixelReadback =&lt;br /&gt;
&#039;&#039;&#039;gl.SaveImage&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h,&lt;br /&gt;
    string filename [, table {alpha=boolean, yflip=boolean, grayscale16bit=boolean, readbuffer=number} ] ) -&amp;gt; nil | boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;&lt;br /&gt;
grayscale16bit is {{new|99.0}} and allows to save single color 16bit PNG&amp;lt;br&amp;gt;&lt;br /&gt;
readbuffer is {{new|104+}} and allows to choose the attachment of MRT FBO, use GL_COLOR_ATTACHMENT0_EXT and further as index&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ReadPixels&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h [, number format = GL.RGBA ] )&lt;br /&gt;
    -&amp;gt; nil &lt;br /&gt;
    | number r,[g,[b,[a]]] &lt;br /&gt;
    | table { { {1 = number r, 2 = number g, 3 = number b, 4 = number a}, ... }, ... }&lt;br /&gt;
&lt;br /&gt;
= Lights =&lt;br /&gt;
&#039;&#039;&#039;gl.Lighting&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ShadeModel&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#ShadeModel|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Light&#039;&#039;&#039;&lt;br /&gt;
  ( int light, &lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param1, number param2, number param3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Material&#039;&#039;&#039;&lt;br /&gt;
  ({&lt;br /&gt;
    ambient   = {number r, number g, number b[, number a]},&lt;br /&gt;
    diffuse   = {number r, number g, number b[, number a]},&lt;br /&gt;
    ambidiff  = {number r, number g, number b[, number a]},&lt;br /&gt;
    emission  = {number r, number g, number b[, number a]},&lt;br /&gt;
    specular  = {number r, number g, number b[, number a]},&lt;br /&gt;
    shininess = number specularExponent&lt;br /&gt;
  }) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Hardware relevant =&lt;br /&gt;
&#039;&#039;&#039;gl.HasExtension&#039;&#039;&#039;&lt;br /&gt;
  ( string extname ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetNumber&#039;&#039;&#039;&lt;br /&gt;
  ( number ext, int count ) -&amp;gt; number [, number, number, ... #count ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetString&#039;&#039;&#039;&lt;br /&gt;
  ( number ext ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= DrawGroundPrimitives =&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundCircle&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z, number radius, number divs [, number slope ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: number divs is the number of sides the circle will have. the higher the smoother the circle (and more GPU intensive) &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundQuad&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: x1,z1,x2 &amp;amp; z2 are rounded, so don&#039;t use it for very small or moving objects. x and z are correspond to the coordinates displayed by the tooltip &amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number z1, number x2, number z2,&lt;br /&gt;
    [ boolean useNorm, &amp;lt;span class=warning&amp;gt;(does nothing!)&amp;lt;/span&amp;gt;&lt;br /&gt;
      [ number tu1, number tv1, number tu2, number tv2 |&lt;br /&gt;
        boolean useTextureCoord ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Queries =&lt;br /&gt;
&#039;&#039;&#039;gl.CreateQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; nil | userdata query&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.RunQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query, function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.GetQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil | number renderedFragments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Extended =&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexNames&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; { [1] = string texture, etc ... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexCoords&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;gets the texcoord of a 3do texture in the 3do texture atlas&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string 3doTextureName ) -&amp;gt; number xstart, number ystart, number xend, number yend&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeState&#039;&#039;&#039;&lt;br /&gt;
  ( number state [, boolean disable_state ], function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Calls glEnable(state) or glDisable(state) (if disable_state==true) and&amp;lt;br&amp;gt;then calls the lua_function and afterwards reverts the state.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetShadowMapParams&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; number xmid, number ymid, number p17, number p18&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMatrixData&#039;&#039;&#039;&lt;br /&gt;
  ( GL.PROJECTION [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( GL.MODELVIEW  [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i] &lt;br /&gt;
  ( GL.TEXTURE    [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( &amp;quot;shadow&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camera&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;caminv&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camprj&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;billboard&amp;quot; )             -&amp;gt; nil | number, etc.. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Flush&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Finish&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Shaders (GLSL) =&lt;br /&gt;
  [[Lua_GLSL_Api]]&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11521</id>
		<title>Lua OpenGL Api</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11521"/>
		<updated>2020-03-08T15:57:30Z</updated>

		<summary type="html">&lt;p&gt;Ivand: /* PixelReadback */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
= Spring =&lt;br /&gt;
&#039;&#039;&#039;gl.GetSun&#039;&#039;&#039;&lt;br /&gt;
  &amp;lt;font style=&amp;quot;font-size:90%&amp;quot;&amp;gt;()        -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;pos&amp;quot; ) -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;shadowDensity&amp;quot; [, &amp;quot;unit&amp;quot;] ) -&amp;gt; number shadowDensity&lt;br /&gt;
  ( &amp;quot;diffuse&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;ambient&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;specular&amp;quot;      [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetAtmosphere&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Sun|Spring.SetAtmosphere]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetWaterRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | string texName | number scalar | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetWaterParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMapRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetMapRenderingParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigScreen&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;used for Unit LODs&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number screenWidth, number screenDistance ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawMiniMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;argument new in 0.82+&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;boolean tansform = true&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SlaveMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( boolean mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( int px, int py, int sx, int sy ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetViewSizes&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number x, number y&lt;br /&gt;
&lt;br /&gt;
= Matrices &amp;amp; Viewport =&lt;br /&gt;
&#039;&#039;&#039;gl.Viewport&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;&#039;gl.Translate&#039;&#039;&#039;&lt;br /&gt;
  (number x, number y, number z) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scale&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rotate&#039;&#039;&#039;&lt;br /&gt;
  ( number angle, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Billboard&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Use this to draw 2d primitives in DrawWorld().&lt;br /&gt;
To render a 2D billboarded quad in the gameworld at world position x,y,z, you do the following (at a minimum; I am skipping blending / depthtesting) here:&lt;br /&gt;
  gl.PushMatrix()&lt;br /&gt;
  gl.Texture(read what you need here)&lt;br /&gt;
  gl.Translate(x,y,z)&lt;br /&gt;
  gl.Billboard()			&lt;br /&gt;
  gl.TexRect(x1,y1,x2,y2)&lt;br /&gt;
  gl.PopMatrix()&amp;lt;/span &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MatrixMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#MatrixMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadIdentity&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( 16 numbers or a [https://github.com/spring/spring/blob/develop/rts/Lua/LuaOpenGLUtils.cpp#L60 matrix name] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Ortho&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Frustum&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushPopMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ClipPlane&#039;&#039;&#039;&lt;br /&gt;
  ( int plane, &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: $plane can only be 1 or 2&amp;lt;/font&amp;gt;&lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number A, number B, number C, number D ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Clear =&lt;br /&gt;
&#039;&#039;&#039;gl.Clear&#039;&#039;&#039;&lt;br /&gt;
  ( GL.DEPTH_BUFFER_BIT [, number cleardepth] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.STENCIL_BUFFER_BIT [, int clearstencil] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.COLOR_BUFFER_BIT | GL.ACCUM_BUFFER_BIT [, number r, number g, number b, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SwapBuffers&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Available only in LuaMenu, meant for frame-limited LuaMenu&#039;s that want identical content in both buffers.&lt;br /&gt;
&lt;br /&gt;
= ResetState/Matrices =&lt;br /&gt;
&#039;&#039;&#039;gl.ResetState&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;DON&#039;T USE IT UNLESS YOU KNOW WHAT YOU ARE DOING! Each call-in has different default states, but this function resets all states to the states below no matter what!&amp;lt;/span&amp;gt;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  ShadeModel = GL.SMOOTH&lt;br /&gt;
  Scissor    = false&lt;br /&gt;
  Texture    = false&lt;br /&gt;
  Lighting    = false,&lt;br /&gt;
  ColorMask  = true, true, true, true&lt;br /&gt;
  DepthMask  = false&lt;br /&gt;
  DepthTest  = false  (GL.LEQUAL)&lt;br /&gt;
  Culling    = false  (GL.BACK)&lt;br /&gt;
  LogicOp    = false  (GL.INVERT)&lt;br /&gt;
  AlphaTest  = false  (GL.GREATER, 0.5f)&lt;br /&gt;
  Blending   = true (GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA)&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ResetMatrices&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  Resets GL.TEXTURE matrix stack&lt;br /&gt;
  Resets GL.MODELVIEW matrix stack&lt;br /&gt;
  Resets GL.PROJECTION matrix stack&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Draw Basics =&lt;br /&gt;
&#039;&#039;&#039;gl.BeginEnd&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Drawing_Primitives|GLType]], function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Color&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b[, number a] } |&lt;br /&gt;
      number r, number g, number b[, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Vertex&#039;&#039;&#039;&lt;br /&gt;
  ( { number x, number y [, number z [, number w ]] } |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Normal&#039;&#039;&#039;&lt;br /&gt;
  (  number x, number y, number z |&lt;br /&gt;
   { number x, number y, number z } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rect&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexRect&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;texture rect&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2,&lt;br /&gt;
  [ boolean flip_s, boolean flip_t | number s1, number t1, number s2, number t2 ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Shape&#039;&#039;&#039;&lt;br /&gt;
 ( number [[Lua_ConstGL#Drawing_Primitives|GLtype]],&lt;br /&gt;
   elements = {&lt;br /&gt;
     [1] = { v | vertex   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;required&amp;lt;/font&amp;gt;&lt;br /&gt;
             n | normal   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             t | texcoord = { number x, number y },                     &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             c | color    = { number r, number g, number b, number a }  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
     },&lt;br /&gt;
     etc ...&lt;br /&gt;
   }&lt;br /&gt;
 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SecondaryColor&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b } |&lt;br /&gt;
      number r, number g, number b ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FogCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Display Lists =&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Display Lists save given vertex attributes in a static buffer, so the GPU can directly read them (without the CPU). Display Lists are a lot faster (10-60x) than standard drawing with glShape/glBeginEnd, so try to use them when ever you can. If you want to learn more about them, g00gle is your friend ;)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateList&#039;&#039;&#039;&lt;br /&gt;
  ( function [,arg1 [,arg2...]] ) -&amp;gt; number listID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CallList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Vertex Array Objects =&lt;br /&gt;
&amp;lt;span class=note&amp;gt; &amp;lt;font color=darkblue&amp;gt; Only available in &amp;quot;develop&amp;quot; branch of spring (the future 105.0+). This is conceptually similar and serve as modern OpenGL replacement to deprecated Display Lists. &amp;lt;/font&amp;gt; &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number numElements, number numIndices, [boolean persistentBuffer = false] ) -&amp;gt; number bufferID&lt;br /&gt;
&lt;br /&gt;
See what elements and indices are here: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-9-vbo-indexing/&amp;lt;br&amp;gt;&lt;br /&gt;
numElements and numIndices define the size of for elements and indices respectively. if indices are not going to be used, then set numIndices to 0&amp;lt;br&amp;gt;&lt;br /&gt;
Persistent buffers (persistentBuffer = true) are more efficient for dynamically/often updated geometry.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UpdateVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number bufferID, number elementPos, number indexPos, table tbl | function func ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
{elementPos, indexPos} define starting element in {element, index} VBO corresponding to 1st element of the supplied vertex data&amp;lt;br&amp;gt;&lt;br /&gt;
4 elements table example:&amp;lt;br&amp;gt;&lt;br /&gt;
  local verts = {&lt;br /&gt;
    p  = {0,0,0,1,  4,0,0,1,  4,4,0,1,  0,4,0,1},&lt;br /&gt;
    n  = {0,1,0  ,  0,1,0  ,  0,1,0  ,  0,1,0  },&lt;br /&gt;
    uv = {0,0,0,0,  1,0,0,0,  1,1,0,0,  0,1,0,0},&lt;br /&gt;
    c0 = {1,0,0,1,  0,1,0,1,  0,0,1,1,  1,1,1,0},&lt;br /&gt;
    i = {0, 1, 2, 2, 1, 3},            &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional, use in case of indexed VBO&amp;lt;/font&amp;gt;&lt;br /&gt;
    c1 = {...} }&lt;br /&gt;
&amp;lt;br&amp;gt;Alternatively Lua func can use gl.Vertex/gl.Color/gl.Normal/gl.TexCoord to define vertices, similarly how it used to be done in gl.BeginEnd.Note there is no function yet to define indices.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number bufferID, number primType, [number firstIndex = 0, count = numElements]  ) -&amp;gt; boolean success&lt;br /&gt;
primType can be GL.POINTS, GL.LINE_STRIP, GL.LINE_LOOP, GL.LINES, GL.LINE_STRIP_ADJACENCY, GL.LINES_ADJACENCY, GL.TRIANGLE_STRIP, GL.TRIANGLE_FAN, GL.TRIANGLES, GL.TRIANGLE_STRIP_ADJACENCY, GL.TRIANGLES_ADJACENCY and GL.PATCHES&amp;lt;br&amp;gt;&lt;br /&gt;
firstIndex specifies the starting index in the enabled arrays.&amp;lt;br&amp;gt;&lt;br /&gt;
count specifies the number of indices to be rendered.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteVertexArray&#039;&#039;&#039;&lt;br /&gt;
 ( number bufferID ) -&amp;gt; boolean success&lt;br /&gt;
Releases previously allocated VAO&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Text =&lt;br /&gt;
&#039;&#039;&#039;gl.Text&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;, number x, number y, number size [, string &amp;lt;span class=note&amp;gt;&amp;quot;options&amp;quot;&amp;lt;/span&amp;gt;] )&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
  options are:&lt;br /&gt;
    horizontal alignment:&lt;br /&gt;
       &#039;c&#039; = center&lt;br /&gt;
       &#039;r&#039; = right&lt;br /&gt;
    vertical alignment:&lt;br /&gt;
       &#039;a&#039; = ascender&lt;br /&gt;
       &#039;t&#039; = top&lt;br /&gt;
       &#039;v&#039; = vertical center&lt;br /&gt;
       &#039;x&#039; = baseline&lt;br /&gt;
       &#039;b&#039; = bottom&lt;br /&gt;
       &#039;d&#039; = descender&lt;br /&gt;
    decorations:&lt;br /&gt;
       &#039;o&#039; = black outline&lt;br /&gt;
       &#039;O&#039; = white outline&lt;br /&gt;
       &#039;s&#039; = shadow&lt;br /&gt;
    other:&lt;br /&gt;
       &#039;n&#039; = don&#039;t round vertex coords to nearest integer (font may get blurry)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
http://home.arcor.de/jkei/fontlines.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextWidth&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;) -&amp;gt; number width  &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextHeight&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;text&amp;quot; ) -&amp;gt; nil | number height, number descender, number numlines &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;further descriptions here: [[GetTextHeight]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&amp;lt;b&amp;gt;If you have multiple gl.Text calls, then you can bunch them between a gl.BeginText and gl.EndText to speedup the rendering.&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;gl.BeginText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.EndText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Unit/Feature Draw Functions =&lt;br /&gt;
&#039;&#039;&#039;gl.Unit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws an unit; on default it uses LOD, with lod&amp;lt;0 it is turned off, else it defines a specific level)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitRaw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(doesn&#039;t apply worldspace-&amp;gt;unit transformation! only works if &amp;lt;i&amp;gt;rawdraw&amp;lt;/i&amp;gt; is true )&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShape&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID, number teamID, bool rawState, bool toScreen, bool opaque ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|101.0}} The three extra boolean arguments make it so that calling only these functions is enough to get correctly rendered models; pass in &#039;false&#039; for the THIRD argument to get the fixed behavior, omit it or pass in &#039;true&#039; [default] to render with your own custom state instead. The FOURTH argument should be &#039;true&#039; if in DrawScreen and &#039;false&#039; (default) if in DrawWorld; any transforms for these two functions *MUST* include a gl.LoadIdentity call when argument #3 is false (whether they are used in DrawWorld or in DrawScreen) the FIFTH argument determines whether the model is drawn opaque (&#039;true&#039; [default]) or with translucency (&#039;false&#039;); only has an effect when argument #3 is false.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; unit space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(unit space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPiece&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the unit piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.UnitPieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Feature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureRaw&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShape&#039;&#039;&#039;&lt;br /&gt;
  ( number featureDefID, number teamID, bool custom, bool drawScreen, bool opaque  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; feature space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(feature space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePiece&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the Feature piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.FeaturePieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawListAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number listID, [ boolean midPos,&lt;br /&gt;
      number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
      number degrees, number rotX, number rotX, number rotZ ] ) -&amp;gt; nil &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawFuncAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean midPos, function [, arg1,... ]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= States (Blending,AlphaTest...) =&lt;br /&gt;
&#039;&#039;&#039;gl.Blending&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
  ( string &amp;lt;span class=note&amp;gt;mode&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99&amp;quot; | mode maybe:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.ONE, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha_add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;reset&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;color&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_COLOR, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;modulate&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.DST_COLOR, GL.ZERO&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;disable&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquation&#039;&#039;&#039;&lt;br /&gt;
  ( number mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquationSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number modeRGB, number modeAlpha ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcRGB]], number [[Lua_ConstGL#BlendingFactorDest|dstRGB]],  number [[Lua_ConstGL#BlendingFactorSrc|srcAlpha]], number [[Lua_ConstGL#BlendingFactorDest|dstAlpha]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.AlphaTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]], number threshold ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Culling&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#Culling|face]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthClamp&#039;&#039;&#039;  &amp;lt;span class=warning&amp;gt;not always available, needs GL.NV_depth_clamp!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ColorMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( boolean r, boolean g, boolean b, boolean a ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LogicOp&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#LogicOp|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Fog&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Smoothing&#039;&#039;&#039; {{removed|104.0}}&lt;br /&gt;
 ( (boolean enable | number POINT), &lt;br /&gt;
   (boolean enable | number LINE),&lt;br /&gt;
   (boolean enable | number POLYGON) ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
 ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scissor&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( int x, int y, int w, int h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LineStipple&#039;&#039;&#039;&lt;br /&gt;
  ( string any ) -&amp;gt; nil &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(use springs default line stipple)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
  ( int factor, number pattern ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number [[Lua_ConstGL#PolygonMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonOffset&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number factor, number units ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushAttrib&#039;&#039;&#039;&lt;br /&gt;
  ( [ number [[Lua_ConstGL#glPushAttrib.28.29_bits|attrib]] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopAttrib&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Stencil =&lt;br /&gt;
&#039;&#039;&#039;gl.StencilTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMask&#039;&#039;&#039;&lt;br /&gt;
  ( number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOp&#039;&#039;&#039;&lt;br /&gt;
  ( number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMaskSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOpSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= LineWidth &amp;amp; PointSize =&lt;br /&gt;
&#039;&#039;&#039;gl.LineWidth&#039;&#039;&#039;&lt;br /&gt;
  ( number width ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSize&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(values != 1 can break severely on ATI cards, see http://springrts.com/mantis/view.php?id=2390)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number size ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSprite&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable, [boolean coord_replace, boolean coord_origin_upper] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointParameter&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number v1, number v2, number v3, &lt;br /&gt;
    [ number sizeMin, number sizeMax, number sizeFade ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Textures =&lt;br /&gt;
&#039;&#039;&#039;gl.Texture&#039;&#039;&#039;&lt;br /&gt;
  ( [ number texNum, ] boolean enable | string &amp;lt;span class=note&amp;gt;name&amp;lt;/span&amp;gt; ) -&amp;gt; nil | boolean loaded&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;This is the only call-out that is needed to load and draw any texture in a Lua script. All you have to do is pass it a valid path to a valid png and it will use that image for drawing any subsequent textured rectangles. This is shown in the last line of the following list of valid strings for the name parameter.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99; text-align:left&amp;quot; |`name` may be:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | #12&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 12 buildpic&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %34:1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 34 s3o tex2 (:0-&amp;gt;tex1,:1-&amp;gt;tex2)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %-102:0&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = featureDef 102 s3o tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | !56&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = lua generated texture 56 (= return value of gl.CreateTexture)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units2&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shadow&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = shadowmap&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = specular cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(removed in the latest develop)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $reflection &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = reflection cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(can be mipmaped starting from 104.0.1-714-ga29177f. Set CubeTexGenerateMipMaps=1 in settings)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shading&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = ground shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $grass&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = grass shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $heightmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = heightmap (needs HeightMapTexture=1 set in spring config)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $minimap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = minimap texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = same as &amp;quot;$reflection&amp;quot; {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $sky_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = defined for SSMF maps that have a skyReflectModTex {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = auto generated normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF specular texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_distr&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat distribution texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat normals texture {{new|101.0}}, used as &amp;quot;$ssmf_splat_normals&amp;quot; or &amp;quot;$ssmf_splat_normals:X&amp;quot;, &#039;X&#039; can be a value between 0 and 3, defaults to 0 if &amp;quot;:X&amp;quot; is omitted&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_emission&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF emission texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_parallax&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF parallax texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = currently active info texture (los, airlos, radar, jammer)&amp;lt;br/&amp;gt; Note that textures contain no data until user switches to their respective modes and non-active textures are not updated in the background, so will go stale&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_losmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = los texture (L-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_mtlmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = metal map texture (F4-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_hgtmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = height map texture (F1-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_blkmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = blocking map texture (F2-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the map in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the map in view. {{new|95}} &amp;lt;br/&amp;gt;To translate this to world position coordinates, use:&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;No clip control / clipspace for depth is [-1,1]&#039;&#039;&#039;&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(vec3(gl_TexCoord[0].st, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x) * 2.0 - 1.0, 1.0);&lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;Default if clip control is supported / clipspace for depth is [0,1].&#039;&#039;&#039;&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(gl_TexCoord[0].st * 2.0 - 1.0, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x, 1.0);&lt;br /&gt;
&lt;br /&gt;
  worldpos.xyz = worldpos.xyz / worldpos.w; &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the models in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the models in view.  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | ${opt}:/LuaUI/images/image.png &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = load a texture from the VFS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
   possible ${opt}&#039;s are:&lt;br /&gt;
      &#039;n&#039; = nearest&lt;br /&gt;
      &#039;l&#039; = linear&lt;br /&gt;
      &#039;a&#039; = aniso&lt;br /&gt;
      &#039;i&#039; = invert&lt;br /&gt;
      &#039;g&#039; = greyed&lt;br /&gt;
      &#039;c&#039; = clamped&lt;br /&gt;
      &#039;b&#039; = border&lt;br /&gt;
      &#039;t%r,%g,%b&#039; = tint&lt;br /&gt;
      &#039;r%width,%height&#039; = resize&lt;br /&gt;
   The above ${opt}&#039;s are NOT available for .DDS textures! .dds will load faster than other image formats.&lt;br /&gt;
&lt;br /&gt;
    example: &amp;quot;:iac:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example: &amp;quot;:cr16,16:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example2: &amp;quot;:t1.0,0.5,0:/LuaUI/images/image.png&amp;quot;  (orange tint)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
  [ { &lt;br /&gt;
    [target     = number,] &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(like GL.TEXTURE_1D,GL.TEXTURE_2D,...)&amp;lt;/font&amp;gt; &amp;lt;font color=darkblue&amp;gt; (Added support for GL_TEXTURE_2D_MULTISAMPLE in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [format     = number,]&lt;br /&gt;
    [min_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [mag_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [wrap_s     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_t     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_r     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [aniso      = number,]&lt;br /&gt;
    [border     = boolean,]&lt;br /&gt;
    [fbo        = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [fboDepth   = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [samples    = number,] &amp;lt;font color=darkblue&amp;gt; specify any number here and target = GL_TEXTURE_2D_MULTISAMPLE to create multisample texture (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  } ]&lt;br /&gt;
  ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTexture&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTextureFBO&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TextureInfo&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; nil | {&lt;br /&gt;
      xsize = number,&lt;br /&gt;
      ysize = number,&lt;br /&gt;
      alpha = boolean, //not used yet&lt;br /&gt;
      type  = number,  //not used yet&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
   the format of the texture string is the same as in gl.Texture()&lt;br /&gt;
&amp;lt;/font&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number x | &lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum,&lt;br /&gt;
    number x |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexGen&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexGen&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil       &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CopyToTexture&#039;&#039;&#039;&lt;br /&gt;
  (string texture, int xoff, int yoff, int x, int y, int w, int h &lt;br /&gt;
  [,number target,number level])-&amp;gt;nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderToTexture&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string fbotexture, lua_func ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GenerateMipmap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs glGenerateMipmapEXT!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
The following are primarily intended to be used in conjunction with&lt;br /&gt;
     gl.{Unit,Feature}(objID, ..., raw=true)&lt;br /&gt;
     gl.{Unit,Feature}Shape(defID, ..., raw=true)&lt;br /&gt;
and apply a model&#039;s default textures; easier than gl.Texture(&amp;quot;$%...&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
= PixelReadback =&lt;br /&gt;
&#039;&#039;&#039;gl.SaveImage&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h,&lt;br /&gt;
    string filename [, table {alpha=boolean, yflip=boolean, grayscale16bit=boolean, readbuffer=number} ] ) -&amp;gt; nil | boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;&lt;br /&gt;
grayscale16bit is {{new|99.0}} and allows to save single color 16bit PNG&lt;br /&gt;
readbuffer is {{new|104+}} and allows to choose the attachment of MRT FBO, use GL_COLOR_ATTACHMENT0_EXT and further as index&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ReadPixels&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h [, number format = GL.RGBA ] )&lt;br /&gt;
    -&amp;gt; nil &lt;br /&gt;
    | number r,[g,[b,[a]]] &lt;br /&gt;
    | table { { {1 = number r, 2 = number g, 3 = number b, 4 = number a}, ... }, ... }&lt;br /&gt;
&lt;br /&gt;
= Lights =&lt;br /&gt;
&#039;&#039;&#039;gl.Lighting&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ShadeModel&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#ShadeModel|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Light&#039;&#039;&#039;&lt;br /&gt;
  ( int light, &lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param1, number param2, number param3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Material&#039;&#039;&#039;&lt;br /&gt;
  ({&lt;br /&gt;
    ambient   = {number r, number g, number b[, number a]},&lt;br /&gt;
    diffuse   = {number r, number g, number b[, number a]},&lt;br /&gt;
    ambidiff  = {number r, number g, number b[, number a]},&lt;br /&gt;
    emission  = {number r, number g, number b[, number a]},&lt;br /&gt;
    specular  = {number r, number g, number b[, number a]},&lt;br /&gt;
    shininess = number specularExponent&lt;br /&gt;
  }) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Hardware relevant =&lt;br /&gt;
&#039;&#039;&#039;gl.HasExtension&#039;&#039;&#039;&lt;br /&gt;
  ( string extname ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetNumber&#039;&#039;&#039;&lt;br /&gt;
  ( number ext, int count ) -&amp;gt; number [, number, number, ... #count ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetString&#039;&#039;&#039;&lt;br /&gt;
  ( number ext ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= DrawGroundPrimitives =&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundCircle&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z, number radius, number divs [, number slope ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: number divs is the number of sides the circle will have. the higher the smoother the circle (and more GPU intensive) &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundQuad&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: x1,z1,x2 &amp;amp; z2 are rounded, so don&#039;t use it for very small or moving objects. x and z are correspond to the coordinates displayed by the tooltip &amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number z1, number x2, number z2,&lt;br /&gt;
    [ boolean useNorm, &amp;lt;span class=warning&amp;gt;(does nothing!)&amp;lt;/span&amp;gt;&lt;br /&gt;
      [ number tu1, number tv1, number tu2, number tv2 |&lt;br /&gt;
        boolean useTextureCoord ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Queries =&lt;br /&gt;
&#039;&#039;&#039;gl.CreateQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; nil | userdata query&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.RunQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query, function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.GetQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil | number renderedFragments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Extended =&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexNames&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; { [1] = string texture, etc ... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexCoords&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;gets the texcoord of a 3do texture in the 3do texture atlas&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string 3doTextureName ) -&amp;gt; number xstart, number ystart, number xend, number yend&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeState&#039;&#039;&#039;&lt;br /&gt;
  ( number state [, boolean disable_state ], function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Calls glEnable(state) or glDisable(state) (if disable_state==true) and&amp;lt;br&amp;gt;then calls the lua_function and afterwards reverts the state.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetShadowMapParams&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; number xmid, number ymid, number p17, number p18&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMatrixData&#039;&#039;&#039;&lt;br /&gt;
  ( GL.PROJECTION [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( GL.MODELVIEW  [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i] &lt;br /&gt;
  ( GL.TEXTURE    [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( &amp;quot;shadow&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camera&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;caminv&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camprj&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;billboard&amp;quot; )             -&amp;gt; nil | number, etc.. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Flush&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Finish&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Shaders (GLSL) =&lt;br /&gt;
  [[Lua_GLSL_Api]]&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11520</id>
		<title>Lua OpenGL Api</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11520"/>
		<updated>2020-03-08T15:56:51Z</updated>

		<summary type="html">&lt;p&gt;Ivand: /* PixelReadback */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
= Spring =&lt;br /&gt;
&#039;&#039;&#039;gl.GetSun&#039;&#039;&#039;&lt;br /&gt;
  &amp;lt;font style=&amp;quot;font-size:90%&amp;quot;&amp;gt;()        -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;pos&amp;quot; ) -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;shadowDensity&amp;quot; [, &amp;quot;unit&amp;quot;] ) -&amp;gt; number shadowDensity&lt;br /&gt;
  ( &amp;quot;diffuse&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;ambient&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;specular&amp;quot;      [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetAtmosphere&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Sun|Spring.SetAtmosphere]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetWaterRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | string texName | number scalar | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetWaterParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMapRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetMapRenderingParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigScreen&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;used for Unit LODs&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number screenWidth, number screenDistance ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawMiniMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;argument new in 0.82+&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;boolean tansform = true&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SlaveMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( boolean mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( int px, int py, int sx, int sy ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetViewSizes&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number x, number y&lt;br /&gt;
&lt;br /&gt;
= Matrices &amp;amp; Viewport =&lt;br /&gt;
&#039;&#039;&#039;gl.Viewport&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;&#039;gl.Translate&#039;&#039;&#039;&lt;br /&gt;
  (number x, number y, number z) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scale&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rotate&#039;&#039;&#039;&lt;br /&gt;
  ( number angle, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Billboard&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Use this to draw 2d primitives in DrawWorld().&lt;br /&gt;
To render a 2D billboarded quad in the gameworld at world position x,y,z, you do the following (at a minimum; I am skipping blending / depthtesting) here:&lt;br /&gt;
  gl.PushMatrix()&lt;br /&gt;
  gl.Texture(read what you need here)&lt;br /&gt;
  gl.Translate(x,y,z)&lt;br /&gt;
  gl.Billboard()			&lt;br /&gt;
  gl.TexRect(x1,y1,x2,y2)&lt;br /&gt;
  gl.PopMatrix()&amp;lt;/span &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MatrixMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#MatrixMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadIdentity&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( 16 numbers or a [https://github.com/spring/spring/blob/develop/rts/Lua/LuaOpenGLUtils.cpp#L60 matrix name] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Ortho&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Frustum&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushPopMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ClipPlane&#039;&#039;&#039;&lt;br /&gt;
  ( int plane, &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: $plane can only be 1 or 2&amp;lt;/font&amp;gt;&lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number A, number B, number C, number D ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Clear =&lt;br /&gt;
&#039;&#039;&#039;gl.Clear&#039;&#039;&#039;&lt;br /&gt;
  ( GL.DEPTH_BUFFER_BIT [, number cleardepth] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.STENCIL_BUFFER_BIT [, int clearstencil] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.COLOR_BUFFER_BIT | GL.ACCUM_BUFFER_BIT [, number r, number g, number b, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SwapBuffers&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Available only in LuaMenu, meant for frame-limited LuaMenu&#039;s that want identical content in both buffers.&lt;br /&gt;
&lt;br /&gt;
= ResetState/Matrices =&lt;br /&gt;
&#039;&#039;&#039;gl.ResetState&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;DON&#039;T USE IT UNLESS YOU KNOW WHAT YOU ARE DOING! Each call-in has different default states, but this function resets all states to the states below no matter what!&amp;lt;/span&amp;gt;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  ShadeModel = GL.SMOOTH&lt;br /&gt;
  Scissor    = false&lt;br /&gt;
  Texture    = false&lt;br /&gt;
  Lighting    = false,&lt;br /&gt;
  ColorMask  = true, true, true, true&lt;br /&gt;
  DepthMask  = false&lt;br /&gt;
  DepthTest  = false  (GL.LEQUAL)&lt;br /&gt;
  Culling    = false  (GL.BACK)&lt;br /&gt;
  LogicOp    = false  (GL.INVERT)&lt;br /&gt;
  AlphaTest  = false  (GL.GREATER, 0.5f)&lt;br /&gt;
  Blending   = true (GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA)&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ResetMatrices&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  Resets GL.TEXTURE matrix stack&lt;br /&gt;
  Resets GL.MODELVIEW matrix stack&lt;br /&gt;
  Resets GL.PROJECTION matrix stack&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Draw Basics =&lt;br /&gt;
&#039;&#039;&#039;gl.BeginEnd&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Drawing_Primitives|GLType]], function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Color&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b[, number a] } |&lt;br /&gt;
      number r, number g, number b[, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Vertex&#039;&#039;&#039;&lt;br /&gt;
  ( { number x, number y [, number z [, number w ]] } |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Normal&#039;&#039;&#039;&lt;br /&gt;
  (  number x, number y, number z |&lt;br /&gt;
   { number x, number y, number z } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rect&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexRect&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;texture rect&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2,&lt;br /&gt;
  [ boolean flip_s, boolean flip_t | number s1, number t1, number s2, number t2 ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Shape&#039;&#039;&#039;&lt;br /&gt;
 ( number [[Lua_ConstGL#Drawing_Primitives|GLtype]],&lt;br /&gt;
   elements = {&lt;br /&gt;
     [1] = { v | vertex   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;required&amp;lt;/font&amp;gt;&lt;br /&gt;
             n | normal   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             t | texcoord = { number x, number y },                     &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             c | color    = { number r, number g, number b, number a }  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
     },&lt;br /&gt;
     etc ...&lt;br /&gt;
   }&lt;br /&gt;
 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SecondaryColor&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b } |&lt;br /&gt;
      number r, number g, number b ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FogCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Display Lists =&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Display Lists save given vertex attributes in a static buffer, so the GPU can directly read them (without the CPU). Display Lists are a lot faster (10-60x) than standard drawing with glShape/glBeginEnd, so try to use them when ever you can. If you want to learn more about them, g00gle is your friend ;)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateList&#039;&#039;&#039;&lt;br /&gt;
  ( function [,arg1 [,arg2...]] ) -&amp;gt; number listID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CallList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Vertex Array Objects =&lt;br /&gt;
&amp;lt;span class=note&amp;gt; &amp;lt;font color=darkblue&amp;gt; Only available in &amp;quot;develop&amp;quot; branch of spring (the future 105.0+). This is conceptually similar and serve as modern OpenGL replacement to deprecated Display Lists. &amp;lt;/font&amp;gt; &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number numElements, number numIndices, [boolean persistentBuffer = false] ) -&amp;gt; number bufferID&lt;br /&gt;
&lt;br /&gt;
See what elements and indices are here: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-9-vbo-indexing/&amp;lt;br&amp;gt;&lt;br /&gt;
numElements and numIndices define the size of for elements and indices respectively. if indices are not going to be used, then set numIndices to 0&amp;lt;br&amp;gt;&lt;br /&gt;
Persistent buffers (persistentBuffer = true) are more efficient for dynamically/often updated geometry.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UpdateVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number bufferID, number elementPos, number indexPos, table tbl | function func ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
{elementPos, indexPos} define starting element in {element, index} VBO corresponding to 1st element of the supplied vertex data&amp;lt;br&amp;gt;&lt;br /&gt;
4 elements table example:&amp;lt;br&amp;gt;&lt;br /&gt;
  local verts = {&lt;br /&gt;
    p  = {0,0,0,1,  4,0,0,1,  4,4,0,1,  0,4,0,1},&lt;br /&gt;
    n  = {0,1,0  ,  0,1,0  ,  0,1,0  ,  0,1,0  },&lt;br /&gt;
    uv = {0,0,0,0,  1,0,0,0,  1,1,0,0,  0,1,0,0},&lt;br /&gt;
    c0 = {1,0,0,1,  0,1,0,1,  0,0,1,1,  1,1,1,0},&lt;br /&gt;
    i = {0, 1, 2, 2, 1, 3},            &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional, use in case of indexed VBO&amp;lt;/font&amp;gt;&lt;br /&gt;
    c1 = {...} }&lt;br /&gt;
&amp;lt;br&amp;gt;Alternatively Lua func can use gl.Vertex/gl.Color/gl.Normal/gl.TexCoord to define vertices, similarly how it used to be done in gl.BeginEnd.Note there is no function yet to define indices.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number bufferID, number primType, [number firstIndex = 0, count = numElements]  ) -&amp;gt; boolean success&lt;br /&gt;
primType can be GL.POINTS, GL.LINE_STRIP, GL.LINE_LOOP, GL.LINES, GL.LINE_STRIP_ADJACENCY, GL.LINES_ADJACENCY, GL.TRIANGLE_STRIP, GL.TRIANGLE_FAN, GL.TRIANGLES, GL.TRIANGLE_STRIP_ADJACENCY, GL.TRIANGLES_ADJACENCY and GL.PATCHES&amp;lt;br&amp;gt;&lt;br /&gt;
firstIndex specifies the starting index in the enabled arrays.&amp;lt;br&amp;gt;&lt;br /&gt;
count specifies the number of indices to be rendered.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteVertexArray&#039;&#039;&#039;&lt;br /&gt;
 ( number bufferID ) -&amp;gt; boolean success&lt;br /&gt;
Releases previously allocated VAO&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Text =&lt;br /&gt;
&#039;&#039;&#039;gl.Text&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;, number x, number y, number size [, string &amp;lt;span class=note&amp;gt;&amp;quot;options&amp;quot;&amp;lt;/span&amp;gt;] )&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
  options are:&lt;br /&gt;
    horizontal alignment:&lt;br /&gt;
       &#039;c&#039; = center&lt;br /&gt;
       &#039;r&#039; = right&lt;br /&gt;
    vertical alignment:&lt;br /&gt;
       &#039;a&#039; = ascender&lt;br /&gt;
       &#039;t&#039; = top&lt;br /&gt;
       &#039;v&#039; = vertical center&lt;br /&gt;
       &#039;x&#039; = baseline&lt;br /&gt;
       &#039;b&#039; = bottom&lt;br /&gt;
       &#039;d&#039; = descender&lt;br /&gt;
    decorations:&lt;br /&gt;
       &#039;o&#039; = black outline&lt;br /&gt;
       &#039;O&#039; = white outline&lt;br /&gt;
       &#039;s&#039; = shadow&lt;br /&gt;
    other:&lt;br /&gt;
       &#039;n&#039; = don&#039;t round vertex coords to nearest integer (font may get blurry)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
http://home.arcor.de/jkei/fontlines.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextWidth&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;) -&amp;gt; number width  &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextHeight&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;text&amp;quot; ) -&amp;gt; nil | number height, number descender, number numlines &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;further descriptions here: [[GetTextHeight]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&amp;lt;b&amp;gt;If you have multiple gl.Text calls, then you can bunch them between a gl.BeginText and gl.EndText to speedup the rendering.&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;gl.BeginText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.EndText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Unit/Feature Draw Functions =&lt;br /&gt;
&#039;&#039;&#039;gl.Unit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws an unit; on default it uses LOD, with lod&amp;lt;0 it is turned off, else it defines a specific level)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitRaw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(doesn&#039;t apply worldspace-&amp;gt;unit transformation! only works if &amp;lt;i&amp;gt;rawdraw&amp;lt;/i&amp;gt; is true )&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShape&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID, number teamID, bool rawState, bool toScreen, bool opaque ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|101.0}} The three extra boolean arguments make it so that calling only these functions is enough to get correctly rendered models; pass in &#039;false&#039; for the THIRD argument to get the fixed behavior, omit it or pass in &#039;true&#039; [default] to render with your own custom state instead. The FOURTH argument should be &#039;true&#039; if in DrawScreen and &#039;false&#039; (default) if in DrawWorld; any transforms for these two functions *MUST* include a gl.LoadIdentity call when argument #3 is false (whether they are used in DrawWorld or in DrawScreen) the FIFTH argument determines whether the model is drawn opaque (&#039;true&#039; [default]) or with translucency (&#039;false&#039;); only has an effect when argument #3 is false.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; unit space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(unit space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPiece&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the unit piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.UnitPieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Feature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureRaw&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShape&#039;&#039;&#039;&lt;br /&gt;
  ( number featureDefID, number teamID, bool custom, bool drawScreen, bool opaque  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; feature space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(feature space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePiece&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the Feature piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.FeaturePieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawListAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number listID, [ boolean midPos,&lt;br /&gt;
      number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
      number degrees, number rotX, number rotX, number rotZ ] ) -&amp;gt; nil &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawFuncAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean midPos, function [, arg1,... ]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= States (Blending,AlphaTest...) =&lt;br /&gt;
&#039;&#039;&#039;gl.Blending&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
  ( string &amp;lt;span class=note&amp;gt;mode&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99&amp;quot; | mode maybe:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.ONE, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha_add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;reset&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;color&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_COLOR, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;modulate&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.DST_COLOR, GL.ZERO&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;disable&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquation&#039;&#039;&#039;&lt;br /&gt;
  ( number mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquationSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number modeRGB, number modeAlpha ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcRGB]], number [[Lua_ConstGL#BlendingFactorDest|dstRGB]],  number [[Lua_ConstGL#BlendingFactorSrc|srcAlpha]], number [[Lua_ConstGL#BlendingFactorDest|dstAlpha]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.AlphaTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]], number threshold ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Culling&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#Culling|face]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthClamp&#039;&#039;&#039;  &amp;lt;span class=warning&amp;gt;not always available, needs GL.NV_depth_clamp!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ColorMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( boolean r, boolean g, boolean b, boolean a ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LogicOp&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#LogicOp|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Fog&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Smoothing&#039;&#039;&#039; {{removed|104.0}}&lt;br /&gt;
 ( (boolean enable | number POINT), &lt;br /&gt;
   (boolean enable | number LINE),&lt;br /&gt;
   (boolean enable | number POLYGON) ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
 ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scissor&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( int x, int y, int w, int h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LineStipple&#039;&#039;&#039;&lt;br /&gt;
  ( string any ) -&amp;gt; nil &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(use springs default line stipple)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
  ( int factor, number pattern ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number [[Lua_ConstGL#PolygonMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonOffset&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number factor, number units ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushAttrib&#039;&#039;&#039;&lt;br /&gt;
  ( [ number [[Lua_ConstGL#glPushAttrib.28.29_bits|attrib]] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopAttrib&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Stencil =&lt;br /&gt;
&#039;&#039;&#039;gl.StencilTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMask&#039;&#039;&#039;&lt;br /&gt;
  ( number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOp&#039;&#039;&#039;&lt;br /&gt;
  ( number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMaskSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOpSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= LineWidth &amp;amp; PointSize =&lt;br /&gt;
&#039;&#039;&#039;gl.LineWidth&#039;&#039;&#039;&lt;br /&gt;
  ( number width ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSize&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(values != 1 can break severely on ATI cards, see http://springrts.com/mantis/view.php?id=2390)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number size ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSprite&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable, [boolean coord_replace, boolean coord_origin_upper] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointParameter&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number v1, number v2, number v3, &lt;br /&gt;
    [ number sizeMin, number sizeMax, number sizeFade ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Textures =&lt;br /&gt;
&#039;&#039;&#039;gl.Texture&#039;&#039;&#039;&lt;br /&gt;
  ( [ number texNum, ] boolean enable | string &amp;lt;span class=note&amp;gt;name&amp;lt;/span&amp;gt; ) -&amp;gt; nil | boolean loaded&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;This is the only call-out that is needed to load and draw any texture in a Lua script. All you have to do is pass it a valid path to a valid png and it will use that image for drawing any subsequent textured rectangles. This is shown in the last line of the following list of valid strings for the name parameter.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99; text-align:left&amp;quot; |`name` may be:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | #12&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 12 buildpic&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %34:1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 34 s3o tex2 (:0-&amp;gt;tex1,:1-&amp;gt;tex2)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %-102:0&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = featureDef 102 s3o tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | !56&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = lua generated texture 56 (= return value of gl.CreateTexture)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units2&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shadow&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = shadowmap&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = specular cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(removed in the latest develop)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $reflection &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = reflection cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(can be mipmaped starting from 104.0.1-714-ga29177f. Set CubeTexGenerateMipMaps=1 in settings)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shading&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = ground shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $grass&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = grass shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $heightmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = heightmap (needs HeightMapTexture=1 set in spring config)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $minimap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = minimap texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = same as &amp;quot;$reflection&amp;quot; {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $sky_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = defined for SSMF maps that have a skyReflectModTex {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = auto generated normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF specular texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_distr&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat distribution texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat normals texture {{new|101.0}}, used as &amp;quot;$ssmf_splat_normals&amp;quot; or &amp;quot;$ssmf_splat_normals:X&amp;quot;, &#039;X&#039; can be a value between 0 and 3, defaults to 0 if &amp;quot;:X&amp;quot; is omitted&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_emission&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF emission texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_parallax&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF parallax texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = currently active info texture (los, airlos, radar, jammer)&amp;lt;br/&amp;gt; Note that textures contain no data until user switches to their respective modes and non-active textures are not updated in the background, so will go stale&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_losmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = los texture (L-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_mtlmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = metal map texture (F4-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_hgtmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = height map texture (F1-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_blkmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = blocking map texture (F2-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the map in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the map in view. {{new|95}} &amp;lt;br/&amp;gt;To translate this to world position coordinates, use:&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;No clip control / clipspace for depth is [-1,1]&#039;&#039;&#039;&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(vec3(gl_TexCoord[0].st, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x) * 2.0 - 1.0, 1.0);&lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;Default if clip control is supported / clipspace for depth is [0,1].&#039;&#039;&#039;&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(gl_TexCoord[0].st * 2.0 - 1.0, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x, 1.0);&lt;br /&gt;
&lt;br /&gt;
  worldpos.xyz = worldpos.xyz / worldpos.w; &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the models in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the models in view.  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | ${opt}:/LuaUI/images/image.png &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = load a texture from the VFS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
   possible ${opt}&#039;s are:&lt;br /&gt;
      &#039;n&#039; = nearest&lt;br /&gt;
      &#039;l&#039; = linear&lt;br /&gt;
      &#039;a&#039; = aniso&lt;br /&gt;
      &#039;i&#039; = invert&lt;br /&gt;
      &#039;g&#039; = greyed&lt;br /&gt;
      &#039;c&#039; = clamped&lt;br /&gt;
      &#039;b&#039; = border&lt;br /&gt;
      &#039;t%r,%g,%b&#039; = tint&lt;br /&gt;
      &#039;r%width,%height&#039; = resize&lt;br /&gt;
   The above ${opt}&#039;s are NOT available for .DDS textures! .dds will load faster than other image formats.&lt;br /&gt;
&lt;br /&gt;
    example: &amp;quot;:iac:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example: &amp;quot;:cr16,16:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example2: &amp;quot;:t1.0,0.5,0:/LuaUI/images/image.png&amp;quot;  (orange tint)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
  [ { &lt;br /&gt;
    [target     = number,] &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(like GL.TEXTURE_1D,GL.TEXTURE_2D,...)&amp;lt;/font&amp;gt; &amp;lt;font color=darkblue&amp;gt; (Added support for GL_TEXTURE_2D_MULTISAMPLE in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [format     = number,]&lt;br /&gt;
    [min_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [mag_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [wrap_s     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_t     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_r     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [aniso      = number,]&lt;br /&gt;
    [border     = boolean,]&lt;br /&gt;
    [fbo        = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [fboDepth   = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [samples    = number,] &amp;lt;font color=darkblue&amp;gt; specify any number here and target = GL_TEXTURE_2D_MULTISAMPLE to create multisample texture (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  } ]&lt;br /&gt;
  ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTexture&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTextureFBO&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TextureInfo&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; nil | {&lt;br /&gt;
      xsize = number,&lt;br /&gt;
      ysize = number,&lt;br /&gt;
      alpha = boolean, //not used yet&lt;br /&gt;
      type  = number,  //not used yet&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
   the format of the texture string is the same as in gl.Texture()&lt;br /&gt;
&amp;lt;/font&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number x | &lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum,&lt;br /&gt;
    number x |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexGen&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexGen&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil       &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CopyToTexture&#039;&#039;&#039;&lt;br /&gt;
  (string texture, int xoff, int yoff, int x, int y, int w, int h &lt;br /&gt;
  [,number target,number level])-&amp;gt;nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderToTexture&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string fbotexture, lua_func ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GenerateMipmap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs glGenerateMipmapEXT!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
The following are primarily intended to be used in conjunction with&lt;br /&gt;
     gl.{Unit,Feature}(objID, ..., raw=true)&lt;br /&gt;
     gl.{Unit,Feature}Shape(defID, ..., raw=true)&lt;br /&gt;
and apply a model&#039;s default textures; easier than gl.Texture(&amp;quot;$%...&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
= PixelReadback =&lt;br /&gt;
&#039;&#039;&#039;gl.SaveImage&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h,&lt;br /&gt;
    string filename [, table {alpha=boolean, yflip=boolean, grayscale16bit=boolean, readbuffer=number} ] ) -&amp;gt; nil | boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;grayscale16bit is {{new|99.0}} and allows to save single color 16bit PNG&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;readbuffer is {{new|104+}} and allows to choose the attachment of MRT FBO, use GL_COLOR_ATTACHMENT0_EXT and further as index&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ReadPixels&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h [, number format = GL.RGBA ] )&lt;br /&gt;
    -&amp;gt; nil &lt;br /&gt;
    | number r,[g,[b,[a]]] &lt;br /&gt;
    | table { { {1 = number r, 2 = number g, 3 = number b, 4 = number a}, ... }, ... }&lt;br /&gt;
&lt;br /&gt;
= Lights =&lt;br /&gt;
&#039;&#039;&#039;gl.Lighting&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ShadeModel&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#ShadeModel|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Light&#039;&#039;&#039;&lt;br /&gt;
  ( int light, &lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param1, number param2, number param3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Material&#039;&#039;&#039;&lt;br /&gt;
  ({&lt;br /&gt;
    ambient   = {number r, number g, number b[, number a]},&lt;br /&gt;
    diffuse   = {number r, number g, number b[, number a]},&lt;br /&gt;
    ambidiff  = {number r, number g, number b[, number a]},&lt;br /&gt;
    emission  = {number r, number g, number b[, number a]},&lt;br /&gt;
    specular  = {number r, number g, number b[, number a]},&lt;br /&gt;
    shininess = number specularExponent&lt;br /&gt;
  }) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Hardware relevant =&lt;br /&gt;
&#039;&#039;&#039;gl.HasExtension&#039;&#039;&#039;&lt;br /&gt;
  ( string extname ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetNumber&#039;&#039;&#039;&lt;br /&gt;
  ( number ext, int count ) -&amp;gt; number [, number, number, ... #count ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetString&#039;&#039;&#039;&lt;br /&gt;
  ( number ext ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= DrawGroundPrimitives =&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundCircle&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z, number radius, number divs [, number slope ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: number divs is the number of sides the circle will have. the higher the smoother the circle (and more GPU intensive) &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundQuad&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: x1,z1,x2 &amp;amp; z2 are rounded, so don&#039;t use it for very small or moving objects. x and z are correspond to the coordinates displayed by the tooltip &amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number z1, number x2, number z2,&lt;br /&gt;
    [ boolean useNorm, &amp;lt;span class=warning&amp;gt;(does nothing!)&amp;lt;/span&amp;gt;&lt;br /&gt;
      [ number tu1, number tv1, number tu2, number tv2 |&lt;br /&gt;
        boolean useTextureCoord ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Queries =&lt;br /&gt;
&#039;&#039;&#039;gl.CreateQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; nil | userdata query&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.RunQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query, function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.GetQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil | number renderedFragments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Extended =&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexNames&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; { [1] = string texture, etc ... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexCoords&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;gets the texcoord of a 3do texture in the 3do texture atlas&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string 3doTextureName ) -&amp;gt; number xstart, number ystart, number xend, number yend&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeState&#039;&#039;&#039;&lt;br /&gt;
  ( number state [, boolean disable_state ], function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Calls glEnable(state) or glDisable(state) (if disable_state==true) and&amp;lt;br&amp;gt;then calls the lua_function and afterwards reverts the state.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetShadowMapParams&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; number xmid, number ymid, number p17, number p18&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMatrixData&#039;&#039;&#039;&lt;br /&gt;
  ( GL.PROJECTION [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( GL.MODELVIEW  [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i] &lt;br /&gt;
  ( GL.TEXTURE    [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( &amp;quot;shadow&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camera&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;caminv&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camprj&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;billboard&amp;quot; )             -&amp;gt; nil | number, etc.. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Flush&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Finish&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Shaders (GLSL) =&lt;br /&gt;
  [[Lua_GLSL_Api]]&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11519</id>
		<title>Lua OpenGL Api</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11519"/>
		<updated>2020-03-08T15:56:17Z</updated>

		<summary type="html">&lt;p&gt;Ivand: /* PixelReadback */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
= Spring =&lt;br /&gt;
&#039;&#039;&#039;gl.GetSun&#039;&#039;&#039;&lt;br /&gt;
  &amp;lt;font style=&amp;quot;font-size:90%&amp;quot;&amp;gt;()        -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;pos&amp;quot; ) -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;shadowDensity&amp;quot; [, &amp;quot;unit&amp;quot;] ) -&amp;gt; number shadowDensity&lt;br /&gt;
  ( &amp;quot;diffuse&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;ambient&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;specular&amp;quot;      [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetAtmosphere&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Sun|Spring.SetAtmosphere]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetWaterRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | string texName | number scalar | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetWaterParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMapRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetMapRenderingParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigScreen&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;used for Unit LODs&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number screenWidth, number screenDistance ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawMiniMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;argument new in 0.82+&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;boolean tansform = true&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SlaveMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( boolean mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( int px, int py, int sx, int sy ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetViewSizes&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number x, number y&lt;br /&gt;
&lt;br /&gt;
= Matrices &amp;amp; Viewport =&lt;br /&gt;
&#039;&#039;&#039;gl.Viewport&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;&#039;gl.Translate&#039;&#039;&#039;&lt;br /&gt;
  (number x, number y, number z) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scale&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rotate&#039;&#039;&#039;&lt;br /&gt;
  ( number angle, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Billboard&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Use this to draw 2d primitives in DrawWorld().&lt;br /&gt;
To render a 2D billboarded quad in the gameworld at world position x,y,z, you do the following (at a minimum; I am skipping blending / depthtesting) here:&lt;br /&gt;
  gl.PushMatrix()&lt;br /&gt;
  gl.Texture(read what you need here)&lt;br /&gt;
  gl.Translate(x,y,z)&lt;br /&gt;
  gl.Billboard()			&lt;br /&gt;
  gl.TexRect(x1,y1,x2,y2)&lt;br /&gt;
  gl.PopMatrix()&amp;lt;/span &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MatrixMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#MatrixMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadIdentity&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( 16 numbers or a [https://github.com/spring/spring/blob/develop/rts/Lua/LuaOpenGLUtils.cpp#L60 matrix name] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Ortho&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Frustum&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushPopMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ClipPlane&#039;&#039;&#039;&lt;br /&gt;
  ( int plane, &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: $plane can only be 1 or 2&amp;lt;/font&amp;gt;&lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number A, number B, number C, number D ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Clear =&lt;br /&gt;
&#039;&#039;&#039;gl.Clear&#039;&#039;&#039;&lt;br /&gt;
  ( GL.DEPTH_BUFFER_BIT [, number cleardepth] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.STENCIL_BUFFER_BIT [, int clearstencil] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.COLOR_BUFFER_BIT | GL.ACCUM_BUFFER_BIT [, number r, number g, number b, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SwapBuffers&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Available only in LuaMenu, meant for frame-limited LuaMenu&#039;s that want identical content in both buffers.&lt;br /&gt;
&lt;br /&gt;
= ResetState/Matrices =&lt;br /&gt;
&#039;&#039;&#039;gl.ResetState&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;DON&#039;T USE IT UNLESS YOU KNOW WHAT YOU ARE DOING! Each call-in has different default states, but this function resets all states to the states below no matter what!&amp;lt;/span&amp;gt;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  ShadeModel = GL.SMOOTH&lt;br /&gt;
  Scissor    = false&lt;br /&gt;
  Texture    = false&lt;br /&gt;
  Lighting    = false,&lt;br /&gt;
  ColorMask  = true, true, true, true&lt;br /&gt;
  DepthMask  = false&lt;br /&gt;
  DepthTest  = false  (GL.LEQUAL)&lt;br /&gt;
  Culling    = false  (GL.BACK)&lt;br /&gt;
  LogicOp    = false  (GL.INVERT)&lt;br /&gt;
  AlphaTest  = false  (GL.GREATER, 0.5f)&lt;br /&gt;
  Blending   = true (GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA)&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ResetMatrices&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  Resets GL.TEXTURE matrix stack&lt;br /&gt;
  Resets GL.MODELVIEW matrix stack&lt;br /&gt;
  Resets GL.PROJECTION matrix stack&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Draw Basics =&lt;br /&gt;
&#039;&#039;&#039;gl.BeginEnd&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Drawing_Primitives|GLType]], function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Color&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b[, number a] } |&lt;br /&gt;
      number r, number g, number b[, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Vertex&#039;&#039;&#039;&lt;br /&gt;
  ( { number x, number y [, number z [, number w ]] } |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Normal&#039;&#039;&#039;&lt;br /&gt;
  (  number x, number y, number z |&lt;br /&gt;
   { number x, number y, number z } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rect&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexRect&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;texture rect&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2,&lt;br /&gt;
  [ boolean flip_s, boolean flip_t | number s1, number t1, number s2, number t2 ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Shape&#039;&#039;&#039;&lt;br /&gt;
 ( number [[Lua_ConstGL#Drawing_Primitives|GLtype]],&lt;br /&gt;
   elements = {&lt;br /&gt;
     [1] = { v | vertex   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;required&amp;lt;/font&amp;gt;&lt;br /&gt;
             n | normal   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             t | texcoord = { number x, number y },                     &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             c | color    = { number r, number g, number b, number a }  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
     },&lt;br /&gt;
     etc ...&lt;br /&gt;
   }&lt;br /&gt;
 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SecondaryColor&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b } |&lt;br /&gt;
      number r, number g, number b ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FogCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Display Lists =&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Display Lists save given vertex attributes in a static buffer, so the GPU can directly read them (without the CPU). Display Lists are a lot faster (10-60x) than standard drawing with glShape/glBeginEnd, so try to use them when ever you can. If you want to learn more about them, g00gle is your friend ;)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateList&#039;&#039;&#039;&lt;br /&gt;
  ( function [,arg1 [,arg2...]] ) -&amp;gt; number listID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CallList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Vertex Array Objects =&lt;br /&gt;
&amp;lt;span class=note&amp;gt; &amp;lt;font color=darkblue&amp;gt; Only available in &amp;quot;develop&amp;quot; branch of spring (the future 105.0+). This is conceptually similar and serve as modern OpenGL replacement to deprecated Display Lists. &amp;lt;/font&amp;gt; &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number numElements, number numIndices, [boolean persistentBuffer = false] ) -&amp;gt; number bufferID&lt;br /&gt;
&lt;br /&gt;
See what elements and indices are here: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-9-vbo-indexing/&amp;lt;br&amp;gt;&lt;br /&gt;
numElements and numIndices define the size of for elements and indices respectively. if indices are not going to be used, then set numIndices to 0&amp;lt;br&amp;gt;&lt;br /&gt;
Persistent buffers (persistentBuffer = true) are more efficient for dynamically/often updated geometry.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UpdateVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number bufferID, number elementPos, number indexPos, table tbl | function func ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
{elementPos, indexPos} define starting element in {element, index} VBO corresponding to 1st element of the supplied vertex data&amp;lt;br&amp;gt;&lt;br /&gt;
4 elements table example:&amp;lt;br&amp;gt;&lt;br /&gt;
  local verts = {&lt;br /&gt;
    p  = {0,0,0,1,  4,0,0,1,  4,4,0,1,  0,4,0,1},&lt;br /&gt;
    n  = {0,1,0  ,  0,1,0  ,  0,1,0  ,  0,1,0  },&lt;br /&gt;
    uv = {0,0,0,0,  1,0,0,0,  1,1,0,0,  0,1,0,0},&lt;br /&gt;
    c0 = {1,0,0,1,  0,1,0,1,  0,0,1,1,  1,1,1,0},&lt;br /&gt;
    i = {0, 1, 2, 2, 1, 3},            &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional, use in case of indexed VBO&amp;lt;/font&amp;gt;&lt;br /&gt;
    c1 = {...} }&lt;br /&gt;
&amp;lt;br&amp;gt;Alternatively Lua func can use gl.Vertex/gl.Color/gl.Normal/gl.TexCoord to define vertices, similarly how it used to be done in gl.BeginEnd.Note there is no function yet to define indices.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number bufferID, number primType, [number firstIndex = 0, count = numElements]  ) -&amp;gt; boolean success&lt;br /&gt;
primType can be GL.POINTS, GL.LINE_STRIP, GL.LINE_LOOP, GL.LINES, GL.LINE_STRIP_ADJACENCY, GL.LINES_ADJACENCY, GL.TRIANGLE_STRIP, GL.TRIANGLE_FAN, GL.TRIANGLES, GL.TRIANGLE_STRIP_ADJACENCY, GL.TRIANGLES_ADJACENCY and GL.PATCHES&amp;lt;br&amp;gt;&lt;br /&gt;
firstIndex specifies the starting index in the enabled arrays.&amp;lt;br&amp;gt;&lt;br /&gt;
count specifies the number of indices to be rendered.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteVertexArray&#039;&#039;&#039;&lt;br /&gt;
 ( number bufferID ) -&amp;gt; boolean success&lt;br /&gt;
Releases previously allocated VAO&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Text =&lt;br /&gt;
&#039;&#039;&#039;gl.Text&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;, number x, number y, number size [, string &amp;lt;span class=note&amp;gt;&amp;quot;options&amp;quot;&amp;lt;/span&amp;gt;] )&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
  options are:&lt;br /&gt;
    horizontal alignment:&lt;br /&gt;
       &#039;c&#039; = center&lt;br /&gt;
       &#039;r&#039; = right&lt;br /&gt;
    vertical alignment:&lt;br /&gt;
       &#039;a&#039; = ascender&lt;br /&gt;
       &#039;t&#039; = top&lt;br /&gt;
       &#039;v&#039; = vertical center&lt;br /&gt;
       &#039;x&#039; = baseline&lt;br /&gt;
       &#039;b&#039; = bottom&lt;br /&gt;
       &#039;d&#039; = descender&lt;br /&gt;
    decorations:&lt;br /&gt;
       &#039;o&#039; = black outline&lt;br /&gt;
       &#039;O&#039; = white outline&lt;br /&gt;
       &#039;s&#039; = shadow&lt;br /&gt;
    other:&lt;br /&gt;
       &#039;n&#039; = don&#039;t round vertex coords to nearest integer (font may get blurry)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
http://home.arcor.de/jkei/fontlines.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextWidth&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;) -&amp;gt; number width  &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextHeight&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;text&amp;quot; ) -&amp;gt; nil | number height, number descender, number numlines &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;further descriptions here: [[GetTextHeight]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&amp;lt;b&amp;gt;If you have multiple gl.Text calls, then you can bunch them between a gl.BeginText and gl.EndText to speedup the rendering.&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;gl.BeginText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.EndText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Unit/Feature Draw Functions =&lt;br /&gt;
&#039;&#039;&#039;gl.Unit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws an unit; on default it uses LOD, with lod&amp;lt;0 it is turned off, else it defines a specific level)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitRaw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(doesn&#039;t apply worldspace-&amp;gt;unit transformation! only works if &amp;lt;i&amp;gt;rawdraw&amp;lt;/i&amp;gt; is true )&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShape&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID, number teamID, bool rawState, bool toScreen, bool opaque ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|101.0}} The three extra boolean arguments make it so that calling only these functions is enough to get correctly rendered models; pass in &#039;false&#039; for the THIRD argument to get the fixed behavior, omit it or pass in &#039;true&#039; [default] to render with your own custom state instead. The FOURTH argument should be &#039;true&#039; if in DrawScreen and &#039;false&#039; (default) if in DrawWorld; any transforms for these two functions *MUST* include a gl.LoadIdentity call when argument #3 is false (whether they are used in DrawWorld or in DrawScreen) the FIFTH argument determines whether the model is drawn opaque (&#039;true&#039; [default]) or with translucency (&#039;false&#039;); only has an effect when argument #3 is false.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; unit space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(unit space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPiece&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the unit piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.UnitPieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Feature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureRaw&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShape&#039;&#039;&#039;&lt;br /&gt;
  ( number featureDefID, number teamID, bool custom, bool drawScreen, bool opaque  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; feature space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(feature space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePiece&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the Feature piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.FeaturePieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawListAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number listID, [ boolean midPos,&lt;br /&gt;
      number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
      number degrees, number rotX, number rotX, number rotZ ] ) -&amp;gt; nil &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawFuncAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean midPos, function [, arg1,... ]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= States (Blending,AlphaTest...) =&lt;br /&gt;
&#039;&#039;&#039;gl.Blending&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
  ( string &amp;lt;span class=note&amp;gt;mode&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99&amp;quot; | mode maybe:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.ONE, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha_add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;reset&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;color&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_COLOR, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;modulate&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.DST_COLOR, GL.ZERO&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;disable&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquation&#039;&#039;&#039;&lt;br /&gt;
  ( number mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquationSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number modeRGB, number modeAlpha ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcRGB]], number [[Lua_ConstGL#BlendingFactorDest|dstRGB]],  number [[Lua_ConstGL#BlendingFactorSrc|srcAlpha]], number [[Lua_ConstGL#BlendingFactorDest|dstAlpha]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.AlphaTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]], number threshold ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Culling&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#Culling|face]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthClamp&#039;&#039;&#039;  &amp;lt;span class=warning&amp;gt;not always available, needs GL.NV_depth_clamp!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ColorMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( boolean r, boolean g, boolean b, boolean a ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LogicOp&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#LogicOp|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Fog&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Smoothing&#039;&#039;&#039; {{removed|104.0}}&lt;br /&gt;
 ( (boolean enable | number POINT), &lt;br /&gt;
   (boolean enable | number LINE),&lt;br /&gt;
   (boolean enable | number POLYGON) ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
 ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scissor&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( int x, int y, int w, int h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LineStipple&#039;&#039;&#039;&lt;br /&gt;
  ( string any ) -&amp;gt; nil &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(use springs default line stipple)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
  ( int factor, number pattern ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number [[Lua_ConstGL#PolygonMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonOffset&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number factor, number units ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushAttrib&#039;&#039;&#039;&lt;br /&gt;
  ( [ number [[Lua_ConstGL#glPushAttrib.28.29_bits|attrib]] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopAttrib&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Stencil =&lt;br /&gt;
&#039;&#039;&#039;gl.StencilTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMask&#039;&#039;&#039;&lt;br /&gt;
  ( number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOp&#039;&#039;&#039;&lt;br /&gt;
  ( number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMaskSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOpSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= LineWidth &amp;amp; PointSize =&lt;br /&gt;
&#039;&#039;&#039;gl.LineWidth&#039;&#039;&#039;&lt;br /&gt;
  ( number width ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSize&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(values != 1 can break severely on ATI cards, see http://springrts.com/mantis/view.php?id=2390)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number size ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSprite&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable, [boolean coord_replace, boolean coord_origin_upper] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointParameter&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number v1, number v2, number v3, &lt;br /&gt;
    [ number sizeMin, number sizeMax, number sizeFade ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Textures =&lt;br /&gt;
&#039;&#039;&#039;gl.Texture&#039;&#039;&#039;&lt;br /&gt;
  ( [ number texNum, ] boolean enable | string &amp;lt;span class=note&amp;gt;name&amp;lt;/span&amp;gt; ) -&amp;gt; nil | boolean loaded&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;This is the only call-out that is needed to load and draw any texture in a Lua script. All you have to do is pass it a valid path to a valid png and it will use that image for drawing any subsequent textured rectangles. This is shown in the last line of the following list of valid strings for the name parameter.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99; text-align:left&amp;quot; |`name` may be:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | #12&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 12 buildpic&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %34:1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 34 s3o tex2 (:0-&amp;gt;tex1,:1-&amp;gt;tex2)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %-102:0&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = featureDef 102 s3o tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | !56&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = lua generated texture 56 (= return value of gl.CreateTexture)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units2&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shadow&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = shadowmap&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = specular cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(removed in the latest develop)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $reflection &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = reflection cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(can be mipmaped starting from 104.0.1-714-ga29177f. Set CubeTexGenerateMipMaps=1 in settings)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shading&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = ground shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $grass&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = grass shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $heightmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = heightmap (needs HeightMapTexture=1 set in spring config)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $minimap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = minimap texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = same as &amp;quot;$reflection&amp;quot; {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $sky_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = defined for SSMF maps that have a skyReflectModTex {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = auto generated normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF specular texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_distr&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat distribution texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat normals texture {{new|101.0}}, used as &amp;quot;$ssmf_splat_normals&amp;quot; or &amp;quot;$ssmf_splat_normals:X&amp;quot;, &#039;X&#039; can be a value between 0 and 3, defaults to 0 if &amp;quot;:X&amp;quot; is omitted&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_emission&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF emission texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_parallax&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF parallax texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = currently active info texture (los, airlos, radar, jammer)&amp;lt;br/&amp;gt; Note that textures contain no data until user switches to their respective modes and non-active textures are not updated in the background, so will go stale&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_losmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = los texture (L-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_mtlmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = metal map texture (F4-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_hgtmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = height map texture (F1-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_blkmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = blocking map texture (F2-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the map in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the map in view. {{new|95}} &amp;lt;br/&amp;gt;To translate this to world position coordinates, use:&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;No clip control / clipspace for depth is [-1,1]&#039;&#039;&#039;&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(vec3(gl_TexCoord[0].st, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x) * 2.0 - 1.0, 1.0);&lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;Default if clip control is supported / clipspace for depth is [0,1].&#039;&#039;&#039;&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(gl_TexCoord[0].st * 2.0 - 1.0, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x, 1.0);&lt;br /&gt;
&lt;br /&gt;
  worldpos.xyz = worldpos.xyz / worldpos.w; &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the models in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the models in view.  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | ${opt}:/LuaUI/images/image.png &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = load a texture from the VFS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
   possible ${opt}&#039;s are:&lt;br /&gt;
      &#039;n&#039; = nearest&lt;br /&gt;
      &#039;l&#039; = linear&lt;br /&gt;
      &#039;a&#039; = aniso&lt;br /&gt;
      &#039;i&#039; = invert&lt;br /&gt;
      &#039;g&#039; = greyed&lt;br /&gt;
      &#039;c&#039; = clamped&lt;br /&gt;
      &#039;b&#039; = border&lt;br /&gt;
      &#039;t%r,%g,%b&#039; = tint&lt;br /&gt;
      &#039;r%width,%height&#039; = resize&lt;br /&gt;
   The above ${opt}&#039;s are NOT available for .DDS textures! .dds will load faster than other image formats.&lt;br /&gt;
&lt;br /&gt;
    example: &amp;quot;:iac:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example: &amp;quot;:cr16,16:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example2: &amp;quot;:t1.0,0.5,0:/LuaUI/images/image.png&amp;quot;  (orange tint)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
  [ { &lt;br /&gt;
    [target     = number,] &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(like GL.TEXTURE_1D,GL.TEXTURE_2D,...)&amp;lt;/font&amp;gt; &amp;lt;font color=darkblue&amp;gt; (Added support for GL_TEXTURE_2D_MULTISAMPLE in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [format     = number,]&lt;br /&gt;
    [min_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [mag_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [wrap_s     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_t     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_r     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [aniso      = number,]&lt;br /&gt;
    [border     = boolean,]&lt;br /&gt;
    [fbo        = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [fboDepth   = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [samples    = number,] &amp;lt;font color=darkblue&amp;gt; specify any number here and target = GL_TEXTURE_2D_MULTISAMPLE to create multisample texture (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  } ]&lt;br /&gt;
  ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTexture&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTextureFBO&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TextureInfo&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; nil | {&lt;br /&gt;
      xsize = number,&lt;br /&gt;
      ysize = number,&lt;br /&gt;
      alpha = boolean, //not used yet&lt;br /&gt;
      type  = number,  //not used yet&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
   the format of the texture string is the same as in gl.Texture()&lt;br /&gt;
&amp;lt;/font&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number x | &lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum,&lt;br /&gt;
    number x |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexGen&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexGen&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil       &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CopyToTexture&#039;&#039;&#039;&lt;br /&gt;
  (string texture, int xoff, int yoff, int x, int y, int w, int h &lt;br /&gt;
  [,number target,number level])-&amp;gt;nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderToTexture&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string fbotexture, lua_func ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GenerateMipmap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs glGenerateMipmapEXT!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
The following are primarily intended to be used in conjunction with&lt;br /&gt;
     gl.{Unit,Feature}(objID, ..., raw=true)&lt;br /&gt;
     gl.{Unit,Feature}Shape(defID, ..., raw=true)&lt;br /&gt;
and apply a model&#039;s default textures; easier than gl.Texture(&amp;quot;$%...&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
= PixelReadback =&lt;br /&gt;
&#039;&#039;&#039;gl.SaveImage&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h,&lt;br /&gt;
    string filename [, table {alpha=boolean, yflip=boolean, grayscale16bit=boolean, readbuffer=number} ] ) -&amp;gt; nil | boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;grayscale16bit is {{new|99.0}} and allows to save single color 16bit PNG&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;readbuffer is {{new|104+}} and allows to choose the attachment of MRT FBO, use GL_COLOR_ATTACHMENT0_EXT and further as index&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ReadPixels&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h [, number format = GL.RGBA ] )&lt;br /&gt;
    -&amp;gt; nil &lt;br /&gt;
    | number r,[g,[b,[a]]] &lt;br /&gt;
    | table { { {1 = number r, 2 = number g, 3 = number b, 4 = number a}, ... }, ... }&lt;br /&gt;
&lt;br /&gt;
= Lights =&lt;br /&gt;
&#039;&#039;&#039;gl.Lighting&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ShadeModel&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#ShadeModel|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Light&#039;&#039;&#039;&lt;br /&gt;
  ( int light, &lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param1, number param2, number param3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Material&#039;&#039;&#039;&lt;br /&gt;
  ({&lt;br /&gt;
    ambient   = {number r, number g, number b[, number a]},&lt;br /&gt;
    diffuse   = {number r, number g, number b[, number a]},&lt;br /&gt;
    ambidiff  = {number r, number g, number b[, number a]},&lt;br /&gt;
    emission  = {number r, number g, number b[, number a]},&lt;br /&gt;
    specular  = {number r, number g, number b[, number a]},&lt;br /&gt;
    shininess = number specularExponent&lt;br /&gt;
  }) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Hardware relevant =&lt;br /&gt;
&#039;&#039;&#039;gl.HasExtension&#039;&#039;&#039;&lt;br /&gt;
  ( string extname ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetNumber&#039;&#039;&#039;&lt;br /&gt;
  ( number ext, int count ) -&amp;gt; number [, number, number, ... #count ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetString&#039;&#039;&#039;&lt;br /&gt;
  ( number ext ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= DrawGroundPrimitives =&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundCircle&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z, number radius, number divs [, number slope ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: number divs is the number of sides the circle will have. the higher the smoother the circle (and more GPU intensive) &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundQuad&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: x1,z1,x2 &amp;amp; z2 are rounded, so don&#039;t use it for very small or moving objects. x and z are correspond to the coordinates displayed by the tooltip &amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number z1, number x2, number z2,&lt;br /&gt;
    [ boolean useNorm, &amp;lt;span class=warning&amp;gt;(does nothing!)&amp;lt;/span&amp;gt;&lt;br /&gt;
      [ number tu1, number tv1, number tu2, number tv2 |&lt;br /&gt;
        boolean useTextureCoord ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Queries =&lt;br /&gt;
&#039;&#039;&#039;gl.CreateQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; nil | userdata query&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.RunQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query, function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.GetQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil | number renderedFragments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Extended =&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexNames&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; { [1] = string texture, etc ... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexCoords&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;gets the texcoord of a 3do texture in the 3do texture atlas&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string 3doTextureName ) -&amp;gt; number xstart, number ystart, number xend, number yend&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeState&#039;&#039;&#039;&lt;br /&gt;
  ( number state [, boolean disable_state ], function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Calls glEnable(state) or glDisable(state) (if disable_state==true) and&amp;lt;br&amp;gt;then calls the lua_function and afterwards reverts the state.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetShadowMapParams&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; number xmid, number ymid, number p17, number p18&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMatrixData&#039;&#039;&#039;&lt;br /&gt;
  ( GL.PROJECTION [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( GL.MODELVIEW  [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i] &lt;br /&gt;
  ( GL.TEXTURE    [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( &amp;quot;shadow&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camera&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;caminv&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camprj&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;billboard&amp;quot; )             -&amp;gt; nil | number, etc.. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Flush&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Finish&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Shaders (GLSL) =&lt;br /&gt;
  [[Lua_GLSL_Api]]&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11518</id>
		<title>Lua OpenGL Api</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11518"/>
		<updated>2020-03-07T21:42:32Z</updated>

		<summary type="html">&lt;p&gt;Ivand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
= Spring =&lt;br /&gt;
&#039;&#039;&#039;gl.GetSun&#039;&#039;&#039;&lt;br /&gt;
  &amp;lt;font style=&amp;quot;font-size:90%&amp;quot;&amp;gt;()        -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;pos&amp;quot; ) -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;shadowDensity&amp;quot; [, &amp;quot;unit&amp;quot;] ) -&amp;gt; number shadowDensity&lt;br /&gt;
  ( &amp;quot;diffuse&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;ambient&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;specular&amp;quot;      [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetAtmosphere&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Sun|Spring.SetAtmosphere]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetWaterRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | string texName | number scalar | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetWaterParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMapRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetMapRenderingParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigScreen&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;used for Unit LODs&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number screenWidth, number screenDistance ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawMiniMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;argument new in 0.82+&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;boolean tansform = true&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SlaveMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( boolean mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( int px, int py, int sx, int sy ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetViewSizes&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number x, number y&lt;br /&gt;
&lt;br /&gt;
= Matrices &amp;amp; Viewport =&lt;br /&gt;
&#039;&#039;&#039;gl.Viewport&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;&#039;gl.Translate&#039;&#039;&#039;&lt;br /&gt;
  (number x, number y, number z) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scale&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rotate&#039;&#039;&#039;&lt;br /&gt;
  ( number angle, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Billboard&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Use this to draw 2d primitives in DrawWorld().&lt;br /&gt;
To render a 2D billboarded quad in the gameworld at world position x,y,z, you do the following (at a minimum; I am skipping blending / depthtesting) here:&lt;br /&gt;
  gl.PushMatrix()&lt;br /&gt;
  gl.Texture(read what you need here)&lt;br /&gt;
  gl.Translate(x,y,z)&lt;br /&gt;
  gl.Billboard()			&lt;br /&gt;
  gl.TexRect(x1,y1,x2,y2)&lt;br /&gt;
  gl.PopMatrix()&amp;lt;/span &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MatrixMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#MatrixMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadIdentity&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( 16 numbers or a [https://github.com/spring/spring/blob/develop/rts/Lua/LuaOpenGLUtils.cpp#L60 matrix name] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Ortho&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Frustum&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushPopMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ClipPlane&#039;&#039;&#039;&lt;br /&gt;
  ( int plane, &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: $plane can only be 1 or 2&amp;lt;/font&amp;gt;&lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number A, number B, number C, number D ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Clear =&lt;br /&gt;
&#039;&#039;&#039;gl.Clear&#039;&#039;&#039;&lt;br /&gt;
  ( GL.DEPTH_BUFFER_BIT [, number cleardepth] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.STENCIL_BUFFER_BIT [, int clearstencil] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.COLOR_BUFFER_BIT | GL.ACCUM_BUFFER_BIT [, number r, number g, number b, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SwapBuffers&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Available only in LuaMenu, meant for frame-limited LuaMenu&#039;s that want identical content in both buffers.&lt;br /&gt;
&lt;br /&gt;
= ResetState/Matrices =&lt;br /&gt;
&#039;&#039;&#039;gl.ResetState&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;DON&#039;T USE IT UNLESS YOU KNOW WHAT YOU ARE DOING! Each call-in has different default states, but this function resets all states to the states below no matter what!&amp;lt;/span&amp;gt;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  ShadeModel = GL.SMOOTH&lt;br /&gt;
  Scissor    = false&lt;br /&gt;
  Texture    = false&lt;br /&gt;
  Lighting    = false,&lt;br /&gt;
  ColorMask  = true, true, true, true&lt;br /&gt;
  DepthMask  = false&lt;br /&gt;
  DepthTest  = false  (GL.LEQUAL)&lt;br /&gt;
  Culling    = false  (GL.BACK)&lt;br /&gt;
  LogicOp    = false  (GL.INVERT)&lt;br /&gt;
  AlphaTest  = false  (GL.GREATER, 0.5f)&lt;br /&gt;
  Blending   = true (GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA)&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ResetMatrices&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  Resets GL.TEXTURE matrix stack&lt;br /&gt;
  Resets GL.MODELVIEW matrix stack&lt;br /&gt;
  Resets GL.PROJECTION matrix stack&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Draw Basics =&lt;br /&gt;
&#039;&#039;&#039;gl.BeginEnd&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Drawing_Primitives|GLType]], function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Color&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b[, number a] } |&lt;br /&gt;
      number r, number g, number b[, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Vertex&#039;&#039;&#039;&lt;br /&gt;
  ( { number x, number y [, number z [, number w ]] } |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Normal&#039;&#039;&#039;&lt;br /&gt;
  (  number x, number y, number z |&lt;br /&gt;
   { number x, number y, number z } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rect&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexRect&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;texture rect&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2,&lt;br /&gt;
  [ boolean flip_s, boolean flip_t | number s1, number t1, number s2, number t2 ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Shape&#039;&#039;&#039;&lt;br /&gt;
 ( number [[Lua_ConstGL#Drawing_Primitives|GLtype]],&lt;br /&gt;
   elements = {&lt;br /&gt;
     [1] = { v | vertex   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;required&amp;lt;/font&amp;gt;&lt;br /&gt;
             n | normal   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             t | texcoord = { number x, number y },                     &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             c | color    = { number r, number g, number b, number a }  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
     },&lt;br /&gt;
     etc ...&lt;br /&gt;
   }&lt;br /&gt;
 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SecondaryColor&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b } |&lt;br /&gt;
      number r, number g, number b ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FogCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Display Lists =&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Display Lists save given vertex attributes in a static buffer, so the GPU can directly read them (without the CPU). Display Lists are a lot faster (10-60x) than standard drawing with glShape/glBeginEnd, so try to use them when ever you can. If you want to learn more about them, g00gle is your friend ;)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateList&#039;&#039;&#039;&lt;br /&gt;
  ( function [,arg1 [,arg2...]] ) -&amp;gt; number listID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CallList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Vertex Array Objects =&lt;br /&gt;
&amp;lt;span class=note&amp;gt; &amp;lt;font color=darkblue&amp;gt; Only available in &amp;quot;develop&amp;quot; branch of spring (the future 105.0+). This is conceptually similar and serve as modern OpenGL replacement to deprecated Display Lists. &amp;lt;/font&amp;gt; &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number numElements, number numIndices, [boolean persistentBuffer = false] ) -&amp;gt; number bufferID&lt;br /&gt;
&lt;br /&gt;
See what elements and indices are here: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-9-vbo-indexing/&amp;lt;br&amp;gt;&lt;br /&gt;
numElements and numIndices define the size of for elements and indices respectively. if indices are not going to be used, then set numIndices to 0&amp;lt;br&amp;gt;&lt;br /&gt;
Persistent buffers (persistentBuffer = true) are more efficient for dynamically/often updated geometry.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UpdateVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number bufferID, number elementPos, number indexPos, table tbl | function func ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
{elementPos, indexPos} define starting element in {element, index} VBO corresponding to 1st element of the supplied vertex data&amp;lt;br&amp;gt;&lt;br /&gt;
4 elements table example:&amp;lt;br&amp;gt;&lt;br /&gt;
  local verts = {&lt;br /&gt;
    p  = {0,0,0,1,  4,0,0,1,  4,4,0,1,  0,4,0,1},&lt;br /&gt;
    n  = {0,1,0  ,  0,1,0  ,  0,1,0  ,  0,1,0  },&lt;br /&gt;
    uv = {0,0,0,0,  1,0,0,0,  1,1,0,0,  0,1,0,0},&lt;br /&gt;
    c0 = {1,0,0,1,  0,1,0,1,  0,0,1,1,  1,1,1,0},&lt;br /&gt;
    i = {0, 1, 2, 2, 1, 3},            &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional, use in case of indexed VBO&amp;lt;/font&amp;gt;&lt;br /&gt;
    c1 = {...} }&lt;br /&gt;
&amp;lt;br&amp;gt;Alternatively Lua func can use gl.Vertex/gl.Color/gl.Normal/gl.TexCoord to define vertices, similarly how it used to be done in gl.BeginEnd.Note there is no function yet to define indices.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number bufferID, number primType, [number firstIndex = 0, count = numElements]  ) -&amp;gt; boolean success&lt;br /&gt;
primType can be GL.POINTS, GL.LINE_STRIP, GL.LINE_LOOP, GL.LINES, GL.LINE_STRIP_ADJACENCY, GL.LINES_ADJACENCY, GL.TRIANGLE_STRIP, GL.TRIANGLE_FAN, GL.TRIANGLES, GL.TRIANGLE_STRIP_ADJACENCY, GL.TRIANGLES_ADJACENCY and GL.PATCHES&amp;lt;br&amp;gt;&lt;br /&gt;
firstIndex specifies the starting index in the enabled arrays.&amp;lt;br&amp;gt;&lt;br /&gt;
count specifies the number of indices to be rendered.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteVertexArray&#039;&#039;&#039;&lt;br /&gt;
 ( number bufferID ) -&amp;gt; boolean success&lt;br /&gt;
Releases previously allocated VAO&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Text =&lt;br /&gt;
&#039;&#039;&#039;gl.Text&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;, number x, number y, number size [, string &amp;lt;span class=note&amp;gt;&amp;quot;options&amp;quot;&amp;lt;/span&amp;gt;] )&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
  options are:&lt;br /&gt;
    horizontal alignment:&lt;br /&gt;
       &#039;c&#039; = center&lt;br /&gt;
       &#039;r&#039; = right&lt;br /&gt;
    vertical alignment:&lt;br /&gt;
       &#039;a&#039; = ascender&lt;br /&gt;
       &#039;t&#039; = top&lt;br /&gt;
       &#039;v&#039; = vertical center&lt;br /&gt;
       &#039;x&#039; = baseline&lt;br /&gt;
       &#039;b&#039; = bottom&lt;br /&gt;
       &#039;d&#039; = descender&lt;br /&gt;
    decorations:&lt;br /&gt;
       &#039;o&#039; = black outline&lt;br /&gt;
       &#039;O&#039; = white outline&lt;br /&gt;
       &#039;s&#039; = shadow&lt;br /&gt;
    other:&lt;br /&gt;
       &#039;n&#039; = don&#039;t round vertex coords to nearest integer (font may get blurry)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
http://home.arcor.de/jkei/fontlines.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextWidth&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;) -&amp;gt; number width  &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextHeight&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;text&amp;quot; ) -&amp;gt; nil | number height, number descender, number numlines &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;further descriptions here: [[GetTextHeight]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&amp;lt;b&amp;gt;If you have multiple gl.Text calls, then you can bunch them between a gl.BeginText and gl.EndText to speedup the rendering.&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;gl.BeginText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.EndText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Unit/Feature Draw Functions =&lt;br /&gt;
&#039;&#039;&#039;gl.Unit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws an unit; on default it uses LOD, with lod&amp;lt;0 it is turned off, else it defines a specific level)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitRaw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(doesn&#039;t apply worldspace-&amp;gt;unit transformation! only works if &amp;lt;i&amp;gt;rawdraw&amp;lt;/i&amp;gt; is true )&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShape&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID, number teamID, bool rawState, bool toScreen, bool opaque ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|101.0}} The three extra boolean arguments make it so that calling only these functions is enough to get correctly rendered models; pass in &#039;false&#039; for the THIRD argument to get the fixed behavior, omit it or pass in &#039;true&#039; [default] to render with your own custom state instead. The FOURTH argument should be &#039;true&#039; if in DrawScreen and &#039;false&#039; (default) if in DrawWorld; any transforms for these two functions *MUST* include a gl.LoadIdentity call when argument #3 is false (whether they are used in DrawWorld or in DrawScreen) the FIFTH argument determines whether the model is drawn opaque (&#039;true&#039; [default]) or with translucency (&#039;false&#039;); only has an effect when argument #3 is false.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; unit space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(unit space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPiece&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the unit piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.UnitPieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Feature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureRaw&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShape&#039;&#039;&#039;&lt;br /&gt;
  ( number featureDefID, number teamID, bool custom, bool drawScreen, bool opaque  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; feature space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(feature space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePiece&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the Feature piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.FeaturePieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawListAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number listID, [ boolean midPos,&lt;br /&gt;
      number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
      number degrees, number rotX, number rotX, number rotZ ] ) -&amp;gt; nil &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawFuncAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean midPos, function [, arg1,... ]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= States (Blending,AlphaTest...) =&lt;br /&gt;
&#039;&#039;&#039;gl.Blending&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
  ( string &amp;lt;span class=note&amp;gt;mode&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99&amp;quot; | mode maybe:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.ONE, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha_add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;reset&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;color&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_COLOR, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;modulate&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.DST_COLOR, GL.ZERO&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;disable&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquation&#039;&#039;&#039;&lt;br /&gt;
  ( number mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquationSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number modeRGB, number modeAlpha ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcRGB]], number [[Lua_ConstGL#BlendingFactorDest|dstRGB]],  number [[Lua_ConstGL#BlendingFactorSrc|srcAlpha]], number [[Lua_ConstGL#BlendingFactorDest|dstAlpha]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.AlphaTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]], number threshold ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Culling&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#Culling|face]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthClamp&#039;&#039;&#039;  &amp;lt;span class=warning&amp;gt;not always available, needs GL.NV_depth_clamp!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ColorMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( boolean r, boolean g, boolean b, boolean a ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LogicOp&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#LogicOp|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Fog&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Smoothing&#039;&#039;&#039; {{removed|104.0}}&lt;br /&gt;
 ( (boolean enable | number POINT), &lt;br /&gt;
   (boolean enable | number LINE),&lt;br /&gt;
   (boolean enable | number POLYGON) ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
 ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scissor&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( int x, int y, int w, int h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LineStipple&#039;&#039;&#039;&lt;br /&gt;
  ( string any ) -&amp;gt; nil &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(use springs default line stipple)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
  ( int factor, number pattern ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number [[Lua_ConstGL#PolygonMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonOffset&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number factor, number units ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushAttrib&#039;&#039;&#039;&lt;br /&gt;
  ( [ number [[Lua_ConstGL#glPushAttrib.28.29_bits|attrib]] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopAttrib&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Stencil =&lt;br /&gt;
&#039;&#039;&#039;gl.StencilTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMask&#039;&#039;&#039;&lt;br /&gt;
  ( number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOp&#039;&#039;&#039;&lt;br /&gt;
  ( number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMaskSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOpSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= LineWidth &amp;amp; PointSize =&lt;br /&gt;
&#039;&#039;&#039;gl.LineWidth&#039;&#039;&#039;&lt;br /&gt;
  ( number width ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSize&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(values != 1 can break severely on ATI cards, see http://springrts.com/mantis/view.php?id=2390)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number size ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSprite&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable, [boolean coord_replace, boolean coord_origin_upper] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointParameter&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number v1, number v2, number v3, &lt;br /&gt;
    [ number sizeMin, number sizeMax, number sizeFade ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Textures =&lt;br /&gt;
&#039;&#039;&#039;gl.Texture&#039;&#039;&#039;&lt;br /&gt;
  ( [ number texNum, ] boolean enable | string &amp;lt;span class=note&amp;gt;name&amp;lt;/span&amp;gt; ) -&amp;gt; nil | boolean loaded&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;This is the only call-out that is needed to load and draw any texture in a Lua script. All you have to do is pass it a valid path to a valid png and it will use that image for drawing any subsequent textured rectangles. This is shown in the last line of the following list of valid strings for the name parameter.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99; text-align:left&amp;quot; |`name` may be:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | #12&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 12 buildpic&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %34:1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 34 s3o tex2 (:0-&amp;gt;tex1,:1-&amp;gt;tex2)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %-102:0&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = featureDef 102 s3o tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | !56&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = lua generated texture 56 (= return value of gl.CreateTexture)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units2&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shadow&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = shadowmap&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = specular cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(removed in the latest develop)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $reflection &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = reflection cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(can be mipmaped starting from 104.0.1-714-ga29177f. Set CubeTexGenerateMipMaps=1 in settings)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shading&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = ground shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $grass&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = grass shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $heightmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = heightmap (needs HeightMapTexture=1 set in spring config)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $minimap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = minimap texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = same as &amp;quot;$reflection&amp;quot; {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $sky_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = defined for SSMF maps that have a skyReflectModTex {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = auto generated normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF specular texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_distr&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat distribution texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat normals texture {{new|101.0}}, used as &amp;quot;$ssmf_splat_normals&amp;quot; or &amp;quot;$ssmf_splat_normals:X&amp;quot;, &#039;X&#039; can be a value between 0 and 3, defaults to 0 if &amp;quot;:X&amp;quot; is omitted&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_emission&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF emission texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_parallax&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF parallax texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = currently active info texture (los, airlos, radar, jammer)&amp;lt;br/&amp;gt; Note that textures contain no data until user switches to their respective modes and non-active textures are not updated in the background, so will go stale&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_losmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = los texture (L-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_mtlmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = metal map texture (F4-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_hgtmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = height map texture (F1-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_blkmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = blocking map texture (F2-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the map in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the map in view. {{new|95}} &amp;lt;br/&amp;gt;To translate this to world position coordinates, use:&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;No clip control / clipspace for depth is [-1,1]&#039;&#039;&#039;&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(vec3(gl_TexCoord[0].st, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x) * 2.0 - 1.0, 1.0);&lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;Default if clip control is supported / clipspace for depth is [0,1].&#039;&#039;&#039;&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(gl_TexCoord[0].st * 2.0 - 1.0, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x, 1.0);&lt;br /&gt;
&lt;br /&gt;
  worldpos.xyz = worldpos.xyz / worldpos.w; &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the models in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the models in view.  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | ${opt}:/LuaUI/images/image.png &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = load a texture from the VFS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
   possible ${opt}&#039;s are:&lt;br /&gt;
      &#039;n&#039; = nearest&lt;br /&gt;
      &#039;l&#039; = linear&lt;br /&gt;
      &#039;a&#039; = aniso&lt;br /&gt;
      &#039;i&#039; = invert&lt;br /&gt;
      &#039;g&#039; = greyed&lt;br /&gt;
      &#039;c&#039; = clamped&lt;br /&gt;
      &#039;b&#039; = border&lt;br /&gt;
      &#039;t%r,%g,%b&#039; = tint&lt;br /&gt;
      &#039;r%width,%height&#039; = resize&lt;br /&gt;
   The above ${opt}&#039;s are NOT available for .DDS textures! .dds will load faster than other image formats.&lt;br /&gt;
&lt;br /&gt;
    example: &amp;quot;:iac:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example: &amp;quot;:cr16,16:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example2: &amp;quot;:t1.0,0.5,0:/LuaUI/images/image.png&amp;quot;  (orange tint)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
  [ { &lt;br /&gt;
    [target     = number,] &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(like GL.TEXTURE_1D,GL.TEXTURE_2D,...)&amp;lt;/font&amp;gt; &amp;lt;font color=darkblue&amp;gt; (Added support for GL_TEXTURE_2D_MULTISAMPLE in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [format     = number,]&lt;br /&gt;
    [min_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [mag_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [wrap_s     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_t     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_r     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [aniso      = number,]&lt;br /&gt;
    [border     = boolean,]&lt;br /&gt;
    [fbo        = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [fboDepth   = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [samples    = number,] &amp;lt;font color=darkblue&amp;gt; specify any number here and target = GL_TEXTURE_2D_MULTISAMPLE to create multisample texture (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  } ]&lt;br /&gt;
  ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTexture&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTextureFBO&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TextureInfo&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; nil | {&lt;br /&gt;
      xsize = number,&lt;br /&gt;
      ysize = number,&lt;br /&gt;
      alpha = boolean, //not used yet&lt;br /&gt;
      type  = number,  //not used yet&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
   the format of the texture string is the same as in gl.Texture()&lt;br /&gt;
&amp;lt;/font&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number x | &lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum,&lt;br /&gt;
    number x |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexGen&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexGen&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil       &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CopyToTexture&#039;&#039;&#039;&lt;br /&gt;
  (string texture, int xoff, int yoff, int x, int y, int w, int h &lt;br /&gt;
  [,number target,number level])-&amp;gt;nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderToTexture&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string fbotexture, lua_func ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GenerateMipmap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs glGenerateMipmapEXT!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
The following are primarily intended to be used in conjunction with&lt;br /&gt;
     gl.{Unit,Feature}(objID, ..., raw=true)&lt;br /&gt;
     gl.{Unit,Feature}Shape(defID, ..., raw=true)&lt;br /&gt;
and apply a model&#039;s default textures; easier than gl.Texture(&amp;quot;$%...&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
= PixelReadback =&lt;br /&gt;
&#039;&#039;&#039;gl.SaveImage&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h,&lt;br /&gt;
    string filename [, table {alpha=boolean, yflip=boolean, grayscale16bit=boolean, readbuffer=number} ] ) -&amp;gt; nil | boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;grayscale16bit is {{new|99.0}} and allows to save single color 16bit PNG&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;readbuffer is {{new|104+}} and allows to choose the attachment number from MRT FBO&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ReadPixels&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h [, number format = GL.RGBA ] )&lt;br /&gt;
    -&amp;gt; nil &lt;br /&gt;
    | number r,[g,[b,[a]]] &lt;br /&gt;
    | table { { {1 = number r, 2 = number g, 3 = number b, 4 = number a}, ... }, ... }&lt;br /&gt;
&lt;br /&gt;
= Lights =&lt;br /&gt;
&#039;&#039;&#039;gl.Lighting&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ShadeModel&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#ShadeModel|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Light&#039;&#039;&#039;&lt;br /&gt;
  ( int light, &lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param1, number param2, number param3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Material&#039;&#039;&#039;&lt;br /&gt;
  ({&lt;br /&gt;
    ambient   = {number r, number g, number b[, number a]},&lt;br /&gt;
    diffuse   = {number r, number g, number b[, number a]},&lt;br /&gt;
    ambidiff  = {number r, number g, number b[, number a]},&lt;br /&gt;
    emission  = {number r, number g, number b[, number a]},&lt;br /&gt;
    specular  = {number r, number g, number b[, number a]},&lt;br /&gt;
    shininess = number specularExponent&lt;br /&gt;
  }) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Hardware relevant =&lt;br /&gt;
&#039;&#039;&#039;gl.HasExtension&#039;&#039;&#039;&lt;br /&gt;
  ( string extname ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetNumber&#039;&#039;&#039;&lt;br /&gt;
  ( number ext, int count ) -&amp;gt; number [, number, number, ... #count ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetString&#039;&#039;&#039;&lt;br /&gt;
  ( number ext ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= DrawGroundPrimitives =&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundCircle&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z, number radius, number divs [, number slope ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: number divs is the number of sides the circle will have. the higher the smoother the circle (and more GPU intensive) &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundQuad&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: x1,z1,x2 &amp;amp; z2 are rounded, so don&#039;t use it for very small or moving objects. x and z are correspond to the coordinates displayed by the tooltip &amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number z1, number x2, number z2,&lt;br /&gt;
    [ boolean useNorm, &amp;lt;span class=warning&amp;gt;(does nothing!)&amp;lt;/span&amp;gt;&lt;br /&gt;
      [ number tu1, number tv1, number tu2, number tv2 |&lt;br /&gt;
        boolean useTextureCoord ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Queries =&lt;br /&gt;
&#039;&#039;&#039;gl.CreateQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; nil | userdata query&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.RunQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query, function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.GetQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil | number renderedFragments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Extended =&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexNames&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; { [1] = string texture, etc ... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexCoords&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;gets the texcoord of a 3do texture in the 3do texture atlas&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string 3doTextureName ) -&amp;gt; number xstart, number ystart, number xend, number yend&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeState&#039;&#039;&#039;&lt;br /&gt;
  ( number state [, boolean disable_state ], function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Calls glEnable(state) or glDisable(state) (if disable_state==true) and&amp;lt;br&amp;gt;then calls the lua_function and afterwards reverts the state.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetShadowMapParams&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; number xmid, number ymid, number p17, number p18&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMatrixData&#039;&#039;&#039;&lt;br /&gt;
  ( GL.PROJECTION [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( GL.MODELVIEW  [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i] &lt;br /&gt;
  ( GL.TEXTURE    [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( &amp;quot;shadow&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camera&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;caminv&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camprj&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;billboard&amp;quot; )             -&amp;gt; nil | number, etc.. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Flush&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Finish&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Shaders (GLSL) =&lt;br /&gt;
  [[Lua_GLSL_Api]]&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Building_Spring_on_Windows&amp;diff=3717</id>
		<title>Building Spring on Windows</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Building_Spring_on_Windows&amp;diff=3717"/>
		<updated>2019-11-12T00:43:05Z</updated>

		<summary type="html">&lt;p&gt;Ivand: AI_TYPES = NONE&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Building_spring|Building Spring]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
{{#css:&lt;br /&gt;
  code * {margin:inherit;}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
If you only want to produce your own Spring game and not contribute to the core engine, compilation is not necessary. Check out [[Gamedev:Main]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=warning&amp;gt;Warning:&amp;lt;/span&amp;gt; Compiling Spring on Windows often causes problems, it is heavily recommended to use [[Building_Spring_on_Linux|Linux]] for developing the Spring RTS Engine if possible.&lt;br /&gt;
&lt;br /&gt;
Some reasons for this:&lt;br /&gt;
* Of the active developers nobody uses windows for developing. So they might not be able to help as effectively as on Linux.&lt;br /&gt;
* Setting up a build environment takes a lot more time on windows&lt;br /&gt;
* Compiling is often slower on windows&lt;br /&gt;
* Compiling on windows is poorly tested (which possibly leads to some random / unknown / weird errors)&lt;br /&gt;
&lt;br /&gt;
That said, if you do wish to use Windows, the best place to get real-time help is the #sy lobby channel, or #sy on [[IRC]].&lt;br /&gt;
&lt;br /&gt;
=Compiling with MinGW=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
Install [http://www.cmake.org/ CMake] and [http://msysgit.github.io/ msysGit] and MinGW-w64:&lt;br /&gt;
&lt;br /&gt;
When installing msysGit you should select the option to &amp;quot;Run Git from the Windows Command Prompt&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[File:Msysgit6.png|400px]]&lt;br /&gt;
&lt;br /&gt;
This is in order to automatically add Git to PATH making it easy for CMake to find.&lt;br /&gt;
&lt;br /&gt;
== Installing MinGW-w64 ==&lt;br /&gt;
&lt;br /&gt;
Download and run the &amp;quot;Mingw-builds project - native toolchains using trunk&amp;quot; installer from [http://mingw-w64.sourceforge.net/download.php MinGW-w64].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
[[File:InstallingMinGW-w64.png|400px]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Version:&#039;&#039;&#039; Any version above 4.8.x should work, 4.9.x+ may not have been tested as thoroughly.&lt;br /&gt;
* &#039;&#039;&#039;Architecture:&#039;&#039;&#039; i686&lt;br /&gt;
* &#039;&#039;&#039;Threads:&#039;&#039;&#039; posix&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; sjlj &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;This is the only setting which needs to be changed from the default&amp;lt;/span&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Build Revision:&#039;&#039;&#039; The latest one&lt;br /&gt;
&lt;br /&gt;
== Adding to PATH ==&lt;br /&gt;
&lt;br /&gt;
Once installed, you should add the MinGW directory to your PATH variable so that Cmake can find the relevant binaries. &lt;br /&gt;
&lt;br /&gt;
* Go to System properties (either via Control Panel\System and Security\System or by right clicking &#039;Computer&#039; on the desktop), then click &#039;Advanced System Settings&#039;. &lt;br /&gt;
* Click the &#039;Environment Variables&#039; button at the bottom. &lt;br /&gt;
* Find Path in the &#039;System Variables&#039; scrollbox, add an extra &amp;lt;code&amp;gt;;&amp;lt;/code&amp;gt; to the end and then copy-paste in the MinGW directory (e.g. default is &amp;lt;code&amp;gt;C:\Program Files (x86)\mingw-w64\i686-4.9.1-posix-sjlj-rt_v3-rev0\mingw32\bin&amp;lt;/code&amp;gt;). &lt;br /&gt;
* Alternative instructions with images are easy to find online, for example [http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx here].&lt;br /&gt;
&lt;br /&gt;
= Get the Source Code =&lt;br /&gt;
&lt;br /&gt;
* use git&#039;s bash (you find it in the right click context menu when clicking the folder), &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into your spring source dir&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone --recursive git://github.com/spring/spring.git -b develop&lt;br /&gt;
cd spring&lt;br /&gt;
git clone https://github.com/spring/mingwlibs&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* update it from time to time with: &amp;lt;code&amp;gt;git pull --rebase&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Make sure you install the package in the checkout directory, so the path is: /spring/mingwlibs. If done right, it will look like:&lt;br /&gt;
** */spring/&lt;br /&gt;
** */spring/...&lt;br /&gt;
** */spring/mingwlibs&lt;br /&gt;
** */spring/rts&lt;br /&gt;
&lt;br /&gt;
* Note: if you install the package somewhere else (preferably outside of the source tree), and pass its location with the &#039;&#039;MINGDIR&#039;&#039; option to CMake in the configure step (see further down, in the quick instructions).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== configure using CMake ==&lt;br /&gt;
&lt;br /&gt;
* run the &#039;&#039;cmake-gui&#039;&#039; and select a source and a build directory&lt;br /&gt;
* press &#039;&#039;&#039;Configure&#039;&#039;&#039; and follow the instructions&lt;br /&gt;
* In case of configuration errors make sure AI_TYPES variable is set to NONE (default is ALL). This should remedy the issues press &#039;&#039;&#039;Configure&#039;&#039;&#039; again&lt;br /&gt;
* press &#039;&#039;&#039;Generate&#039;&#039;&#039;&lt;br /&gt;
* open a console (&#039;&#039;cmd.exe&#039;&#039;), &#039;&#039;cd&#039;&#039; into your &#039;&#039;&#039;build&#039;&#039;&#039; directory&lt;br /&gt;
* &#039;&#039;optional:&#039;&#039; for multi-threaded compilation, the &#039;&#039;mingw32-make&#039;&#039; part may differ on your system: &amp;lt;code&amp;gt;&#039;&#039;&amp;lt;pre&amp;gt;set MAKE_COMMAND=mingw32-make -j2&amp;lt;/pre&amp;gt;&#039;&#039;&amp;lt;/code&amp;gt; (use -j4 for 4 threads)&lt;br /&gt;
* compile with: &amp;lt;code&amp;gt;&#039;&#039;&amp;lt;pre&amp;gt;mingw32-make install-spring&amp;lt;/pre&amp;gt;&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
* compile just the engine (spring.exe) with: &amp;lt;code&amp;gt;&#039;&#039;&amp;lt;pre&amp;gt;mingw32-make engine-legacy&amp;lt;/pre&amp;gt;&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Generating the AI Sources/Wrappers===&lt;br /&gt;
&lt;br /&gt;
you can either build the wrapper:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make Cpp-AIWrapper&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or generate all sources, in case you don&#039;t need the binary:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make generateSources&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Possible Problems===&lt;br /&gt;
* If you get &amp;lt;span class=warning&amp;gt;undefined reference to `_Unwind_Resume&#039;&amp;lt;/span&amp;gt; linking errors, deinstall &#039;&#039;whole&#039;&#039; MinGW and reinstall it with &#039;&#039;sjlj&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* When you installed an old version of MinGW/TDM and forgot to deinstall it correctly, &amp;lt;code&amp;gt;gcc.exe&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;g++.exe&amp;lt;/code&amp;gt; will be named &amp;lt;code&amp;gt;gcc-dw2.exe&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;g++-dw2.exe&amp;lt;/code&amp;gt;. CMake will then fail to find the correct one, first try to deinstall anything mingw related and reinstall everything. If that didn&#039;t helped just rename the files. If even that doesn&#039;t help open cmake-gui and click the advanced button and set the paths to the correct files yourself (&amp;lt;code&amp;gt;CMAKE_C_COMPILER&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;CMAKE_CXX_COMPILER&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
&lt;br /&gt;
You can still use Visual Studio 2012 as described below to edit the code. This is very useful because it allows excellent code navigation, and it highlights syntax errors and trivial mistakes before compiling. &lt;br /&gt;
&lt;br /&gt;
For debugging mingw builds, you can aquire a windows build of gdb from http://www.equation.com/servlet/equation.cmd?fa=gdb&lt;br /&gt;
&lt;br /&gt;
To start debugging, copy &#039;&#039;gdb.exe&#039;&#039; to your build output directory, and launch it with &#039;&#039;gdb spring.exe&#039;&#039;. You can supply command line arguments to &#039;&#039;spring.exe&#039;&#039; with &#039;&#039;gdb --args spring.exe myreplayfile.sdf&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Compiling with Visual Studio (not officially supported!)=&lt;br /&gt;
Currently Visual Studio lacks some c++ features it doesn&#039;t compile spring!&lt;br /&gt;
&lt;br /&gt;
==General Visual Studio Notes==&lt;br /&gt;
When developing using Visual Studio keep in mind:&lt;br /&gt;
*&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;It&#039;s experimental and not proved to compile or run!&amp;lt;/span&amp;gt;&lt;br /&gt;
*&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;Your VS build won&#039;t sync with GCC builds in multiplayer mode&amp;lt;/span&amp;gt;&lt;br /&gt;
*AIs built with Visual Studio will work with the mingw32 release builds thanks to the C AI Interface, however this interface may change when newer releases are made&lt;br /&gt;
*Running any non-LUA AI on VS built Spring will crash it&lt;br /&gt;
&lt;br /&gt;
===2012 (v11)===&lt;br /&gt;
&lt;br /&gt;
Install [http://www.microsoft.com/visualstudio/eng/downloads#d-express-windows-desktop Visual Studio 2012 Express for Windows Desktop], [http://www.microsoft.com/en-us/download/confirmation.aspx?id=35515 Visual C++ Compiler November 2012 CTP], [http://www.cmake.org/ cmake], [http://www.7-zip.org 7-zip] and [http://msysgit.github.io/ msysgit].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the Startmenu run &amp;quot;VS2012 x86 Native Tools Command Prompt&amp;quot; and type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
set PATH=%PATH%;%PROGRAMFILES%\git\bin;%PROGRAMFILES%\cmake 2.8\bin\&lt;br /&gt;
git clone --recursive git://github.com/spring/spring.git -b develop&lt;br /&gt;
cd spring&lt;br /&gt;
git clone git://github.com/spring/vclibs11.git vclibs&lt;br /&gt;
cmake -G &amp;quot;Visual Studio 11&amp;quot; .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now start visual studio &amp;amp; open Spring.sln. Select &amp;quot;engine-legacy&amp;quot; as default project, as AIs and ofter stuff are known to fail to compile on visual studio.&lt;br /&gt;
&lt;br /&gt;
In the Project Properties, make sure to [http://stackoverflow.com/questions/13238408/variadic-template-in-vs-2012-visual-c-november-2012-ctp select the Microsoft Visual C++ Compiler Nov 2012 CTP].&lt;br /&gt;
&lt;br /&gt;
Note: Visual Studio 2012 Express for Windows Desktop is for free, but requires a registration after 30 days (to get a free license).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Compiling]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_GLSL_Api&amp;diff=11324</id>
		<title>Lua GLSL Api</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_GLSL_Api&amp;diff=11324"/>
		<updated>2019-10-05T23:38:07Z</updated>

		<summary type="html">&lt;p&gt;Ivand: none drawing event -&amp;gt; NON-drawing events&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;These functions are ONLY available if the graphic board supports GLSL.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt; Please test in your scripts if one of them exists before you use them!&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateShader&#039;&#039;&#039;&lt;br /&gt;
  ({[ vertex   = &amp;quot;glsl code&amp;quot; ,]&lt;br /&gt;
    [ tcs      = &amp;quot;glsl code&amp;quot; ,]&lt;br /&gt;
    [ tes      = &amp;quot;glsl code&amp;quot; ,]&lt;br /&gt;
    [ geometry = &amp;quot;glsl code&amp;quot; ,]&lt;br /&gt;
    [ fragment = &amp;quot;glsl code&amp;quot; ,]&lt;br /&gt;
    [ uniform       = { uniformName = number value, ...} ,] &amp;lt;span class=note&amp;gt;(specify a Lua array as an argument to uniformName to initialize GLSL arrays)&amp;lt;/span&amp;gt;&lt;br /&gt;
    [ uniformInt    = { uniformName = number value, ...} ,] &amp;lt;span class=note&amp;gt;(specify a Lua array as an argument to uniformName to initialize GLSL arrays)&amp;lt;/span&amp;gt;&lt;br /&gt;
    [ uniformFloat  = { uniformName = number value, ...} ,] &amp;lt;span class=note&amp;gt;(specify a Lua array as an argument to uniformName to initialize GLSL arrays)&amp;lt;/span&amp;gt;&lt;br /&gt;
    [ uniformMatrix = { uniformName = number value, ...} ,]&lt;br /&gt;
    [ geoInputType = number inType,]&lt;br /&gt;
    [ geoOutputType = number outType,]&lt;br /&gt;
    [ geoOutputVerts = number maxVerts,]&lt;br /&gt;
    [ definitions = &amp;quot;string of shader #defines&amp;quot;, ]&lt;br /&gt;
  }) -&amp;gt; number shaderID&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;Vertex&amp;quot; or vertex-shader is your GLSL-Code as string, its written in a C-Dialect. This shader is busy deforming the geometry of a unit but it can not create new polygons. Use it for waves, wobbling surfaces etc.&lt;br /&gt;
 &lt;br /&gt;
* The &amp;quot;Geometry&amp;quot; or Geometry-shader can create new vertices and vertice-stripes from points. &lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;TCS&amp;quot; or Tesselation Control Shader controls how much tessellation a particular patch gets; it also defines the size of a patch, thus allowing it to augment data. It can also filter vertex data taken from the vertex shader. The main purpose of the TCS is to feed the tessellation levels to the Tessellation primitive generator stage, as well as to feed patch data (as its output values) to the Tessellation Evaluation Shader stage. TCS shader can be used with spring version &amp;gt;= 104.0.1-596 (maintenance), it&#039;s also available in develop branch of spring.&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;TES&amp;quot; or Tesselation Evaluation Shader takes the abstract patch generated by the tessellation primitive generation stage, as well as the actual vertex data for the entire patch, and generates a particular vertex from it. Each TES invocation generates a single vertex. It can also take per-patch data provided by the Tessellation Control Shader. TES shader can be used with spring version &amp;gt;= 104.0.1-596 (maintenance), it&#039;s also available in develop branch of spring.&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;Fragment&amp;quot; or Fragment-shader (sometimes called pixel-Shader) is post processing the allready rendered picture (for example drawing stars on the sky)- remember textures are not always 2 dimensional pictures. They can contain information about the depth, or the third value marks areas and the strength at which these are processed.&lt;br /&gt;
&lt;br /&gt;
* The Uniforms are the values, you send along with the shader-program. To use them in the shader-program declare them like this: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;uniform float frame;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From 101.0 onwards, the engine will automatically fill in an appropriately named uniform for team colour if it is declared;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;uniform vec4 teamColor;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteShader&#039;&#039;&#039;&lt;br /&gt;
  ( number shaderID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveShader&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;can be used in NON-drawing events (to update uniforms etc.)!&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number shaderID, function [, arg1 [, arg2, ..]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UseShader&#039;&#039;&#039;&lt;br /&gt;
  ( number shaderID ) -&amp;gt; boolean linked&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetShaderLog&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; string &amp;quot;infoLog&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SetShaderParameter&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;font color=&amp;quot;#ff0000&amp;quot;&amp;gt;Renamed to SetGeometryShaderParameter in spring version &amp;gt;= 104.0.1-596 (maintenance).&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;needed by geometry shader programs (check the opengl GL_ARB_geometry_shader4 extension for glProgramParameteri)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number shaderID, number param, number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SetTesselationShaderParameter&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;font color=&amp;quot;#0000ee&amp;quot;&amp;gt;Available for spring versions &amp;gt;= 104.0.1-596 (maintenance).&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;needed by tesselation shader programs (check the opengl GL_ARB_tessellation_shader extension for glProgramParameteri)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number param, number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetActiveUniforms&#039;&#039;&#039;&lt;br /&gt;
  ( number shaderID ) -&amp;gt; { &lt;br /&gt;
      [1] = { name = &amp;quot;name&amp;quot;, type = &amp;quot;type&amp;quot;, length = number length, size = number size },&lt;br /&gt;
      ...&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetUniformLocation&#039;&#039;&#039;&lt;br /&gt;
  ( number shaderID, name uniformName ) -&amp;gt; number locationID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Uniform&#039;&#039;&#039;&lt;br /&gt;
  ( number locationID, number f1 [,number f2 [,number f3 [,number f4]]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UniformInt&#039;&#039;&#039;&lt;br /&gt;
  ( number locationID, number int1 [,number int2 [,number int3 [,number int4]]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UniformArray&#039;&#039;&#039; {{new|95.0}}&lt;br /&gt;
  ( number locationID, number type, table uniforms ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;type can be one of {1 = int, 2 = float, 3 = float matrix}. In 104.0 the maximum length of the uniforms table increased from 32 entries to 1024.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UniformMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( number locationID, &lt;br /&gt;
    &amp;quot;shadow&amp;quot; |&lt;br /&gt;
    &amp;quot;camera&amp;quot; |&lt;br /&gt;
    &amp;quot;caminv&amp;quot; |&lt;br /&gt;
    &amp;quot;camprj&amp;quot; |&lt;br /&gt;
    number m1, number m2, number m3, number m4 |&lt;br /&gt;
    number m1, ... , number m9 |&lt;br /&gt;
    number m1, ... , number m16&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11517</id>
		<title>Lua OpenGL Api</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11517"/>
		<updated>2019-04-10T11:58:36Z</updated>

		<summary type="html">&lt;p&gt;Ivand: VBO--&amp;gt;VAO&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
= Spring =&lt;br /&gt;
&#039;&#039;&#039;gl.GetSun&#039;&#039;&#039;&lt;br /&gt;
  &amp;lt;font style=&amp;quot;font-size:90%&amp;quot;&amp;gt;()        -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;pos&amp;quot; ) -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;shadowDensity&amp;quot; [, &amp;quot;unit&amp;quot;] ) -&amp;gt; number shadowDensity&lt;br /&gt;
  ( &amp;quot;diffuse&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;ambient&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;specular&amp;quot;      [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetAtmosphere&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Sun|Spring.SetAtmosphere]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetWaterRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | string texName | number scalar | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetWaterParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMapRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetMapRenderingParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigScreen&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;used for Unit LODs&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number screenWidth, number screenDistance ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawMiniMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;argument new in 0.82+&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;boolean tansform = true&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SlaveMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( boolean mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( int px, int py, int sx, int sy ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetViewSizes&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number x, number y&lt;br /&gt;
&lt;br /&gt;
= Matrices &amp;amp; Viewport =&lt;br /&gt;
&#039;&#039;&#039;gl.Viewport&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;&#039;gl.Translate&#039;&#039;&#039;&lt;br /&gt;
  (number x, number y, number z) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scale&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rotate&#039;&#039;&#039;&lt;br /&gt;
  ( number angle, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Billboard&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Use this to draw 2d primitives in DrawWorld().&lt;br /&gt;
To render a 2D billboarded quad in the gameworld at world position x,y,z, you do the following (at a minimum; I am skipping blending / depthtesting) here:&lt;br /&gt;
  gl.PushMatrix()&lt;br /&gt;
  gl.Texture(read what you need here)&lt;br /&gt;
  gl.Translate(x,y,z)&lt;br /&gt;
  gl.Billboard()			&lt;br /&gt;
  gl.TexRect(x1,y1,x2,y2)&lt;br /&gt;
  gl.PopMatrix()&amp;lt;/span &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MatrixMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#MatrixMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadIdentity&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( 16 numbers or a [https://github.com/spring/spring/blob/develop/rts/Lua/LuaOpenGLUtils.cpp#L60 matrix name] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Ortho&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Frustum&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushPopMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ClipPlane&#039;&#039;&#039;&lt;br /&gt;
  ( int plane, &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: $plane can only be 1 or 2&amp;lt;/font&amp;gt;&lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number A, number B, number C, number D ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Clear =&lt;br /&gt;
&#039;&#039;&#039;gl.Clear&#039;&#039;&#039;&lt;br /&gt;
  ( GL.DEPTH_BUFFER_BIT [, number cleardepth] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.STENCIL_BUFFER_BIT [, int clearstencil] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.COLOR_BUFFER_BIT | GL.ACCUM_BUFFER_BIT [, number r, number g, number b, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SwapBuffers&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Available only in LuaMenu, meant for frame-limited LuaMenu&#039;s that want identical content in both buffers.&lt;br /&gt;
&lt;br /&gt;
= ResetState/Matrices =&lt;br /&gt;
&#039;&#039;&#039;gl.ResetState&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;DON&#039;T USE IT UNLESS YOU KNOW WHAT YOU ARE DOING! Each call-in has different default states, but this function resets all states to the states below no matter what!&amp;lt;/span&amp;gt;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  ShadeModel = GL.SMOOTH&lt;br /&gt;
  Scissor    = false&lt;br /&gt;
  Texture    = false&lt;br /&gt;
  Lighting    = false,&lt;br /&gt;
  ColorMask  = true, true, true, true&lt;br /&gt;
  DepthMask  = false&lt;br /&gt;
  DepthTest  = false  (GL.LEQUAL)&lt;br /&gt;
  Culling    = false  (GL.BACK)&lt;br /&gt;
  LogicOp    = false  (GL.INVERT)&lt;br /&gt;
  AlphaTest  = false  (GL.GREATER, 0.5f)&lt;br /&gt;
  Blending   = true (GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA)&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ResetMatrices&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  Resets GL.TEXTURE matrix stack&lt;br /&gt;
  Resets GL.MODELVIEW matrix stack&lt;br /&gt;
  Resets GL.PROJECTION matrix stack&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Draw Basics =&lt;br /&gt;
&#039;&#039;&#039;gl.BeginEnd&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Drawing_Primitives|GLType]], function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Color&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b[, number a] } |&lt;br /&gt;
      number r, number g, number b[, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Vertex&#039;&#039;&#039;&lt;br /&gt;
  ( { number x, number y [, number z [, number w ]] } |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Normal&#039;&#039;&#039;&lt;br /&gt;
  (  number x, number y, number z |&lt;br /&gt;
   { number x, number y, number z } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rect&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexRect&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;texture rect&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2,&lt;br /&gt;
  [ boolean flip_s, boolean flip_t | number s1, number t1, number s2, number t2 ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Shape&#039;&#039;&#039;&lt;br /&gt;
 ( number [[Lua_ConstGL#Drawing_Primitives|GLtype]],&lt;br /&gt;
   elements = {&lt;br /&gt;
     [1] = { v | vertex   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;required&amp;lt;/font&amp;gt;&lt;br /&gt;
             n | normal   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             t | texcoord = { number x, number y },                     &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             c | color    = { number r, number g, number b, number a }  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
     },&lt;br /&gt;
     etc ...&lt;br /&gt;
   }&lt;br /&gt;
 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SecondaryColor&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b } |&lt;br /&gt;
      number r, number g, number b ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FogCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Display Lists =&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Display Lists save given vertex attributes in a static buffer, so the GPU can directly read them (without the CPU). Display Lists are a lot faster (10-60x) than standard drawing with glShape/glBeginEnd, so try to use them when ever you can. If you want to learn more about them, g00gle is your friend ;)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateList&#039;&#039;&#039;&lt;br /&gt;
  ( function [,arg1 [,arg2...]] ) -&amp;gt; number listID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CallList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Vertex Array Objects =&lt;br /&gt;
&amp;lt;span class=note&amp;gt; &amp;lt;font color=darkblue&amp;gt; Only available in &amp;quot;develop&amp;quot; branch of spring (the future 105.0+). This is conceptually similar and serve as modern OpenGL replacement to deprecated Display Lists. &amp;lt;/font&amp;gt; &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number numElements, number numIndices, [boolean persistentBuffer = false] ) -&amp;gt; number bufferID&lt;br /&gt;
&lt;br /&gt;
See what elements and indices are here: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-9-vbo-indexing/&amp;lt;br&amp;gt;&lt;br /&gt;
numElements and numIndices define the size of for elements and indices respectively. if indices are not going to be used, then set numIndices to 0&amp;lt;br&amp;gt;&lt;br /&gt;
Persistent buffers (persistentBuffer = true) are more efficient for dynamically/often updated geometry.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UpdateVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number bufferID, number elementPos, number indexPos, table tbl | function func ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
{elementPos, indexPos} define starting element in {element, index} VBO corresponding to 1st element of the supplied vertex data&amp;lt;br&amp;gt;&lt;br /&gt;
4 elements table example:&amp;lt;br&amp;gt;&lt;br /&gt;
  local verts = {&lt;br /&gt;
    p  = {0,0,0,1,  4,0,0,1,  4,4,0,1,  0,4,0,1},&lt;br /&gt;
    n  = {0,1,0  ,  0,1,0  ,  0,1,0  ,  0,1,0  },&lt;br /&gt;
    uv = {0,0,0,0,  1,0,0,0,  1,1,0,0,  0,1,0,0},&lt;br /&gt;
    c0 = {1,0,0,1,  0,1,0,1,  0,0,1,1,  1,1,1,0},&lt;br /&gt;
    i = {0, 1, 2, 2, 1, 3},            &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional, use in case of indexed VBO&amp;lt;/font&amp;gt;&lt;br /&gt;
    c1 = {...} }&lt;br /&gt;
&amp;lt;br&amp;gt;Alternatively Lua func can use gl.Vertex/gl.Color/gl.Normal/gl.TexCoord to define vertices, similarly how it used to be done in gl.BeginEnd.Note there is no function yet to define indices.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number bufferID, number primType, [number firstIndex = 0, count = numElements]  ) -&amp;gt; boolean success&lt;br /&gt;
primType can be GL.POINTS, GL.LINE_STRIP, GL.LINE_LOOP, GL.LINES, GL.LINE_STRIP_ADJACENCY, GL.LINES_ADJACENCY, GL.TRIANGLE_STRIP, GL.TRIANGLE_FAN, GL.TRIANGLES, GL.TRIANGLE_STRIP_ADJACENCY, GL.TRIANGLES_ADJACENCY and GL.PATCHES&amp;lt;br&amp;gt;&lt;br /&gt;
firstIndex specifies the starting index in the enabled arrays.&amp;lt;br&amp;gt;&lt;br /&gt;
count specifies the number of indices to be rendered.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteVertexArray&#039;&#039;&#039;&lt;br /&gt;
 ( number bufferID ) -&amp;gt; boolean success&lt;br /&gt;
Releases previously allocated VAO&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Text =&lt;br /&gt;
&#039;&#039;&#039;gl.Text&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;, number x, number y, number size [, string &amp;lt;span class=note&amp;gt;&amp;quot;options&amp;quot;&amp;lt;/span&amp;gt;] )&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
  options are:&lt;br /&gt;
    horizontal alignment:&lt;br /&gt;
       &#039;c&#039; = center&lt;br /&gt;
       &#039;r&#039; = right&lt;br /&gt;
    vertical alignment:&lt;br /&gt;
       &#039;a&#039; = ascender&lt;br /&gt;
       &#039;t&#039; = top&lt;br /&gt;
       &#039;v&#039; = vertical center&lt;br /&gt;
       &#039;x&#039; = baseline&lt;br /&gt;
       &#039;b&#039; = bottom&lt;br /&gt;
       &#039;d&#039; = descender&lt;br /&gt;
    decorations:&lt;br /&gt;
       &#039;o&#039; = black outline&lt;br /&gt;
       &#039;O&#039; = white outline&lt;br /&gt;
       &#039;s&#039; = shadow&lt;br /&gt;
    other:&lt;br /&gt;
       &#039;n&#039; = don&#039;t round vertex coords to nearest integer (font may get blurry)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
http://home.arcor.de/jkei/fontlines.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextWidth&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;) -&amp;gt; number width  &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextHeight&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;text&amp;quot; ) -&amp;gt; nil | number height, number descender, number numlines &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;further descriptions here: [[GetTextHeight]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&amp;lt;b&amp;gt;If you have multiple gl.Text calls, then you can bunch them between a gl.BeginText and gl.EndText to speedup the rendering.&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;gl.BeginText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.EndText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Unit/Feature Draw Functions =&lt;br /&gt;
&#039;&#039;&#039;gl.Unit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws an unit; on default it uses LOD, with lod&amp;lt;0 it is turned off, else it defines a specific level)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitRaw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(doesn&#039;t apply worldspace-&amp;gt;unit transformation! only works if &amp;lt;i&amp;gt;rawdraw&amp;lt;/i&amp;gt; is true )&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShape&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID, number teamID, bool rawState, bool toScreen, bool opaque ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|101.0}} The three extra boolean arguments make it so that calling only these functions is enough to get correctly rendered models; pass in &#039;false&#039; for the THIRD argument to get the fixed behavior, omit it or pass in &#039;true&#039; [default] to render with your own custom state instead. The FOURTH argument should be &#039;true&#039; if in DrawScreen and &#039;false&#039; (default) if in DrawWorld; any transforms for these two functions *MUST* include a gl.LoadIdentity call when argument #3 is false (whether they are used in DrawWorld or in DrawScreen) the FIFTH argument determines whether the model is drawn opaque (&#039;true&#039; [default]) or with translucency (&#039;false&#039;); only has an effect when argument #3 is false.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; unit space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(unit space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPiece&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the unit piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.UnitPieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Feature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureRaw&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShape&#039;&#039;&#039;&lt;br /&gt;
  ( number featureDefID, number teamID, bool custom, bool drawScreen, bool opaque  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; feature space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(feature space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePiece&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the Feature piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.FeaturePieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawListAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number listID, [ boolean midPos,&lt;br /&gt;
      number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
      number degrees, number rotX, number rotX, number rotZ ] ) -&amp;gt; nil &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawFuncAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean midPos, function [, arg1,... ]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= States (Blending,AlphaTest...) =&lt;br /&gt;
&#039;&#039;&#039;gl.Blending&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
  ( string &amp;lt;span class=note&amp;gt;mode&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99&amp;quot; | mode maybe:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.ONE, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha_add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;reset&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;color&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_COLOR, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;modulate&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.DST_COLOR, GL.ZERO&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;disable&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquation&#039;&#039;&#039;&lt;br /&gt;
  ( number mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquationSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number modeRGB, number modeAlpha ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcRGB]], number [[Lua_ConstGL#BlendingFactorDest|dstRGB]],  number [[Lua_ConstGL#BlendingFactorSrc|srcAlpha]], number [[Lua_ConstGL#BlendingFactorDest|dstAlpha]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.AlphaTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]], number threshold ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Culling&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#Culling|face]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthClamp&#039;&#039;&#039;  &amp;lt;span class=warning&amp;gt;not always available, needs GL.NV_depth_clamp!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ColorMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( boolean r, boolean g, boolean b, boolean a ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LogicOp&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#LogicOp|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Fog&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Smoothing&#039;&#039;&#039; {{removed|104.0}}&lt;br /&gt;
 ( (boolean enable | number POINT), &lt;br /&gt;
   (boolean enable | number LINE),&lt;br /&gt;
   (boolean enable | number POLYGON) ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
 ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scissor&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( int x, int y, int w, int h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LineStipple&#039;&#039;&#039;&lt;br /&gt;
  ( string any ) -&amp;gt; nil &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(use springs default line stipple)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
  ( int factor, number pattern ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number [[Lua_ConstGL#PolygonMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonOffset&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number factor, number units ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushAttrib&#039;&#039;&#039;&lt;br /&gt;
  ( [ number [[Lua_ConstGL#glPushAttrib.28.29_bits|attrib]] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopAttrib&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Stencil =&lt;br /&gt;
&#039;&#039;&#039;gl.StencilTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMask&#039;&#039;&#039;&lt;br /&gt;
  ( number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOp&#039;&#039;&#039;&lt;br /&gt;
  ( number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMaskSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOpSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= LineWidth &amp;amp; PointSize =&lt;br /&gt;
&#039;&#039;&#039;gl.LineWidth&#039;&#039;&#039;&lt;br /&gt;
  ( number width ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSize&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(values != 1 can break severely on ATI cards, see http://springrts.com/mantis/view.php?id=2390)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number size ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSprite&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable, [boolean coord_replace, boolean coord_origin_upper] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointParameter&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number v1, number v2, number v3, &lt;br /&gt;
    [ number sizeMin, number sizeMax, number sizeFade ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Textures =&lt;br /&gt;
&#039;&#039;&#039;gl.Texture&#039;&#039;&#039;&lt;br /&gt;
  ( [ number texNum, ] boolean enable | string &amp;lt;span class=note&amp;gt;name&amp;lt;/span&amp;gt; ) -&amp;gt; nil | boolean loaded&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;This is the only call-out that is needed to load and draw any texture in a Lua script. All you have to do is pass it a valid path to a valid png and it will use that image for drawing any subsequent textured rectangles. This is shown in the last line of the following list of valid strings for the name parameter.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99; text-align:left&amp;quot; |`name` may be:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | #12&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 12 buildpic&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %34:1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 34 s3o tex2 (:0-&amp;gt;tex1,:1-&amp;gt;tex2)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %-102:0&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = featureDef 102 s3o tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | !56&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = lua generated texture 56 (= return value of gl.CreateTexture)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units2&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shadow&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = shadowmap&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = specular cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(removed in the latest develop)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $reflection &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = reflection cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(can be mipmaped starting from 104.0.1-714-ga29177f. Set CubeTexGenerateMipMaps=1 in settings)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shading&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = ground shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $grass&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = grass shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $heightmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = heightmap (needs HeightMapTexture=1 set in spring config)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $minimap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = minimap texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = same as &amp;quot;$reflection&amp;quot; {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $sky_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = defined for SSMF maps that have a skyReflectModTex {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = auto generated normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF specular texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_distr&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat distribution texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat normals texture {{new|101.0}}, used as &amp;quot;$ssmf_splat_normals&amp;quot; or &amp;quot;$ssmf_splat_normals:X&amp;quot;, &#039;X&#039; can be a value between 0 and 3, defaults to 0 if &amp;quot;:X&amp;quot; is omitted&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_emission&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF emission texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_parallax&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF parallax texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = currently active info texture (los, airlos, radar, jammer)&amp;lt;br/&amp;gt; Note that textures contain no data until user switches to their respective modes and non-active textures are not updated in the background, so will go stale&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_losmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = los texture (L-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_mtlmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = metal map texture (F4-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_hgtmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = height map texture (F1-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_blkmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = blocking map texture (F2-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the map in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the map in view. {{new|95}} &amp;lt;br/&amp;gt;To translate this to world position coordinates, use:&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;No clip control / clipspace for depth is [-1,1]&#039;&#039;&#039;&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(vec3(gl_TexCoord[0].st, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x) * 2.0 - 1.0, 1.0);&lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;Default if clip control is supported / clipspace for depth is [0,1].&#039;&#039;&#039;&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(gl_TexCoord[0].st * 2.0 - 1.0, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x, 1.0);&lt;br /&gt;
&lt;br /&gt;
  worldpos.xyz = worldpos.xyz / worldpos.w; &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the models in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the models in view.  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | ${opt}:/LuaUI/images/image.png &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = load a texture from the VFS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
   possible ${opt}&#039;s are:&lt;br /&gt;
      &#039;n&#039; = nearest&lt;br /&gt;
      &#039;l&#039; = linear&lt;br /&gt;
      &#039;a&#039; = aniso&lt;br /&gt;
      &#039;i&#039; = invert&lt;br /&gt;
      &#039;g&#039; = greyed&lt;br /&gt;
      &#039;c&#039; = clamped&lt;br /&gt;
      &#039;b&#039; = border&lt;br /&gt;
      &#039;t%r,%g,%b&#039; = tint&lt;br /&gt;
      &#039;r%width,%height&#039; = resize&lt;br /&gt;
   The above ${opt}&#039;s are NOT available for .DDS textures! .dds will load faster than other image formats.&lt;br /&gt;
&lt;br /&gt;
    example: &amp;quot;:iac:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example: &amp;quot;:cr16,16:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example2: &amp;quot;:t1.0,0.5,0:/LuaUI/images/image.png&amp;quot;  (orange tint)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
  [ { &lt;br /&gt;
    [target     = number,] &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(like GL.TEXTURE_1D,GL.TEXTURE_2D,...)&amp;lt;/font&amp;gt; &amp;lt;font color=darkblue&amp;gt; (Added support for GL_TEXTURE_2D_MULTISAMPLE in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [format     = number,]&lt;br /&gt;
    [min_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [mag_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [wrap_s     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_t     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_r     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [aniso      = number,]&lt;br /&gt;
    [border     = boolean,]&lt;br /&gt;
    [fbo        = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [fboDepth   = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [samples    = number,] &amp;lt;font color=darkblue&amp;gt; specify any number here and target = GL_TEXTURE_2D_MULTISAMPLE to create multisample texture (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  } ]&lt;br /&gt;
  ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTexture&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTextureFBO&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TextureInfo&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; nil | {&lt;br /&gt;
      xsize = number,&lt;br /&gt;
      ysize = number,&lt;br /&gt;
      alpha = boolean, //not used yet&lt;br /&gt;
      type  = number,  //not used yet&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
   the format of the texture string is the same as in gl.Texture()&lt;br /&gt;
&amp;lt;/font&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number x | &lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum,&lt;br /&gt;
    number x |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexGen&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexGen&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil       &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CopyToTexture&#039;&#039;&#039;&lt;br /&gt;
  (string texture, int xoff, int yoff, int x, int y, int w, int h &lt;br /&gt;
  [,number target,number level])-&amp;gt;nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderToTexture&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string fbotexture, lua_func ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GenerateMipmap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs glGenerateMipmapEXT!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
The following are primarily intended to be used in conjunction with&lt;br /&gt;
     gl.{Unit,Feature}(objID, ..., raw=true)&lt;br /&gt;
     gl.{Unit,Feature}Shape(defID, ..., raw=true)&lt;br /&gt;
and apply a model&#039;s default textures; easier than gl.Texture(&amp;quot;$%...&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
= PixelReadback =&lt;br /&gt;
&#039;&#039;&#039;gl.SaveImage&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h,&lt;br /&gt;
    string filename [, table {alpha=boolean, yflip=boolean, grayscale16bit=boolean} ] ) -&amp;gt; nil | boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;grayscale16bit is {{new|99.0}} and allows to save single color 16bit PNG&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ReadPixels&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h [, number format = GL.RGBA ] )&lt;br /&gt;
    -&amp;gt; nil &lt;br /&gt;
    | number r,[g,[b,[a]]] &lt;br /&gt;
    | table { { {1 = number r, 2 = number g, 3 = number b, 4 = number a}, ... }, ... }&lt;br /&gt;
&lt;br /&gt;
= Lights =&lt;br /&gt;
&#039;&#039;&#039;gl.Lighting&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ShadeModel&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#ShadeModel|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Light&#039;&#039;&#039;&lt;br /&gt;
  ( int light, &lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param1, number param2, number param3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Material&#039;&#039;&#039;&lt;br /&gt;
  ({&lt;br /&gt;
    ambient   = {number r, number g, number b[, number a]},&lt;br /&gt;
    diffuse   = {number r, number g, number b[, number a]},&lt;br /&gt;
    ambidiff  = {number r, number g, number b[, number a]},&lt;br /&gt;
    emission  = {number r, number g, number b[, number a]},&lt;br /&gt;
    specular  = {number r, number g, number b[, number a]},&lt;br /&gt;
    shininess = number specularExponent&lt;br /&gt;
  }) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Hardware relevant =&lt;br /&gt;
&#039;&#039;&#039;gl.HasExtension&#039;&#039;&#039;&lt;br /&gt;
  ( string extname ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetNumber&#039;&#039;&#039;&lt;br /&gt;
  ( number ext, int count ) -&amp;gt; number [, number, number, ... #count ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetString&#039;&#039;&#039;&lt;br /&gt;
  ( number ext ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= DrawGroundPrimitives =&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundCircle&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z, number radius, number divs [, number slope ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: number divs is the number of sides the circle will have. the higher the smoother the circle (and more GPU intensive) &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundQuad&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: x1,z1,x2 &amp;amp; z2 are rounded, so don&#039;t use it for very small or moving objects. x and z are correspond to the coordinates displayed by the tooltip &amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number z1, number x2, number z2,&lt;br /&gt;
    [ boolean useNorm, &amp;lt;span class=warning&amp;gt;(does nothing!)&amp;lt;/span&amp;gt;&lt;br /&gt;
      [ number tu1, number tv1, number tu2, number tv2 |&lt;br /&gt;
        boolean useTextureCoord ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Queries =&lt;br /&gt;
&#039;&#039;&#039;gl.CreateQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; nil | userdata query&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.RunQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query, function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.GetQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil | number renderedFragments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Extended =&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexNames&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; { [1] = string texture, etc ... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexCoords&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;gets the texcoord of a 3do texture in the 3do texture atlas&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string 3doTextureName ) -&amp;gt; number xstart, number ystart, number xend, number yend&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeState&#039;&#039;&#039;&lt;br /&gt;
  ( number state [, boolean disable_state ], function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Calls glEnable(state) or glDisable(state) (if disable_state==true) and&amp;lt;br&amp;gt;then calls the lua_function and afterwards reverts the state.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetShadowMapParams&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; number xmid, number ymid, number p17, number p18&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMatrixData&#039;&#039;&#039;&lt;br /&gt;
  ( GL.PROJECTION [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( GL.MODELVIEW  [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i] &lt;br /&gt;
  ( GL.TEXTURE    [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( &amp;quot;shadow&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camera&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;caminv&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camprj&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;billboard&amp;quot; )             -&amp;gt; nil | number, etc.. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Flush&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Finish&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Shaders (GLSL) =&lt;br /&gt;
  [[Lua_GLSL_Api]]&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11516</id>
		<title>Lua OpenGL Api</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11516"/>
		<updated>2019-04-09T23:48:51Z</updated>

		<summary type="html">&lt;p&gt;Ivand: /* Vertex Buffer Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
= Spring =&lt;br /&gt;
&#039;&#039;&#039;gl.GetSun&#039;&#039;&#039;&lt;br /&gt;
  &amp;lt;font style=&amp;quot;font-size:90%&amp;quot;&amp;gt;()        -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;pos&amp;quot; ) -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;shadowDensity&amp;quot; [, &amp;quot;unit&amp;quot;] ) -&amp;gt; number shadowDensity&lt;br /&gt;
  ( &amp;quot;diffuse&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;ambient&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;specular&amp;quot;      [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetAtmosphere&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Sun|Spring.SetAtmosphere]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetWaterRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | string texName | number scalar | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetWaterParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMapRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetMapRenderingParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigScreen&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;used for Unit LODs&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number screenWidth, number screenDistance ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawMiniMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;argument new in 0.82+&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;boolean tansform = true&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SlaveMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( boolean mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( int px, int py, int sx, int sy ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetViewSizes&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number x, number y&lt;br /&gt;
&lt;br /&gt;
= Matrices &amp;amp; Viewport =&lt;br /&gt;
&#039;&#039;&#039;gl.Viewport&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;&#039;gl.Translate&#039;&#039;&#039;&lt;br /&gt;
  (number x, number y, number z) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scale&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rotate&#039;&#039;&#039;&lt;br /&gt;
  ( number angle, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Billboard&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Use this to draw 2d primitives in DrawWorld().&lt;br /&gt;
To render a 2D billboarded quad in the gameworld at world position x,y,z, you do the following (at a minimum; I am skipping blending / depthtesting) here:&lt;br /&gt;
  gl.PushMatrix()&lt;br /&gt;
  gl.Texture(read what you need here)&lt;br /&gt;
  gl.Translate(x,y,z)&lt;br /&gt;
  gl.Billboard()			&lt;br /&gt;
  gl.TexRect(x1,y1,x2,y2)&lt;br /&gt;
  gl.PopMatrix()&amp;lt;/span &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MatrixMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#MatrixMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadIdentity&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( 16 numbers or a [https://github.com/spring/spring/blob/develop/rts/Lua/LuaOpenGLUtils.cpp#L60 matrix name] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Ortho&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Frustum&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushPopMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ClipPlane&#039;&#039;&#039;&lt;br /&gt;
  ( int plane, &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: $plane can only be 1 or 2&amp;lt;/font&amp;gt;&lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number A, number B, number C, number D ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Clear =&lt;br /&gt;
&#039;&#039;&#039;gl.Clear&#039;&#039;&#039;&lt;br /&gt;
  ( GL.DEPTH_BUFFER_BIT [, number cleardepth] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.STENCIL_BUFFER_BIT [, int clearstencil] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.COLOR_BUFFER_BIT | GL.ACCUM_BUFFER_BIT [, number r, number g, number b, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SwapBuffers&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Available only in LuaMenu, meant for frame-limited LuaMenu&#039;s that want identical content in both buffers.&lt;br /&gt;
&lt;br /&gt;
= ResetState/Matrices =&lt;br /&gt;
&#039;&#039;&#039;gl.ResetState&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;DON&#039;T USE IT UNLESS YOU KNOW WHAT YOU ARE DOING! Each call-in has different default states, but this function resets all states to the states below no matter what!&amp;lt;/span&amp;gt;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  ShadeModel = GL.SMOOTH&lt;br /&gt;
  Scissor    = false&lt;br /&gt;
  Texture    = false&lt;br /&gt;
  Lighting    = false,&lt;br /&gt;
  ColorMask  = true, true, true, true&lt;br /&gt;
  DepthMask  = false&lt;br /&gt;
  DepthTest  = false  (GL.LEQUAL)&lt;br /&gt;
  Culling    = false  (GL.BACK)&lt;br /&gt;
  LogicOp    = false  (GL.INVERT)&lt;br /&gt;
  AlphaTest  = false  (GL.GREATER, 0.5f)&lt;br /&gt;
  Blending   = true (GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA)&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ResetMatrices&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  Resets GL.TEXTURE matrix stack&lt;br /&gt;
  Resets GL.MODELVIEW matrix stack&lt;br /&gt;
  Resets GL.PROJECTION matrix stack&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Draw Basics =&lt;br /&gt;
&#039;&#039;&#039;gl.BeginEnd&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Drawing_Primitives|GLType]], function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Color&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b[, number a] } |&lt;br /&gt;
      number r, number g, number b[, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Vertex&#039;&#039;&#039;&lt;br /&gt;
  ( { number x, number y [, number z [, number w ]] } |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Normal&#039;&#039;&#039;&lt;br /&gt;
  (  number x, number y, number z |&lt;br /&gt;
   { number x, number y, number z } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rect&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexRect&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;texture rect&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2,&lt;br /&gt;
  [ boolean flip_s, boolean flip_t | number s1, number t1, number s2, number t2 ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Shape&#039;&#039;&#039;&lt;br /&gt;
 ( number [[Lua_ConstGL#Drawing_Primitives|GLtype]],&lt;br /&gt;
   elements = {&lt;br /&gt;
     [1] = { v | vertex   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;required&amp;lt;/font&amp;gt;&lt;br /&gt;
             n | normal   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             t | texcoord = { number x, number y },                     &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             c | color    = { number r, number g, number b, number a }  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
     },&lt;br /&gt;
     etc ...&lt;br /&gt;
   }&lt;br /&gt;
 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SecondaryColor&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b } |&lt;br /&gt;
      number r, number g, number b ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FogCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Display Lists =&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Display Lists save given vertex attributes in a static buffer, so the GPU can directly read them (without the CPU). Display Lists are a lot faster (10-60x) than standard drawing with glShape/glBeginEnd, so try to use them when ever you can. If you want to learn more about them, g00gle is your friend ;)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateList&#039;&#039;&#039;&lt;br /&gt;
  ( function [,arg1 [,arg2...]] ) -&amp;gt; number listID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CallList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Vertex Buffer Objects =&lt;br /&gt;
&amp;lt;span class=note&amp;gt; &amp;lt;font color=darkblue&amp;gt; Only available in &amp;quot;develop&amp;quot; branch of spring (the future 105.0+). This is conceptually similar and serve as modern OpenGL replacement to deprecated Display Lists. &amp;lt;/font&amp;gt; &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number numElements, number numIndices, [boolean persistentBuffer = false] ) -&amp;gt; number bufferID&lt;br /&gt;
&lt;br /&gt;
See what elements and indices are here: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-9-vbo-indexing/&amp;lt;br&amp;gt;&lt;br /&gt;
numElements and numIndices define the size of for elements and indices respectively. if indices are not going to be used, then set numIndices to 0&amp;lt;br&amp;gt;&lt;br /&gt;
Persistent buffers (persistentBuffer = true) are more efficient for dynamically/often updated geometry.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UpdateVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number bufferID, number elementPos, number indexPos, table tbl | function func ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
{elementPos, indexPos} define starting element in {element, index} VBO corresponding to 1st element of the supplied vertex data&amp;lt;br&amp;gt;&lt;br /&gt;
4 elements table example:&amp;lt;br&amp;gt;&lt;br /&gt;
  local verts = {&lt;br /&gt;
    p  = {0,0,0,1,  4,0,0,1,  4,4,0,1,  0,4,0,1},&lt;br /&gt;
    n  = {0,1,0  ,  0,1,0  ,  0,1,0  ,  0,1,0  },&lt;br /&gt;
    uv = {0,0,0,0,  1,0,0,0,  1,1,0,0,  0,1,0,0},&lt;br /&gt;
    c0 = {1,0,0,1,  0,1,0,1,  0,0,1,1,  1,1,1,0},&lt;br /&gt;
    i = {0, 1, 2, 2, 1, 3},            &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional, use in case of indexed VBO&amp;lt;/font&amp;gt;&lt;br /&gt;
    c1 = {...} }&lt;br /&gt;
&amp;lt;br&amp;gt;Alternatively Lua func can use gl.Vertex/gl.Color/gl.Normal/gl.TexCoord to define vertices, similarly how it used to be done in gl.BeginEnd.Note there is no function yet to define indices.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number bufferID, number primType, [number firstIndex = 0, count = numElements]  ) -&amp;gt; boolean success&lt;br /&gt;
primType can be GL.POINTS, GL.LINE_STRIP, GL.LINE_LOOP, GL.LINES, GL.LINE_STRIP_ADJACENCY, GL.LINES_ADJACENCY, GL.TRIANGLE_STRIP, GL.TRIANGLE_FAN, GL.TRIANGLES, GL.TRIANGLE_STRIP_ADJACENCY, GL.TRIANGLES_ADJACENCY and GL.PATCHES&amp;lt;br&amp;gt;&lt;br /&gt;
firstIndex specifies the starting index in the enabled arrays.&amp;lt;br&amp;gt;&lt;br /&gt;
count specifies the number of indices to be rendered.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteVertexArray&#039;&#039;&#039;&lt;br /&gt;
 ( number bufferID ) -&amp;gt; boolean success&lt;br /&gt;
Releases previously allocated VBO&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Text =&lt;br /&gt;
&#039;&#039;&#039;gl.Text&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;, number x, number y, number size [, string &amp;lt;span class=note&amp;gt;&amp;quot;options&amp;quot;&amp;lt;/span&amp;gt;] )&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
  options are:&lt;br /&gt;
    horizontal alignment:&lt;br /&gt;
       &#039;c&#039; = center&lt;br /&gt;
       &#039;r&#039; = right&lt;br /&gt;
    vertical alignment:&lt;br /&gt;
       &#039;a&#039; = ascender&lt;br /&gt;
       &#039;t&#039; = top&lt;br /&gt;
       &#039;v&#039; = vertical center&lt;br /&gt;
       &#039;x&#039; = baseline&lt;br /&gt;
       &#039;b&#039; = bottom&lt;br /&gt;
       &#039;d&#039; = descender&lt;br /&gt;
    decorations:&lt;br /&gt;
       &#039;o&#039; = black outline&lt;br /&gt;
       &#039;O&#039; = white outline&lt;br /&gt;
       &#039;s&#039; = shadow&lt;br /&gt;
    other:&lt;br /&gt;
       &#039;n&#039; = don&#039;t round vertex coords to nearest integer (font may get blurry)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
http://home.arcor.de/jkei/fontlines.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextWidth&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;) -&amp;gt; number width  &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextHeight&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;text&amp;quot; ) -&amp;gt; nil | number height, number descender, number numlines &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;further descriptions here: [[GetTextHeight]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&amp;lt;b&amp;gt;If you have multiple gl.Text calls, then you can bunch them between a gl.BeginText and gl.EndText to speedup the rendering.&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;gl.BeginText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.EndText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Unit/Feature Draw Functions =&lt;br /&gt;
&#039;&#039;&#039;gl.Unit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws an unit; on default it uses LOD, with lod&amp;lt;0 it is turned off, else it defines a specific level)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitRaw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(doesn&#039;t apply worldspace-&amp;gt;unit transformation! only works if &amp;lt;i&amp;gt;rawdraw&amp;lt;/i&amp;gt; is true )&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShape&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID, number teamID, bool rawState, bool toScreen, bool opaque ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|101.0}} The three extra boolean arguments make it so that calling only these functions is enough to get correctly rendered models; pass in &#039;false&#039; for the THIRD argument to get the fixed behavior, omit it or pass in &#039;true&#039; [default] to render with your own custom state instead. The FOURTH argument should be &#039;true&#039; if in DrawScreen and &#039;false&#039; (default) if in DrawWorld; any transforms for these two functions *MUST* include a gl.LoadIdentity call when argument #3 is false (whether they are used in DrawWorld or in DrawScreen) the FIFTH argument determines whether the model is drawn opaque (&#039;true&#039; [default]) or with translucency (&#039;false&#039;); only has an effect when argument #3 is false.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; unit space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(unit space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPiece&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the unit piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.UnitPieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Feature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureRaw&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShape&#039;&#039;&#039;&lt;br /&gt;
  ( number featureDefID, number teamID, bool custom, bool drawScreen, bool opaque  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; feature space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(feature space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePiece&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the Feature piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.FeaturePieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawListAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number listID, [ boolean midPos,&lt;br /&gt;
      number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
      number degrees, number rotX, number rotX, number rotZ ] ) -&amp;gt; nil &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawFuncAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean midPos, function [, arg1,... ]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= States (Blending,AlphaTest...) =&lt;br /&gt;
&#039;&#039;&#039;gl.Blending&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
  ( string &amp;lt;span class=note&amp;gt;mode&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99&amp;quot; | mode maybe:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.ONE, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha_add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;reset&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;color&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_COLOR, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;modulate&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.DST_COLOR, GL.ZERO&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;disable&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquation&#039;&#039;&#039;&lt;br /&gt;
  ( number mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquationSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number modeRGB, number modeAlpha ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcRGB]], number [[Lua_ConstGL#BlendingFactorDest|dstRGB]],  number [[Lua_ConstGL#BlendingFactorSrc|srcAlpha]], number [[Lua_ConstGL#BlendingFactorDest|dstAlpha]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.AlphaTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]], number threshold ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Culling&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#Culling|face]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthClamp&#039;&#039;&#039;  &amp;lt;span class=warning&amp;gt;not always available, needs GL.NV_depth_clamp!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ColorMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( boolean r, boolean g, boolean b, boolean a ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LogicOp&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#LogicOp|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Fog&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Smoothing&#039;&#039;&#039; {{removed|104.0}}&lt;br /&gt;
 ( (boolean enable | number POINT), &lt;br /&gt;
   (boolean enable | number LINE),&lt;br /&gt;
   (boolean enable | number POLYGON) ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
 ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scissor&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( int x, int y, int w, int h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LineStipple&#039;&#039;&#039;&lt;br /&gt;
  ( string any ) -&amp;gt; nil &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(use springs default line stipple)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
  ( int factor, number pattern ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number [[Lua_ConstGL#PolygonMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonOffset&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number factor, number units ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushAttrib&#039;&#039;&#039;&lt;br /&gt;
  ( [ number [[Lua_ConstGL#glPushAttrib.28.29_bits|attrib]] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopAttrib&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Stencil =&lt;br /&gt;
&#039;&#039;&#039;gl.StencilTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMask&#039;&#039;&#039;&lt;br /&gt;
  ( number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOp&#039;&#039;&#039;&lt;br /&gt;
  ( number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMaskSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOpSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= LineWidth &amp;amp; PointSize =&lt;br /&gt;
&#039;&#039;&#039;gl.LineWidth&#039;&#039;&#039;&lt;br /&gt;
  ( number width ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSize&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(values != 1 can break severely on ATI cards, see http://springrts.com/mantis/view.php?id=2390)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number size ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSprite&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable, [boolean coord_replace, boolean coord_origin_upper] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointParameter&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number v1, number v2, number v3, &lt;br /&gt;
    [ number sizeMin, number sizeMax, number sizeFade ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Textures =&lt;br /&gt;
&#039;&#039;&#039;gl.Texture&#039;&#039;&#039;&lt;br /&gt;
  ( [ number texNum, ] boolean enable | string &amp;lt;span class=note&amp;gt;name&amp;lt;/span&amp;gt; ) -&amp;gt; nil | boolean loaded&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;This is the only call-out that is needed to load and draw any texture in a Lua script. All you have to do is pass it a valid path to a valid png and it will use that image for drawing any subsequent textured rectangles. This is shown in the last line of the following list of valid strings for the name parameter.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99; text-align:left&amp;quot; |`name` may be:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | #12&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 12 buildpic&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %34:1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 34 s3o tex2 (:0-&amp;gt;tex1,:1-&amp;gt;tex2)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %-102:0&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = featureDef 102 s3o tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | !56&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = lua generated texture 56 (= return value of gl.CreateTexture)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units2&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shadow&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = shadowmap&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = specular cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(removed in the latest develop)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $reflection &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = reflection cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(can be mipmaped starting from 104.0.1-714-ga29177f. Set CubeTexGenerateMipMaps=1 in settings)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shading&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = ground shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $grass&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = grass shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $heightmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = heightmap (needs HeightMapTexture=1 set in spring config)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $minimap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = minimap texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = same as &amp;quot;$reflection&amp;quot; {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $sky_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = defined for SSMF maps that have a skyReflectModTex {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = auto generated normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF specular texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_distr&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat distribution texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat normals texture {{new|101.0}}, used as &amp;quot;$ssmf_splat_normals&amp;quot; or &amp;quot;$ssmf_splat_normals:X&amp;quot;, &#039;X&#039; can be a value between 0 and 3, defaults to 0 if &amp;quot;:X&amp;quot; is omitted&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_emission&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF emission texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_parallax&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF parallax texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = currently active info texture (los, airlos, radar, jammer)&amp;lt;br/&amp;gt; Note that textures contain no data until user switches to their respective modes and non-active textures are not updated in the background, so will go stale&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_losmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = los texture (L-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_mtlmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = metal map texture (F4-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_hgtmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = height map texture (F1-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_blkmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = blocking map texture (F2-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the map in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the map in view. {{new|95}} &amp;lt;br/&amp;gt;To translate this to world position coordinates, use:&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;No clip control / clipspace for depth is [-1,1]&#039;&#039;&#039;&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(vec3(gl_TexCoord[0].st, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x) * 2.0 - 1.0, 1.0);&lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;Default if clip control is supported / clipspace for depth is [0,1].&#039;&#039;&#039;&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(gl_TexCoord[0].st * 2.0 - 1.0, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x, 1.0);&lt;br /&gt;
&lt;br /&gt;
  worldpos.xyz = worldpos.xyz / worldpos.w; &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the models in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the models in view.  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | ${opt}:/LuaUI/images/image.png &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = load a texture from the VFS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
   possible ${opt}&#039;s are:&lt;br /&gt;
      &#039;n&#039; = nearest&lt;br /&gt;
      &#039;l&#039; = linear&lt;br /&gt;
      &#039;a&#039; = aniso&lt;br /&gt;
      &#039;i&#039; = invert&lt;br /&gt;
      &#039;g&#039; = greyed&lt;br /&gt;
      &#039;c&#039; = clamped&lt;br /&gt;
      &#039;b&#039; = border&lt;br /&gt;
      &#039;t%r,%g,%b&#039; = tint&lt;br /&gt;
      &#039;r%width,%height&#039; = resize&lt;br /&gt;
   The above ${opt}&#039;s are NOT available for .DDS textures! .dds will load faster than other image formats.&lt;br /&gt;
&lt;br /&gt;
    example: &amp;quot;:iac:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example: &amp;quot;:cr16,16:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example2: &amp;quot;:t1.0,0.5,0:/LuaUI/images/image.png&amp;quot;  (orange tint)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
  [ { &lt;br /&gt;
    [target     = number,] &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(like GL.TEXTURE_1D,GL.TEXTURE_2D,...)&amp;lt;/font&amp;gt; &amp;lt;font color=darkblue&amp;gt; (Added support for GL_TEXTURE_2D_MULTISAMPLE in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [format     = number,]&lt;br /&gt;
    [min_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [mag_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [wrap_s     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_t     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_r     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [aniso      = number,]&lt;br /&gt;
    [border     = boolean,]&lt;br /&gt;
    [fbo        = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [fboDepth   = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [samples    = number,] &amp;lt;font color=darkblue&amp;gt; specify any number here and target = GL_TEXTURE_2D_MULTISAMPLE to create multisample texture (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  } ]&lt;br /&gt;
  ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTexture&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTextureFBO&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TextureInfo&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; nil | {&lt;br /&gt;
      xsize = number,&lt;br /&gt;
      ysize = number,&lt;br /&gt;
      alpha = boolean, //not used yet&lt;br /&gt;
      type  = number,  //not used yet&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
   the format of the texture string is the same as in gl.Texture()&lt;br /&gt;
&amp;lt;/font&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number x | &lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum,&lt;br /&gt;
    number x |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexGen&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexGen&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil       &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CopyToTexture&#039;&#039;&#039;&lt;br /&gt;
  (string texture, int xoff, int yoff, int x, int y, int w, int h &lt;br /&gt;
  [,number target,number level])-&amp;gt;nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderToTexture&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string fbotexture, lua_func ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GenerateMipmap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs glGenerateMipmapEXT!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
The following are primarily intended to be used in conjunction with&lt;br /&gt;
     gl.{Unit,Feature}(objID, ..., raw=true)&lt;br /&gt;
     gl.{Unit,Feature}Shape(defID, ..., raw=true)&lt;br /&gt;
and apply a model&#039;s default textures; easier than gl.Texture(&amp;quot;$%...&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
= PixelReadback =&lt;br /&gt;
&#039;&#039;&#039;gl.SaveImage&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h,&lt;br /&gt;
    string filename [, table {alpha=boolean, yflip=boolean, grayscale16bit=boolean} ] ) -&amp;gt; nil | boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;grayscale16bit is {{new|99.0}} and allows to save single color 16bit PNG&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ReadPixels&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h [, number format = GL.RGBA ] )&lt;br /&gt;
    -&amp;gt; nil &lt;br /&gt;
    | number r,[g,[b,[a]]] &lt;br /&gt;
    | table { { {1 = number r, 2 = number g, 3 = number b, 4 = number a}, ... }, ... }&lt;br /&gt;
&lt;br /&gt;
= Lights =&lt;br /&gt;
&#039;&#039;&#039;gl.Lighting&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ShadeModel&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#ShadeModel|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Light&#039;&#039;&#039;&lt;br /&gt;
  ( int light, &lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param1, number param2, number param3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Material&#039;&#039;&#039;&lt;br /&gt;
  ({&lt;br /&gt;
    ambient   = {number r, number g, number b[, number a]},&lt;br /&gt;
    diffuse   = {number r, number g, number b[, number a]},&lt;br /&gt;
    ambidiff  = {number r, number g, number b[, number a]},&lt;br /&gt;
    emission  = {number r, number g, number b[, number a]},&lt;br /&gt;
    specular  = {number r, number g, number b[, number a]},&lt;br /&gt;
    shininess = number specularExponent&lt;br /&gt;
  }) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Hardware relevant =&lt;br /&gt;
&#039;&#039;&#039;gl.HasExtension&#039;&#039;&#039;&lt;br /&gt;
  ( string extname ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetNumber&#039;&#039;&#039;&lt;br /&gt;
  ( number ext, int count ) -&amp;gt; number [, number, number, ... #count ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetString&#039;&#039;&#039;&lt;br /&gt;
  ( number ext ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= DrawGroundPrimitives =&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundCircle&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z, number radius, number divs [, number slope ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: number divs is the number of sides the circle will have. the higher the smoother the circle (and more GPU intensive) &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundQuad&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: x1,z1,x2 &amp;amp; z2 are rounded, so don&#039;t use it for very small or moving objects. x and z are correspond to the coordinates displayed by the tooltip &amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number z1, number x2, number z2,&lt;br /&gt;
    [ boolean useNorm, &amp;lt;span class=warning&amp;gt;(does nothing!)&amp;lt;/span&amp;gt;&lt;br /&gt;
      [ number tu1, number tv1, number tu2, number tv2 |&lt;br /&gt;
        boolean useTextureCoord ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Queries =&lt;br /&gt;
&#039;&#039;&#039;gl.CreateQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; nil | userdata query&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.RunQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query, function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.GetQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil | number renderedFragments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Extended =&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexNames&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; { [1] = string texture, etc ... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexCoords&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;gets the texcoord of a 3do texture in the 3do texture atlas&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string 3doTextureName ) -&amp;gt; number xstart, number ystart, number xend, number yend&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeState&#039;&#039;&#039;&lt;br /&gt;
  ( number state [, boolean disable_state ], function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Calls glEnable(state) or glDisable(state) (if disable_state==true) and&amp;lt;br&amp;gt;then calls the lua_function and afterwards reverts the state.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetShadowMapParams&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; number xmid, number ymid, number p17, number p18&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMatrixData&#039;&#039;&#039;&lt;br /&gt;
  ( GL.PROJECTION [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( GL.MODELVIEW  [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i] &lt;br /&gt;
  ( GL.TEXTURE    [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( &amp;quot;shadow&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camera&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;caminv&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camprj&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;billboard&amp;quot; )             -&amp;gt; nil | number, etc.. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Flush&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Finish&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Shaders (GLSL) =&lt;br /&gt;
  [[Lua_GLSL_Api]]&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11515</id>
		<title>Lua OpenGL Api</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11515"/>
		<updated>2019-04-09T23:48:35Z</updated>

		<summary type="html">&lt;p&gt;Ivand: darkblue&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
= Spring =&lt;br /&gt;
&#039;&#039;&#039;gl.GetSun&#039;&#039;&#039;&lt;br /&gt;
  &amp;lt;font style=&amp;quot;font-size:90%&amp;quot;&amp;gt;()        -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;pos&amp;quot; ) -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;shadowDensity&amp;quot; [, &amp;quot;unit&amp;quot;] ) -&amp;gt; number shadowDensity&lt;br /&gt;
  ( &amp;quot;diffuse&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;ambient&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;specular&amp;quot;      [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetAtmosphere&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Sun|Spring.SetAtmosphere]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetWaterRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | string texName | number scalar | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetWaterParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMapRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetMapRenderingParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigScreen&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;used for Unit LODs&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number screenWidth, number screenDistance ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawMiniMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;argument new in 0.82+&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;boolean tansform = true&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SlaveMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( boolean mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( int px, int py, int sx, int sy ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetViewSizes&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number x, number y&lt;br /&gt;
&lt;br /&gt;
= Matrices &amp;amp; Viewport =&lt;br /&gt;
&#039;&#039;&#039;gl.Viewport&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;&#039;gl.Translate&#039;&#039;&#039;&lt;br /&gt;
  (number x, number y, number z) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scale&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rotate&#039;&#039;&#039;&lt;br /&gt;
  ( number angle, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Billboard&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Use this to draw 2d primitives in DrawWorld().&lt;br /&gt;
To render a 2D billboarded quad in the gameworld at world position x,y,z, you do the following (at a minimum; I am skipping blending / depthtesting) here:&lt;br /&gt;
  gl.PushMatrix()&lt;br /&gt;
  gl.Texture(read what you need here)&lt;br /&gt;
  gl.Translate(x,y,z)&lt;br /&gt;
  gl.Billboard()			&lt;br /&gt;
  gl.TexRect(x1,y1,x2,y2)&lt;br /&gt;
  gl.PopMatrix()&amp;lt;/span &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MatrixMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#MatrixMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadIdentity&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( 16 numbers or a [https://github.com/spring/spring/blob/develop/rts/Lua/LuaOpenGLUtils.cpp#L60 matrix name] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Ortho&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Frustum&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushPopMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ClipPlane&#039;&#039;&#039;&lt;br /&gt;
  ( int plane, &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: $plane can only be 1 or 2&amp;lt;/font&amp;gt;&lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number A, number B, number C, number D ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Clear =&lt;br /&gt;
&#039;&#039;&#039;gl.Clear&#039;&#039;&#039;&lt;br /&gt;
  ( GL.DEPTH_BUFFER_BIT [, number cleardepth] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.STENCIL_BUFFER_BIT [, int clearstencil] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.COLOR_BUFFER_BIT | GL.ACCUM_BUFFER_BIT [, number r, number g, number b, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SwapBuffers&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Available only in LuaMenu, meant for frame-limited LuaMenu&#039;s that want identical content in both buffers.&lt;br /&gt;
&lt;br /&gt;
= ResetState/Matrices =&lt;br /&gt;
&#039;&#039;&#039;gl.ResetState&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;DON&#039;T USE IT UNLESS YOU KNOW WHAT YOU ARE DOING! Each call-in has different default states, but this function resets all states to the states below no matter what!&amp;lt;/span&amp;gt;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  ShadeModel = GL.SMOOTH&lt;br /&gt;
  Scissor    = false&lt;br /&gt;
  Texture    = false&lt;br /&gt;
  Lighting    = false,&lt;br /&gt;
  ColorMask  = true, true, true, true&lt;br /&gt;
  DepthMask  = false&lt;br /&gt;
  DepthTest  = false  (GL.LEQUAL)&lt;br /&gt;
  Culling    = false  (GL.BACK)&lt;br /&gt;
  LogicOp    = false  (GL.INVERT)&lt;br /&gt;
  AlphaTest  = false  (GL.GREATER, 0.5f)&lt;br /&gt;
  Blending   = true (GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA)&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ResetMatrices&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  Resets GL.TEXTURE matrix stack&lt;br /&gt;
  Resets GL.MODELVIEW matrix stack&lt;br /&gt;
  Resets GL.PROJECTION matrix stack&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Draw Basics =&lt;br /&gt;
&#039;&#039;&#039;gl.BeginEnd&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Drawing_Primitives|GLType]], function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Color&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b[, number a] } |&lt;br /&gt;
      number r, number g, number b[, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Vertex&#039;&#039;&#039;&lt;br /&gt;
  ( { number x, number y [, number z [, number w ]] } |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Normal&#039;&#039;&#039;&lt;br /&gt;
  (  number x, number y, number z |&lt;br /&gt;
   { number x, number y, number z } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rect&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexRect&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;texture rect&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2,&lt;br /&gt;
  [ boolean flip_s, boolean flip_t | number s1, number t1, number s2, number t2 ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Shape&#039;&#039;&#039;&lt;br /&gt;
 ( number [[Lua_ConstGL#Drawing_Primitives|GLtype]],&lt;br /&gt;
   elements = {&lt;br /&gt;
     [1] = { v | vertex   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;required&amp;lt;/font&amp;gt;&lt;br /&gt;
             n | normal   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             t | texcoord = { number x, number y },                     &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             c | color    = { number r, number g, number b, number a }  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
     },&lt;br /&gt;
     etc ...&lt;br /&gt;
   }&lt;br /&gt;
 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SecondaryColor&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b } |&lt;br /&gt;
      number r, number g, number b ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FogCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Display Lists =&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Display Lists save given vertex attributes in a static buffer, so the GPU can directly read them (without the CPU). Display Lists are a lot faster (10-60x) than standard drawing with glShape/glBeginEnd, so try to use them when ever you can. If you want to learn more about them, g00gle is your friend ;)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateList&#039;&#039;&#039;&lt;br /&gt;
  ( function [,arg1 [,arg2...]] ) -&amp;gt; number listID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CallList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Vertex Buffer Objects =&lt;br /&gt;
&amp;lt;span class=note&amp;gt; &amp;lt;font color=darkblue&amp;gt; Only available in &amp;quot;develop&amp;quot; branch of spring (the future 105.0+). This is conceptually similar and serve as modern OpenGL replacement to deprecated Display Lists. &amp;lt;font&amp;gt; &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number numElements, number numIndices, [boolean persistentBuffer = false] ) -&amp;gt; number bufferID&lt;br /&gt;
&lt;br /&gt;
See what elements and indices are here: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-9-vbo-indexing/&amp;lt;br&amp;gt;&lt;br /&gt;
numElements and numIndices define the size of for elements and indices respectively. if indices are not going to be used, then set numIndices to 0&amp;lt;br&amp;gt;&lt;br /&gt;
Persistent buffers (persistentBuffer = true) are more efficient for dynamically/often updated geometry.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UpdateVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number bufferID, number elementPos, number indexPos, table tbl | function func ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
{elementPos, indexPos} define starting element in {element, index} VBO corresponding to 1st element of the supplied vertex data&amp;lt;br&amp;gt;&lt;br /&gt;
4 elements table example:&amp;lt;br&amp;gt;&lt;br /&gt;
  local verts = {&lt;br /&gt;
    p  = {0,0,0,1,  4,0,0,1,  4,4,0,1,  0,4,0,1},&lt;br /&gt;
    n  = {0,1,0  ,  0,1,0  ,  0,1,0  ,  0,1,0  },&lt;br /&gt;
    uv = {0,0,0,0,  1,0,0,0,  1,1,0,0,  0,1,0,0},&lt;br /&gt;
    c0 = {1,0,0,1,  0,1,0,1,  0,0,1,1,  1,1,1,0},&lt;br /&gt;
    i = {0, 1, 2, 2, 1, 3},            &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional, use in case of indexed VBO&amp;lt;/font&amp;gt;&lt;br /&gt;
    c1 = {...} }&lt;br /&gt;
&amp;lt;br&amp;gt;Alternatively Lua func can use gl.Vertex/gl.Color/gl.Normal/gl.TexCoord to define vertices, similarly how it used to be done in gl.BeginEnd.Note there is no function yet to define indices.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number bufferID, number primType, [number firstIndex = 0, count = numElements]  ) -&amp;gt; boolean success&lt;br /&gt;
primType can be GL.POINTS, GL.LINE_STRIP, GL.LINE_LOOP, GL.LINES, GL.LINE_STRIP_ADJACENCY, GL.LINES_ADJACENCY, GL.TRIANGLE_STRIP, GL.TRIANGLE_FAN, GL.TRIANGLES, GL.TRIANGLE_STRIP_ADJACENCY, GL.TRIANGLES_ADJACENCY and GL.PATCHES&amp;lt;br&amp;gt;&lt;br /&gt;
firstIndex specifies the starting index in the enabled arrays.&amp;lt;br&amp;gt;&lt;br /&gt;
count specifies the number of indices to be rendered.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteVertexArray&#039;&#039;&#039;&lt;br /&gt;
 ( number bufferID ) -&amp;gt; boolean success&lt;br /&gt;
Releases previously allocated VBO&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Text =&lt;br /&gt;
&#039;&#039;&#039;gl.Text&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;, number x, number y, number size [, string &amp;lt;span class=note&amp;gt;&amp;quot;options&amp;quot;&amp;lt;/span&amp;gt;] )&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
  options are:&lt;br /&gt;
    horizontal alignment:&lt;br /&gt;
       &#039;c&#039; = center&lt;br /&gt;
       &#039;r&#039; = right&lt;br /&gt;
    vertical alignment:&lt;br /&gt;
       &#039;a&#039; = ascender&lt;br /&gt;
       &#039;t&#039; = top&lt;br /&gt;
       &#039;v&#039; = vertical center&lt;br /&gt;
       &#039;x&#039; = baseline&lt;br /&gt;
       &#039;b&#039; = bottom&lt;br /&gt;
       &#039;d&#039; = descender&lt;br /&gt;
    decorations:&lt;br /&gt;
       &#039;o&#039; = black outline&lt;br /&gt;
       &#039;O&#039; = white outline&lt;br /&gt;
       &#039;s&#039; = shadow&lt;br /&gt;
    other:&lt;br /&gt;
       &#039;n&#039; = don&#039;t round vertex coords to nearest integer (font may get blurry)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
http://home.arcor.de/jkei/fontlines.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextWidth&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;) -&amp;gt; number width  &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextHeight&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;text&amp;quot; ) -&amp;gt; nil | number height, number descender, number numlines &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;further descriptions here: [[GetTextHeight]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&amp;lt;b&amp;gt;If you have multiple gl.Text calls, then you can bunch them between a gl.BeginText and gl.EndText to speedup the rendering.&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;gl.BeginText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.EndText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Unit/Feature Draw Functions =&lt;br /&gt;
&#039;&#039;&#039;gl.Unit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws an unit; on default it uses LOD, with lod&amp;lt;0 it is turned off, else it defines a specific level)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitRaw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(doesn&#039;t apply worldspace-&amp;gt;unit transformation! only works if &amp;lt;i&amp;gt;rawdraw&amp;lt;/i&amp;gt; is true )&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShape&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID, number teamID, bool rawState, bool toScreen, bool opaque ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|101.0}} The three extra boolean arguments make it so that calling only these functions is enough to get correctly rendered models; pass in &#039;false&#039; for the THIRD argument to get the fixed behavior, omit it or pass in &#039;true&#039; [default] to render with your own custom state instead. The FOURTH argument should be &#039;true&#039; if in DrawScreen and &#039;false&#039; (default) if in DrawWorld; any transforms for these two functions *MUST* include a gl.LoadIdentity call when argument #3 is false (whether they are used in DrawWorld or in DrawScreen) the FIFTH argument determines whether the model is drawn opaque (&#039;true&#039; [default]) or with translucency (&#039;false&#039;); only has an effect when argument #3 is false.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; unit space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(unit space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPiece&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the unit piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.UnitPieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Feature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureRaw&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShape&#039;&#039;&#039;&lt;br /&gt;
  ( number featureDefID, number teamID, bool custom, bool drawScreen, bool opaque  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; feature space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(feature space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePiece&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the Feature piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.FeaturePieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawListAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number listID, [ boolean midPos,&lt;br /&gt;
      number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
      number degrees, number rotX, number rotX, number rotZ ] ) -&amp;gt; nil &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawFuncAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean midPos, function [, arg1,... ]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= States (Blending,AlphaTest...) =&lt;br /&gt;
&#039;&#039;&#039;gl.Blending&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
  ( string &amp;lt;span class=note&amp;gt;mode&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99&amp;quot; | mode maybe:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.ONE, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha_add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;reset&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;color&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_COLOR, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;modulate&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.DST_COLOR, GL.ZERO&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;disable&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquation&#039;&#039;&#039;&lt;br /&gt;
  ( number mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquationSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number modeRGB, number modeAlpha ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcRGB]], number [[Lua_ConstGL#BlendingFactorDest|dstRGB]],  number [[Lua_ConstGL#BlendingFactorSrc|srcAlpha]], number [[Lua_ConstGL#BlendingFactorDest|dstAlpha]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.AlphaTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]], number threshold ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Culling&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#Culling|face]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthClamp&#039;&#039;&#039;  &amp;lt;span class=warning&amp;gt;not always available, needs GL.NV_depth_clamp!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ColorMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( boolean r, boolean g, boolean b, boolean a ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LogicOp&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#LogicOp|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Fog&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Smoothing&#039;&#039;&#039; {{removed|104.0}}&lt;br /&gt;
 ( (boolean enable | number POINT), &lt;br /&gt;
   (boolean enable | number LINE),&lt;br /&gt;
   (boolean enable | number POLYGON) ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
 ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scissor&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( int x, int y, int w, int h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LineStipple&#039;&#039;&#039;&lt;br /&gt;
  ( string any ) -&amp;gt; nil &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(use springs default line stipple)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
  ( int factor, number pattern ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number [[Lua_ConstGL#PolygonMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonOffset&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number factor, number units ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushAttrib&#039;&#039;&#039;&lt;br /&gt;
  ( [ number [[Lua_ConstGL#glPushAttrib.28.29_bits|attrib]] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopAttrib&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Stencil =&lt;br /&gt;
&#039;&#039;&#039;gl.StencilTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMask&#039;&#039;&#039;&lt;br /&gt;
  ( number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOp&#039;&#039;&#039;&lt;br /&gt;
  ( number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMaskSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOpSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= LineWidth &amp;amp; PointSize =&lt;br /&gt;
&#039;&#039;&#039;gl.LineWidth&#039;&#039;&#039;&lt;br /&gt;
  ( number width ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSize&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(values != 1 can break severely on ATI cards, see http://springrts.com/mantis/view.php?id=2390)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number size ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSprite&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable, [boolean coord_replace, boolean coord_origin_upper] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointParameter&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number v1, number v2, number v3, &lt;br /&gt;
    [ number sizeMin, number sizeMax, number sizeFade ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Textures =&lt;br /&gt;
&#039;&#039;&#039;gl.Texture&#039;&#039;&#039;&lt;br /&gt;
  ( [ number texNum, ] boolean enable | string &amp;lt;span class=note&amp;gt;name&amp;lt;/span&amp;gt; ) -&amp;gt; nil | boolean loaded&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;This is the only call-out that is needed to load and draw any texture in a Lua script. All you have to do is pass it a valid path to a valid png and it will use that image for drawing any subsequent textured rectangles. This is shown in the last line of the following list of valid strings for the name parameter.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99; text-align:left&amp;quot; |`name` may be:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | #12&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 12 buildpic&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %34:1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 34 s3o tex2 (:0-&amp;gt;tex1,:1-&amp;gt;tex2)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %-102:0&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = featureDef 102 s3o tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | !56&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = lua generated texture 56 (= return value of gl.CreateTexture)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units2&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shadow&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = shadowmap&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = specular cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(removed in the latest develop)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $reflection &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = reflection cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(can be mipmaped starting from 104.0.1-714-ga29177f. Set CubeTexGenerateMipMaps=1 in settings)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shading&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = ground shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $grass&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = grass shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $heightmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = heightmap (needs HeightMapTexture=1 set in spring config)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $minimap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = minimap texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = same as &amp;quot;$reflection&amp;quot; {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $sky_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = defined for SSMF maps that have a skyReflectModTex {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = auto generated normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF specular texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_distr&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat distribution texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat normals texture {{new|101.0}}, used as &amp;quot;$ssmf_splat_normals&amp;quot; or &amp;quot;$ssmf_splat_normals:X&amp;quot;, &#039;X&#039; can be a value between 0 and 3, defaults to 0 if &amp;quot;:X&amp;quot; is omitted&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_emission&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF emission texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_parallax&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF parallax texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = currently active info texture (los, airlos, radar, jammer)&amp;lt;br/&amp;gt; Note that textures contain no data until user switches to their respective modes and non-active textures are not updated in the background, so will go stale&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_losmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = los texture (L-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_mtlmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = metal map texture (F4-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_hgtmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = height map texture (F1-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_blkmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = blocking map texture (F2-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the map in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the map in view. {{new|95}} &amp;lt;br/&amp;gt;To translate this to world position coordinates, use:&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;No clip control / clipspace for depth is [-1,1]&#039;&#039;&#039;&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(vec3(gl_TexCoord[0].st, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x) * 2.0 - 1.0, 1.0);&lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;Default if clip control is supported / clipspace for depth is [0,1].&#039;&#039;&#039;&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(gl_TexCoord[0].st * 2.0 - 1.0, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x, 1.0);&lt;br /&gt;
&lt;br /&gt;
  worldpos.xyz = worldpos.xyz / worldpos.w; &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the models in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the models in view.  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | ${opt}:/LuaUI/images/image.png &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = load a texture from the VFS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
   possible ${opt}&#039;s are:&lt;br /&gt;
      &#039;n&#039; = nearest&lt;br /&gt;
      &#039;l&#039; = linear&lt;br /&gt;
      &#039;a&#039; = aniso&lt;br /&gt;
      &#039;i&#039; = invert&lt;br /&gt;
      &#039;g&#039; = greyed&lt;br /&gt;
      &#039;c&#039; = clamped&lt;br /&gt;
      &#039;b&#039; = border&lt;br /&gt;
      &#039;t%r,%g,%b&#039; = tint&lt;br /&gt;
      &#039;r%width,%height&#039; = resize&lt;br /&gt;
   The above ${opt}&#039;s are NOT available for .DDS textures! .dds will load faster than other image formats.&lt;br /&gt;
&lt;br /&gt;
    example: &amp;quot;:iac:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example: &amp;quot;:cr16,16:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example2: &amp;quot;:t1.0,0.5,0:/LuaUI/images/image.png&amp;quot;  (orange tint)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
  [ { &lt;br /&gt;
    [target     = number,] &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(like GL.TEXTURE_1D,GL.TEXTURE_2D,...)&amp;lt;/font&amp;gt; &amp;lt;font color=darkblue&amp;gt; (Added support for GL_TEXTURE_2D_MULTISAMPLE in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [format     = number,]&lt;br /&gt;
    [min_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [mag_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [wrap_s     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_t     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_r     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [aniso      = number,]&lt;br /&gt;
    [border     = boolean,]&lt;br /&gt;
    [fbo        = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [fboDepth   = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [samples    = number,] &amp;lt;font color=darkblue&amp;gt; specify any number here and target = GL_TEXTURE_2D_MULTISAMPLE to create multisample texture (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  } ]&lt;br /&gt;
  ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTexture&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTextureFBO&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TextureInfo&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; nil | {&lt;br /&gt;
      xsize = number,&lt;br /&gt;
      ysize = number,&lt;br /&gt;
      alpha = boolean, //not used yet&lt;br /&gt;
      type  = number,  //not used yet&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
   the format of the texture string is the same as in gl.Texture()&lt;br /&gt;
&amp;lt;/font&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number x | &lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum,&lt;br /&gt;
    number x |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexGen&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexGen&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil       &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CopyToTexture&#039;&#039;&#039;&lt;br /&gt;
  (string texture, int xoff, int yoff, int x, int y, int w, int h &lt;br /&gt;
  [,number target,number level])-&amp;gt;nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderToTexture&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string fbotexture, lua_func ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GenerateMipmap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs glGenerateMipmapEXT!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
The following are primarily intended to be used in conjunction with&lt;br /&gt;
     gl.{Unit,Feature}(objID, ..., raw=true)&lt;br /&gt;
     gl.{Unit,Feature}Shape(defID, ..., raw=true)&lt;br /&gt;
and apply a model&#039;s default textures; easier than gl.Texture(&amp;quot;$%...&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
= PixelReadback =&lt;br /&gt;
&#039;&#039;&#039;gl.SaveImage&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h,&lt;br /&gt;
    string filename [, table {alpha=boolean, yflip=boolean, grayscale16bit=boolean} ] ) -&amp;gt; nil | boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;grayscale16bit is {{new|99.0}} and allows to save single color 16bit PNG&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ReadPixels&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h [, number format = GL.RGBA ] )&lt;br /&gt;
    -&amp;gt; nil &lt;br /&gt;
    | number r,[g,[b,[a]]] &lt;br /&gt;
    | table { { {1 = number r, 2 = number g, 3 = number b, 4 = number a}, ... }, ... }&lt;br /&gt;
&lt;br /&gt;
= Lights =&lt;br /&gt;
&#039;&#039;&#039;gl.Lighting&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ShadeModel&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#ShadeModel|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Light&#039;&#039;&#039;&lt;br /&gt;
  ( int light, &lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param1, number param2, number param3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Material&#039;&#039;&#039;&lt;br /&gt;
  ({&lt;br /&gt;
    ambient   = {number r, number g, number b[, number a]},&lt;br /&gt;
    diffuse   = {number r, number g, number b[, number a]},&lt;br /&gt;
    ambidiff  = {number r, number g, number b[, number a]},&lt;br /&gt;
    emission  = {number r, number g, number b[, number a]},&lt;br /&gt;
    specular  = {number r, number g, number b[, number a]},&lt;br /&gt;
    shininess = number specularExponent&lt;br /&gt;
  }) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Hardware relevant =&lt;br /&gt;
&#039;&#039;&#039;gl.HasExtension&#039;&#039;&#039;&lt;br /&gt;
  ( string extname ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetNumber&#039;&#039;&#039;&lt;br /&gt;
  ( number ext, int count ) -&amp;gt; number [, number, number, ... #count ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetString&#039;&#039;&#039;&lt;br /&gt;
  ( number ext ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= DrawGroundPrimitives =&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundCircle&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z, number radius, number divs [, number slope ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: number divs is the number of sides the circle will have. the higher the smoother the circle (and more GPU intensive) &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundQuad&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: x1,z1,x2 &amp;amp; z2 are rounded, so don&#039;t use it for very small or moving objects. x and z are correspond to the coordinates displayed by the tooltip &amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number z1, number x2, number z2,&lt;br /&gt;
    [ boolean useNorm, &amp;lt;span class=warning&amp;gt;(does nothing!)&amp;lt;/span&amp;gt;&lt;br /&gt;
      [ number tu1, number tv1, number tu2, number tv2 |&lt;br /&gt;
        boolean useTextureCoord ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Queries =&lt;br /&gt;
&#039;&#039;&#039;gl.CreateQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; nil | userdata query&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.RunQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query, function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.GetQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil | number renderedFragments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Extended =&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexNames&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; { [1] = string texture, etc ... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexCoords&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;gets the texcoord of a 3do texture in the 3do texture atlas&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string 3doTextureName ) -&amp;gt; number xstart, number ystart, number xend, number yend&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeState&#039;&#039;&#039;&lt;br /&gt;
  ( number state [, boolean disable_state ], function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Calls glEnable(state) or glDisable(state) (if disable_state==true) and&amp;lt;br&amp;gt;then calls the lua_function and afterwards reverts the state.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetShadowMapParams&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; number xmid, number ymid, number p17, number p18&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMatrixData&#039;&#039;&#039;&lt;br /&gt;
  ( GL.PROJECTION [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( GL.MODELVIEW  [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i] &lt;br /&gt;
  ( GL.TEXTURE    [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( &amp;quot;shadow&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camera&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;caminv&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camprj&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;billboard&amp;quot; )             -&amp;gt; nil | number, etc.. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Flush&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Finish&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Shaders (GLSL) =&lt;br /&gt;
  [[Lua_GLSL_Api]]&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11514</id>
		<title>Lua OpenGL Api</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11514"/>
		<updated>2019-04-09T23:46:22Z</updated>

		<summary type="html">&lt;p&gt;Ivand: Added Lua VBO primitives&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
= Spring =&lt;br /&gt;
&#039;&#039;&#039;gl.GetSun&#039;&#039;&#039;&lt;br /&gt;
  &amp;lt;font style=&amp;quot;font-size:90%&amp;quot;&amp;gt;()        -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;pos&amp;quot; ) -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;shadowDensity&amp;quot; [, &amp;quot;unit&amp;quot;] ) -&amp;gt; number shadowDensity&lt;br /&gt;
  ( &amp;quot;diffuse&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;ambient&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;specular&amp;quot;      [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetAtmosphere&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Sun|Spring.SetAtmosphere]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetWaterRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | string texName | number scalar | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetWaterParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMapRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetMapRenderingParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigScreen&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;used for Unit LODs&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number screenWidth, number screenDistance ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawMiniMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;argument new in 0.82+&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;boolean tansform = true&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SlaveMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( boolean mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( int px, int py, int sx, int sy ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetViewSizes&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number x, number y&lt;br /&gt;
&lt;br /&gt;
= Matrices &amp;amp; Viewport =&lt;br /&gt;
&#039;&#039;&#039;gl.Viewport&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;&#039;gl.Translate&#039;&#039;&#039;&lt;br /&gt;
  (number x, number y, number z) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scale&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rotate&#039;&#039;&#039;&lt;br /&gt;
  ( number angle, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Billboard&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Use this to draw 2d primitives in DrawWorld().&lt;br /&gt;
To render a 2D billboarded quad in the gameworld at world position x,y,z, you do the following (at a minimum; I am skipping blending / depthtesting) here:&lt;br /&gt;
  gl.PushMatrix()&lt;br /&gt;
  gl.Texture(read what you need here)&lt;br /&gt;
  gl.Translate(x,y,z)&lt;br /&gt;
  gl.Billboard()			&lt;br /&gt;
  gl.TexRect(x1,y1,x2,y2)&lt;br /&gt;
  gl.PopMatrix()&amp;lt;/span &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MatrixMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#MatrixMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadIdentity&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( 16 numbers or a [https://github.com/spring/spring/blob/develop/rts/Lua/LuaOpenGLUtils.cpp#L60 matrix name] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Ortho&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Frustum&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushPopMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ClipPlane&#039;&#039;&#039;&lt;br /&gt;
  ( int plane, &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: $plane can only be 1 or 2&amp;lt;/font&amp;gt;&lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number A, number B, number C, number D ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Clear =&lt;br /&gt;
&#039;&#039;&#039;gl.Clear&#039;&#039;&#039;&lt;br /&gt;
  ( GL.DEPTH_BUFFER_BIT [, number cleardepth] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.STENCIL_BUFFER_BIT [, int clearstencil] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.COLOR_BUFFER_BIT | GL.ACCUM_BUFFER_BIT [, number r, number g, number b, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SwapBuffers&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Available only in LuaMenu, meant for frame-limited LuaMenu&#039;s that want identical content in both buffers.&lt;br /&gt;
&lt;br /&gt;
= ResetState/Matrices =&lt;br /&gt;
&#039;&#039;&#039;gl.ResetState&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;DON&#039;T USE IT UNLESS YOU KNOW WHAT YOU ARE DOING! Each call-in has different default states, but this function resets all states to the states below no matter what!&amp;lt;/span&amp;gt;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  ShadeModel = GL.SMOOTH&lt;br /&gt;
  Scissor    = false&lt;br /&gt;
  Texture    = false&lt;br /&gt;
  Lighting    = false,&lt;br /&gt;
  ColorMask  = true, true, true, true&lt;br /&gt;
  DepthMask  = false&lt;br /&gt;
  DepthTest  = false  (GL.LEQUAL)&lt;br /&gt;
  Culling    = false  (GL.BACK)&lt;br /&gt;
  LogicOp    = false  (GL.INVERT)&lt;br /&gt;
  AlphaTest  = false  (GL.GREATER, 0.5f)&lt;br /&gt;
  Blending   = true (GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA)&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ResetMatrices&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  Resets GL.TEXTURE matrix stack&lt;br /&gt;
  Resets GL.MODELVIEW matrix stack&lt;br /&gt;
  Resets GL.PROJECTION matrix stack&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Draw Basics =&lt;br /&gt;
&#039;&#039;&#039;gl.BeginEnd&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Drawing_Primitives|GLType]], function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Color&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b[, number a] } |&lt;br /&gt;
      number r, number g, number b[, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Vertex&#039;&#039;&#039;&lt;br /&gt;
  ( { number x, number y [, number z [, number w ]] } |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Normal&#039;&#039;&#039;&lt;br /&gt;
  (  number x, number y, number z |&lt;br /&gt;
   { number x, number y, number z } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rect&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexRect&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;texture rect&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2,&lt;br /&gt;
  [ boolean flip_s, boolean flip_t | number s1, number t1, number s2, number t2 ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Shape&#039;&#039;&#039;&lt;br /&gt;
 ( number [[Lua_ConstGL#Drawing_Primitives|GLtype]],&lt;br /&gt;
   elements = {&lt;br /&gt;
     [1] = { v | vertex   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;required&amp;lt;/font&amp;gt;&lt;br /&gt;
             n | normal   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             t | texcoord = { number x, number y },                     &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             c | color    = { number r, number g, number b, number a }  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
     },&lt;br /&gt;
     etc ...&lt;br /&gt;
   }&lt;br /&gt;
 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SecondaryColor&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b } |&lt;br /&gt;
      number r, number g, number b ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FogCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Display Lists =&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Display Lists save given vertex attributes in a static buffer, so the GPU can directly read them (without the CPU). Display Lists are a lot faster (10-60x) than standard drawing with glShape/glBeginEnd, so try to use them when ever you can. If you want to learn more about them, g00gle is your friend ;)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateList&#039;&#039;&#039;&lt;br /&gt;
  ( function [,arg1 [,arg2...]] ) -&amp;gt; number listID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CallList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Vertex Buffer Objects =&lt;br /&gt;
&amp;lt;span class=note&amp;gt; Only available in &amp;quot;develop&amp;quot; branch of spring (the future 105.0+). This is conceptually similar and serve as modern OpenGL replacement to deprecated Display Lists. &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number numElements, number numIndices, [boolean persistentBuffer = false] ) -&amp;gt; number bufferID&lt;br /&gt;
&lt;br /&gt;
See what elements and indices are here: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-9-vbo-indexing/&amp;lt;br&amp;gt;&lt;br /&gt;
numElements and numIndices define the size of for elements and indices respectively. if indices are not going to be used, then set numIndices to 0&amp;lt;br&amp;gt;&lt;br /&gt;
Persistent buffers (persistentBuffer = true) are more efficient for dynamically/often updated geometry.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UpdateVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number bufferID, number elementPos, number indexPos, table tbl | function func ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
{elementPos, indexPos} define starting element in {element, index} VBO corresponding to 1st element of the supplied vertex data&amp;lt;br&amp;gt;&lt;br /&gt;
4 elements table example:&amp;lt;br&amp;gt;&lt;br /&gt;
  local verts = {&lt;br /&gt;
    p  = {0,0,0,1,  4,0,0,1,  4,4,0,1,  0,4,0,1},&lt;br /&gt;
    n  = {0,1,0  ,  0,1,0  ,  0,1,0  ,  0,1,0  },&lt;br /&gt;
    uv = {0,0,0,0,  1,0,0,0,  1,1,0,0,  0,1,0,0},&lt;br /&gt;
    c0 = {1,0,0,1,  0,1,0,1,  0,0,1,1,  1,1,1,0},&lt;br /&gt;
    i = {0, 1, 2, 2, 1, 3},            &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional, use in case of indexed VBO&amp;lt;/font&amp;gt;&lt;br /&gt;
    c1 = {...} }&lt;br /&gt;
&amp;lt;br&amp;gt;Alternatively Lua func can use gl.Vertex/gl.Color/gl.Normal/gl.TexCoord to define vertices, similarly how it used to be done in gl.BeginEnd.Note there is no function yet to define indices.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderVertexArray&#039;&#039;&#039;&lt;br /&gt;
  ( number bufferID, number primType, [number firstIndex = 0, count = numElements]  ) -&amp;gt; boolean success&lt;br /&gt;
primType can be GL.POINTS, GL.LINE_STRIP, GL.LINE_LOOP, GL.LINES, GL.LINE_STRIP_ADJACENCY, GL.LINES_ADJACENCY, GL.TRIANGLE_STRIP, GL.TRIANGLE_FAN, GL.TRIANGLES, GL.TRIANGLE_STRIP_ADJACENCY, GL.TRIANGLES_ADJACENCY and GL.PATCHES&amp;lt;br&amp;gt;&lt;br /&gt;
firstIndex specifies the starting index in the enabled arrays.&amp;lt;br&amp;gt;&lt;br /&gt;
count specifies the number of indices to be rendered.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteVertexArray&#039;&#039;&#039;&lt;br /&gt;
 ( number bufferID ) -&amp;gt; boolean success&lt;br /&gt;
Releases previously allocated VBO&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Text =&lt;br /&gt;
&#039;&#039;&#039;gl.Text&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;, number x, number y, number size [, string &amp;lt;span class=note&amp;gt;&amp;quot;options&amp;quot;&amp;lt;/span&amp;gt;] )&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
  options are:&lt;br /&gt;
    horizontal alignment:&lt;br /&gt;
       &#039;c&#039; = center&lt;br /&gt;
       &#039;r&#039; = right&lt;br /&gt;
    vertical alignment:&lt;br /&gt;
       &#039;a&#039; = ascender&lt;br /&gt;
       &#039;t&#039; = top&lt;br /&gt;
       &#039;v&#039; = vertical center&lt;br /&gt;
       &#039;x&#039; = baseline&lt;br /&gt;
       &#039;b&#039; = bottom&lt;br /&gt;
       &#039;d&#039; = descender&lt;br /&gt;
    decorations:&lt;br /&gt;
       &#039;o&#039; = black outline&lt;br /&gt;
       &#039;O&#039; = white outline&lt;br /&gt;
       &#039;s&#039; = shadow&lt;br /&gt;
    other:&lt;br /&gt;
       &#039;n&#039; = don&#039;t round vertex coords to nearest integer (font may get blurry)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
http://home.arcor.de/jkei/fontlines.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextWidth&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;) -&amp;gt; number width  &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextHeight&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;text&amp;quot; ) -&amp;gt; nil | number height, number descender, number numlines &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;further descriptions here: [[GetTextHeight]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&amp;lt;b&amp;gt;If you have multiple gl.Text calls, then you can bunch them between a gl.BeginText and gl.EndText to speedup the rendering.&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;gl.BeginText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.EndText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Unit/Feature Draw Functions =&lt;br /&gt;
&#039;&#039;&#039;gl.Unit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws an unit; on default it uses LOD, with lod&amp;lt;0 it is turned off, else it defines a specific level)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitRaw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(doesn&#039;t apply worldspace-&amp;gt;unit transformation! only works if &amp;lt;i&amp;gt;rawdraw&amp;lt;/i&amp;gt; is true )&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShape&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID, number teamID, bool rawState, bool toScreen, bool opaque ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|101.0}} The three extra boolean arguments make it so that calling only these functions is enough to get correctly rendered models; pass in &#039;false&#039; for the THIRD argument to get the fixed behavior, omit it or pass in &#039;true&#039; [default] to render with your own custom state instead. The FOURTH argument should be &#039;true&#039; if in DrawScreen and &#039;false&#039; (default) if in DrawWorld; any transforms for these two functions *MUST* include a gl.LoadIdentity call when argument #3 is false (whether they are used in DrawWorld or in DrawScreen) the FIFTH argument determines whether the model is drawn opaque (&#039;true&#039; [default]) or with translucency (&#039;false&#039;); only has an effect when argument #3 is false.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; unit space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(unit space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPiece&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the unit piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.UnitPieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Feature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureRaw&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShape&#039;&#039;&#039;&lt;br /&gt;
  ( number featureDefID, number teamID, bool custom, bool drawScreen, bool opaque  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; feature space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(feature space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePiece&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the Feature piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.FeaturePieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawListAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number listID, [ boolean midPos,&lt;br /&gt;
      number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
      number degrees, number rotX, number rotX, number rotZ ] ) -&amp;gt; nil &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawFuncAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean midPos, function [, arg1,... ]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= States (Blending,AlphaTest...) =&lt;br /&gt;
&#039;&#039;&#039;gl.Blending&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
  ( string &amp;lt;span class=note&amp;gt;mode&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99&amp;quot; | mode maybe:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.ONE, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha_add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;reset&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;color&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_COLOR, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;modulate&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.DST_COLOR, GL.ZERO&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;disable&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquation&#039;&#039;&#039;&lt;br /&gt;
  ( number mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquationSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number modeRGB, number modeAlpha ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcRGB]], number [[Lua_ConstGL#BlendingFactorDest|dstRGB]],  number [[Lua_ConstGL#BlendingFactorSrc|srcAlpha]], number [[Lua_ConstGL#BlendingFactorDest|dstAlpha]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.AlphaTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]], number threshold ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Culling&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#Culling|face]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthClamp&#039;&#039;&#039;  &amp;lt;span class=warning&amp;gt;not always available, needs GL.NV_depth_clamp!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ColorMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( boolean r, boolean g, boolean b, boolean a ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LogicOp&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#LogicOp|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Fog&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Smoothing&#039;&#039;&#039; {{removed|104.0}}&lt;br /&gt;
 ( (boolean enable | number POINT), &lt;br /&gt;
   (boolean enable | number LINE),&lt;br /&gt;
   (boolean enable | number POLYGON) ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
 ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scissor&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( int x, int y, int w, int h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LineStipple&#039;&#039;&#039;&lt;br /&gt;
  ( string any ) -&amp;gt; nil &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(use springs default line stipple)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
  ( int factor, number pattern ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number [[Lua_ConstGL#PolygonMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonOffset&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number factor, number units ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushAttrib&#039;&#039;&#039;&lt;br /&gt;
  ( [ number [[Lua_ConstGL#glPushAttrib.28.29_bits|attrib]] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopAttrib&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Stencil =&lt;br /&gt;
&#039;&#039;&#039;gl.StencilTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMask&#039;&#039;&#039;&lt;br /&gt;
  ( number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOp&#039;&#039;&#039;&lt;br /&gt;
  ( number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMaskSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOpSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= LineWidth &amp;amp; PointSize =&lt;br /&gt;
&#039;&#039;&#039;gl.LineWidth&#039;&#039;&#039;&lt;br /&gt;
  ( number width ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSize&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(values != 1 can break severely on ATI cards, see http://springrts.com/mantis/view.php?id=2390)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number size ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSprite&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable, [boolean coord_replace, boolean coord_origin_upper] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointParameter&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number v1, number v2, number v3, &lt;br /&gt;
    [ number sizeMin, number sizeMax, number sizeFade ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Textures =&lt;br /&gt;
&#039;&#039;&#039;gl.Texture&#039;&#039;&#039;&lt;br /&gt;
  ( [ number texNum, ] boolean enable | string &amp;lt;span class=note&amp;gt;name&amp;lt;/span&amp;gt; ) -&amp;gt; nil | boolean loaded&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;This is the only call-out that is needed to load and draw any texture in a Lua script. All you have to do is pass it a valid path to a valid png and it will use that image for drawing any subsequent textured rectangles. This is shown in the last line of the following list of valid strings for the name parameter.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99; text-align:left&amp;quot; |`name` may be:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | #12&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 12 buildpic&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %34:1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 34 s3o tex2 (:0-&amp;gt;tex1,:1-&amp;gt;tex2)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %-102:0&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = featureDef 102 s3o tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | !56&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = lua generated texture 56 (= return value of gl.CreateTexture)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units2&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shadow&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = shadowmap&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = specular cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(removed in the latest develop)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $reflection &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = reflection cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(can be mipmaped starting from 104.0.1-714-ga29177f. Set CubeTexGenerateMipMaps=1 in settings)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shading&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = ground shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $grass&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = grass shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $heightmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = heightmap (needs HeightMapTexture=1 set in spring config)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $minimap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = minimap texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = same as &amp;quot;$reflection&amp;quot; {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $sky_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = defined for SSMF maps that have a skyReflectModTex {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = auto generated normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF specular texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_distr&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat distribution texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat normals texture {{new|101.0}}, used as &amp;quot;$ssmf_splat_normals&amp;quot; or &amp;quot;$ssmf_splat_normals:X&amp;quot;, &#039;X&#039; can be a value between 0 and 3, defaults to 0 if &amp;quot;:X&amp;quot; is omitted&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_emission&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF emission texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_parallax&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF parallax texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = currently active info texture (los, airlos, radar, jammer)&amp;lt;br/&amp;gt; Note that textures contain no data until user switches to their respective modes and non-active textures are not updated in the background, so will go stale&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_losmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = los texture (L-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_mtlmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = metal map texture (F4-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_hgtmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = height map texture (F1-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_blkmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = blocking map texture (F2-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the map in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the map in view. {{new|95}} &amp;lt;br/&amp;gt;To translate this to world position coordinates, use:&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;No clip control / clipspace for depth is [-1,1]&#039;&#039;&#039;&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(vec3(gl_TexCoord[0].st, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x) * 2.0 - 1.0, 1.0);&lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;Default if clip control is supported / clipspace for depth is [0,1].&#039;&#039;&#039;&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(gl_TexCoord[0].st * 2.0 - 1.0, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x, 1.0);&lt;br /&gt;
&lt;br /&gt;
  worldpos.xyz = worldpos.xyz / worldpos.w; &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the models in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the models in view.  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | ${opt}:/LuaUI/images/image.png &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = load a texture from the VFS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
   possible ${opt}&#039;s are:&lt;br /&gt;
      &#039;n&#039; = nearest&lt;br /&gt;
      &#039;l&#039; = linear&lt;br /&gt;
      &#039;a&#039; = aniso&lt;br /&gt;
      &#039;i&#039; = invert&lt;br /&gt;
      &#039;g&#039; = greyed&lt;br /&gt;
      &#039;c&#039; = clamped&lt;br /&gt;
      &#039;b&#039; = border&lt;br /&gt;
      &#039;t%r,%g,%b&#039; = tint&lt;br /&gt;
      &#039;r%width,%height&#039; = resize&lt;br /&gt;
   The above ${opt}&#039;s are NOT available for .DDS textures! .dds will load faster than other image formats.&lt;br /&gt;
&lt;br /&gt;
    example: &amp;quot;:iac:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example: &amp;quot;:cr16,16:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example2: &amp;quot;:t1.0,0.5,0:/LuaUI/images/image.png&amp;quot;  (orange tint)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
  [ { &lt;br /&gt;
    [target     = number,] &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(like GL.TEXTURE_1D,GL.TEXTURE_2D,...)&amp;lt;/font&amp;gt; &amp;lt;font color=darkblue&amp;gt; (Added support for GL_TEXTURE_2D_MULTISAMPLE in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [format     = number,]&lt;br /&gt;
    [min_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [mag_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [wrap_s     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_t     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_r     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [aniso      = number,]&lt;br /&gt;
    [border     = boolean,]&lt;br /&gt;
    [fbo        = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [fboDepth   = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [samples    = number,] &amp;lt;font color=darkblue&amp;gt; specify any number here and target = GL_TEXTURE_2D_MULTISAMPLE to create multisample texture (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  } ]&lt;br /&gt;
  ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTexture&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTextureFBO&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TextureInfo&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; nil | {&lt;br /&gt;
      xsize = number,&lt;br /&gt;
      ysize = number,&lt;br /&gt;
      alpha = boolean, //not used yet&lt;br /&gt;
      type  = number,  //not used yet&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
   the format of the texture string is the same as in gl.Texture()&lt;br /&gt;
&amp;lt;/font&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number x | &lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum,&lt;br /&gt;
    number x |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexGen&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexGen&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil       &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CopyToTexture&#039;&#039;&#039;&lt;br /&gt;
  (string texture, int xoff, int yoff, int x, int y, int w, int h &lt;br /&gt;
  [,number target,number level])-&amp;gt;nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderToTexture&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string fbotexture, lua_func ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GenerateMipmap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs glGenerateMipmapEXT!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
The following are primarily intended to be used in conjunction with&lt;br /&gt;
     gl.{Unit,Feature}(objID, ..., raw=true)&lt;br /&gt;
     gl.{Unit,Feature}Shape(defID, ..., raw=true)&lt;br /&gt;
and apply a model&#039;s default textures; easier than gl.Texture(&amp;quot;$%...&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
= PixelReadback =&lt;br /&gt;
&#039;&#039;&#039;gl.SaveImage&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h,&lt;br /&gt;
    string filename [, table {alpha=boolean, yflip=boolean, grayscale16bit=boolean} ] ) -&amp;gt; nil | boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;grayscale16bit is {{new|99.0}} and allows to save single color 16bit PNG&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ReadPixels&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h [, number format = GL.RGBA ] )&lt;br /&gt;
    -&amp;gt; nil &lt;br /&gt;
    | number r,[g,[b,[a]]] &lt;br /&gt;
    | table { { {1 = number r, 2 = number g, 3 = number b, 4 = number a}, ... }, ... }&lt;br /&gt;
&lt;br /&gt;
= Lights =&lt;br /&gt;
&#039;&#039;&#039;gl.Lighting&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ShadeModel&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#ShadeModel|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Light&#039;&#039;&#039;&lt;br /&gt;
  ( int light, &lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param1, number param2, number param3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Material&#039;&#039;&#039;&lt;br /&gt;
  ({&lt;br /&gt;
    ambient   = {number r, number g, number b[, number a]},&lt;br /&gt;
    diffuse   = {number r, number g, number b[, number a]},&lt;br /&gt;
    ambidiff  = {number r, number g, number b[, number a]},&lt;br /&gt;
    emission  = {number r, number g, number b[, number a]},&lt;br /&gt;
    specular  = {number r, number g, number b[, number a]},&lt;br /&gt;
    shininess = number specularExponent&lt;br /&gt;
  }) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Hardware relevant =&lt;br /&gt;
&#039;&#039;&#039;gl.HasExtension&#039;&#039;&#039;&lt;br /&gt;
  ( string extname ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetNumber&#039;&#039;&#039;&lt;br /&gt;
  ( number ext, int count ) -&amp;gt; number [, number, number, ... #count ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetString&#039;&#039;&#039;&lt;br /&gt;
  ( number ext ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= DrawGroundPrimitives =&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundCircle&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z, number radius, number divs [, number slope ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: number divs is the number of sides the circle will have. the higher the smoother the circle (and more GPU intensive) &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundQuad&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: x1,z1,x2 &amp;amp; z2 are rounded, so don&#039;t use it for very small or moving objects. x and z are correspond to the coordinates displayed by the tooltip &amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number z1, number x2, number z2,&lt;br /&gt;
    [ boolean useNorm, &amp;lt;span class=warning&amp;gt;(does nothing!)&amp;lt;/span&amp;gt;&lt;br /&gt;
      [ number tu1, number tv1, number tu2, number tv2 |&lt;br /&gt;
        boolean useTextureCoord ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Queries =&lt;br /&gt;
&#039;&#039;&#039;gl.CreateQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; nil | userdata query&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.RunQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query, function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.GetQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil | number renderedFragments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Extended =&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexNames&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; { [1] = string texture, etc ... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexCoords&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;gets the texcoord of a 3do texture in the 3do texture atlas&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string 3doTextureName ) -&amp;gt; number xstart, number ystart, number xend, number yend&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeState&#039;&#039;&#039;&lt;br /&gt;
  ( number state [, boolean disable_state ], function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Calls glEnable(state) or glDisable(state) (if disable_state==true) and&amp;lt;br&amp;gt;then calls the lua_function and afterwards reverts the state.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetShadowMapParams&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; number xmid, number ymid, number p17, number p18&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMatrixData&#039;&#039;&#039;&lt;br /&gt;
  ( GL.PROJECTION [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( GL.MODELVIEW  [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i] &lt;br /&gt;
  ( GL.TEXTURE    [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( &amp;quot;shadow&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camera&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;caminv&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camprj&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;billboard&amp;quot; )             -&amp;gt; nil | number, etc.. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Flush&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Finish&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Shaders (GLSL) =&lt;br /&gt;
  [[Lua_GLSL_Api]]&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO&amp;diff=11254</id>
		<title>Lua FBO</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO&amp;diff=11254"/>
		<updated>2019-02-25T11:58:35Z</updated>

		<summary type="html">&lt;p&gt;Ivand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== FBO ==&lt;br /&gt;
== FBO ==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateFBO&#039;&#039;&#039;&lt;br /&gt;
  ( [ table initialization ] ) -&amp;gt; userdata [[Lua_FBO#Userdata_FBO|fbo]]&lt;br /&gt;
&amp;lt;font color=darkgreen&amp;gt;&lt;br /&gt;
  initialization table can contain:&lt;br /&gt;
&lt;br /&gt;
    attachment ::= luaTex or RBO or nil or { luaTex [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ] ] }&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
      depth   = attachment,&lt;br /&gt;
      stencil = attachment,&lt;br /&gt;
      color0  = attachment,&lt;br /&gt;
      color1  = attachment,&lt;br /&gt;
      color2  = attachment,&lt;br /&gt;
      ..&lt;br /&gt;
      color15 = attachment,&lt;br /&gt;
      drawbuffers = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(This doesn&#039;t delete the attached objects!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.IsValidFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] ) -&amp;gt; boolean valid [, number [[Lua_ConstGL#FBO_Status|status]] ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] [, boolean identities ] , lua_function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeSetFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(Binds a FBO like gl.ActiveFBO() does, but you have to unbind it yourself!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default screenbuffer)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RawBindFBO&#039;&#039;&#039; &amp;lt;font color=darkblue&amp;gt; (Replaces UnsafeSetFBO starting from 104.0.1-1003-gb3e02a6 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] [, number rawFboId = 0] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default or specified via rawFboId numeric id of FBO)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; number previouslyBoundRawFboId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlitFBO&#039;&#039;&#039; &amp;lt;font color=red&amp;gt;needs GLEW_EXT_framebuffer_blit&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  ( fboSrc , int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    fboDst , int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Userdata FBO===&lt;br /&gt;
   &amp;lt;font color=darkgreen&amp;gt;attachment ::= luaTex or RBO or nil or { luaTex or RBO [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ]] }&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  write-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;fbo.depth&#039;&#039;&#039;   = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.stencil&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.color0&#039;&#039;&#039;  = attachment&lt;br /&gt;
     ..&lt;br /&gt;
    &#039;&#039;&#039;fbo.color15&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.drawbuffers&#039;&#039;&#039; = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    &#039;&#039;&#039;fbo.readbuffer&#039;&#039;&#039;  = GL_COLOR_ATTACHMENT0_EXT&lt;br /&gt;
&lt;br /&gt;
==RBO==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateRBO&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
    [ {&lt;br /&gt;
      target = GL_RENDERBUFFER_EXT,&lt;br /&gt;
      format = [[Lua_ConstGL#RBO_Formats|GL_RGBA]],&lt;br /&gt;
      [samples = number], &amp;lt;font color=darkblue&amp;gt; any number here will result in creation of multisampled RBO (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    } ]) -&amp;gt; userdata [[Lua_FBO#Userdata_RBO|rbo]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteRBO&#039;&#039;&#039;&lt;br /&gt;
  ( rbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
===Userdata RBO===&lt;br /&gt;
  read-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;rbo.target&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.format&#039;&#039;&#039;  = [[Lua_ConstGL#RBO_Formats|number]]&lt;br /&gt;
    &#039;&#039;&#039;rbo.xsize&#039;&#039;&#039;   = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.ysize&#039;&#039;&#039;   = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.valid&#039;&#039;&#039;   = boolean&lt;br /&gt;
    &#039;&#039;&#039;rbo.samples&#039;&#039;&#039; = number &amp;lt;font color=darkblue&amp;gt; will return globalRendering-&amp;gt;msaaLevel for multisampled RBO or 0 otherwise (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11513</id>
		<title>Lua OpenGL Api</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11513"/>
		<updated>2019-02-19T01:27:25Z</updated>

		<summary type="html">&lt;p&gt;Ivand: Clip control info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
= Spring =&lt;br /&gt;
&#039;&#039;&#039;gl.GetSun&#039;&#039;&#039;&lt;br /&gt;
  &amp;lt;font style=&amp;quot;font-size:90%&amp;quot;&amp;gt;()        -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;pos&amp;quot; ) -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;shadowDensity&amp;quot; [, &amp;quot;unit&amp;quot;] ) -&amp;gt; number shadowDensity&lt;br /&gt;
  ( &amp;quot;diffuse&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;ambient&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;specular&amp;quot;      [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetAtmosphere&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Sun|Spring.SetAtmosphere]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetWaterRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | string texName | number scalar | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetWaterParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMapRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetMapRenderingParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigScreen&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;used for Unit LODs&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number screenWidth, number screenDistance ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawMiniMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;argument new in 0.82+&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;boolean tansform = true&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SlaveMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( boolean mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( int px, int py, int sx, int sy ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetViewSizes&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number x, number y&lt;br /&gt;
&lt;br /&gt;
= Matrices &amp;amp; Viewport =&lt;br /&gt;
&#039;&#039;&#039;gl.Viewport&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;&#039;gl.Translate&#039;&#039;&#039;&lt;br /&gt;
  (number x, number y, number z) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scale&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rotate&#039;&#039;&#039;&lt;br /&gt;
  ( number angle, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Billboard&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Use this to draw 2d primitives in DrawWorld().&lt;br /&gt;
To render a 2D billboarded quad in the gameworld at world position x,y,z, you do the following (at a minimum; I am skipping blending / depthtesting) here:&lt;br /&gt;
  gl.PushMatrix()&lt;br /&gt;
  gl.Texture(read what you need here)&lt;br /&gt;
  gl.Translate(x,y,z)&lt;br /&gt;
  gl.Billboard()			&lt;br /&gt;
  gl.TexRect(x1,y1,x2,y2)&lt;br /&gt;
  gl.PopMatrix()&amp;lt;/span &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MatrixMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#MatrixMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadIdentity&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( 16 numbers or a [https://github.com/spring/spring/blob/develop/rts/Lua/LuaOpenGLUtils.cpp#L60 matrix name] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Ortho&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Frustum&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushPopMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ClipPlane&#039;&#039;&#039;&lt;br /&gt;
  ( int plane, &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: $plane can only be 1 or 2&amp;lt;/font&amp;gt;&lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number A, number B, number C, number D ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Clear =&lt;br /&gt;
&#039;&#039;&#039;gl.Clear&#039;&#039;&#039;&lt;br /&gt;
  ( GL.DEPTH_BUFFER_BIT [, number cleardepth] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.STENCIL_BUFFER_BIT [, int clearstencil] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.COLOR_BUFFER_BIT | GL.ACCUM_BUFFER_BIT [, number r, number g, number b, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SwapBuffers&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Available only in LuaMenu, meant for frame-limited LuaMenu&#039;s that want identical content in both buffers.&lt;br /&gt;
&lt;br /&gt;
= ResetState/Matrices =&lt;br /&gt;
&#039;&#039;&#039;gl.ResetState&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;DON&#039;T USE IT UNLESS YOU KNOW WHAT YOU ARE DOING! Each call-in has different default states, but this function resets all states to the states below no matter what!&amp;lt;/span&amp;gt;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  ShadeModel = GL.SMOOTH&lt;br /&gt;
  Scissor    = false&lt;br /&gt;
  Texture    = false&lt;br /&gt;
  Lighting    = false,&lt;br /&gt;
  ColorMask  = true, true, true, true&lt;br /&gt;
  DepthMask  = false&lt;br /&gt;
  DepthTest  = false  (GL.LEQUAL)&lt;br /&gt;
  Culling    = false  (GL.BACK)&lt;br /&gt;
  LogicOp    = false  (GL.INVERT)&lt;br /&gt;
  AlphaTest  = false  (GL.GREATER, 0.5f)&lt;br /&gt;
  Blending   = true (GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA)&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ResetMatrices&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  Resets GL.TEXTURE matrix stack&lt;br /&gt;
  Resets GL.MODELVIEW matrix stack&lt;br /&gt;
  Resets GL.PROJECTION matrix stack&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Draw Basics =&lt;br /&gt;
&#039;&#039;&#039;gl.BeginEnd&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Drawing_Primitives|GLType]], function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Color&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b[, number a] } |&lt;br /&gt;
      number r, number g, number b[, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Vertex&#039;&#039;&#039;&lt;br /&gt;
  ( { number x, number y [, number z [, number w ]] } |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Normal&#039;&#039;&#039;&lt;br /&gt;
  (  number x, number y, number z |&lt;br /&gt;
   { number x, number y, number z } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rect&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexRect&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;texture rect&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2,&lt;br /&gt;
  [ boolean flip_s, boolean flip_t | number s1, number t1, number s2, number t2 ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Shape&#039;&#039;&#039;&lt;br /&gt;
 ( number [[Lua_ConstGL#Drawing_Primitives|GLtype]],&lt;br /&gt;
   elements = {&lt;br /&gt;
     [1] = { v | vertex   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;required&amp;lt;/font&amp;gt;&lt;br /&gt;
             n | normal   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             t | texcoord = { number x, number y },                     &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             c | color    = { number r, number g, number b, number a }  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
     },&lt;br /&gt;
     etc ...&lt;br /&gt;
   }&lt;br /&gt;
 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SecondaryColor&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b } |&lt;br /&gt;
      number r, number g, number b ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FogCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Display Lists =&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Display Lists save given vertex attributes in a static buffer, so the GPU can directly read them (without the CPU). Display Lists are a lot faster (10-60x) than standard drawing with glShape/glBeginEnd, so try to use them when ever you can. If you want to learn more about them, g00gle is your friend ;)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateList&#039;&#039;&#039;&lt;br /&gt;
  ( function [,arg1 [,arg2...]] ) -&amp;gt; number listID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CallList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Text =&lt;br /&gt;
&#039;&#039;&#039;gl.Text&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;, number x, number y, number size [, string &amp;lt;span class=note&amp;gt;&amp;quot;options&amp;quot;&amp;lt;/span&amp;gt;] )&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
  options are:&lt;br /&gt;
    horizontal alignment:&lt;br /&gt;
       &#039;c&#039; = center&lt;br /&gt;
       &#039;r&#039; = right&lt;br /&gt;
    vertical alignment:&lt;br /&gt;
       &#039;a&#039; = ascender&lt;br /&gt;
       &#039;t&#039; = top&lt;br /&gt;
       &#039;v&#039; = vertical center&lt;br /&gt;
       &#039;x&#039; = baseline&lt;br /&gt;
       &#039;b&#039; = bottom&lt;br /&gt;
       &#039;d&#039; = descender&lt;br /&gt;
    decorations:&lt;br /&gt;
       &#039;o&#039; = black outline&lt;br /&gt;
       &#039;O&#039; = white outline&lt;br /&gt;
       &#039;s&#039; = shadow&lt;br /&gt;
    other:&lt;br /&gt;
       &#039;n&#039; = don&#039;t round vertex coords to nearest integer (font may get blurry)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
http://home.arcor.de/jkei/fontlines.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextWidth&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;) -&amp;gt; number width  &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextHeight&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;text&amp;quot; ) -&amp;gt; nil | number height, number descender, number numlines &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;further descriptions here: [[GetTextHeight]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&amp;lt;b&amp;gt;If you have multiple gl.Text calls, then you can bunch them between a gl.BeginText and gl.EndText to speedup the rendering.&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;gl.BeginText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.EndText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Unit/Feature Draw Functions =&lt;br /&gt;
&#039;&#039;&#039;gl.Unit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws an unit; on default it uses LOD, with lod&amp;lt;0 it is turned off, else it defines a specific level)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitRaw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(doesn&#039;t apply worldspace-&amp;gt;unit transformation! only works if &amp;lt;i&amp;gt;rawdraw&amp;lt;/i&amp;gt; is true )&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShape&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID, number teamID, bool rawState, bool toScreen, bool opaque ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|101.0}} The three extra boolean arguments make it so that calling only these functions is enough to get correctly rendered models; pass in &#039;false&#039; for the THIRD argument to get the fixed behavior, omit it or pass in &#039;true&#039; [default] to render with your own custom state instead. The FOURTH argument should be &#039;true&#039; if in DrawScreen and &#039;false&#039; (default) if in DrawWorld; any transforms for these two functions *MUST* include a gl.LoadIdentity call when argument #3 is false (whether they are used in DrawWorld or in DrawScreen) the FIFTH argument determines whether the model is drawn opaque (&#039;true&#039; [default]) or with translucency (&#039;false&#039;); only has an effect when argument #3 is false.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; unit space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(unit space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPiece&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the unit piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.UnitPieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Feature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureRaw&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShape&#039;&#039;&#039;&lt;br /&gt;
  ( number featureDefID, number teamID, bool custom, bool drawScreen, bool opaque  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; feature space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(feature space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePiece&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the Feature piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.FeaturePieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawListAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number listID, [ boolean midPos,&lt;br /&gt;
      number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
      number degrees, number rotX, number rotX, number rotZ ] ) -&amp;gt; nil &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawFuncAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean midPos, function [, arg1,... ]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= States (Blending,AlphaTest...) =&lt;br /&gt;
&#039;&#039;&#039;gl.Blending&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
  ( string &amp;lt;span class=note&amp;gt;mode&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99&amp;quot; | mode maybe:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.ONE, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha_add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;reset&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;color&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_COLOR, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;modulate&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.DST_COLOR, GL.ZERO&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;disable&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquation&#039;&#039;&#039;&lt;br /&gt;
  ( number mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquationSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number modeRGB, number modeAlpha ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcRGB]], number [[Lua_ConstGL#BlendingFactorDest|dstRGB]],  number [[Lua_ConstGL#BlendingFactorSrc|srcAlpha]], number [[Lua_ConstGL#BlendingFactorDest|dstAlpha]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.AlphaTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]], number threshold ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Culling&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#Culling|face]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthClamp&#039;&#039;&#039;  &amp;lt;span class=warning&amp;gt;not always available, needs GL.NV_depth_clamp!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ColorMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( boolean r, boolean g, boolean b, boolean a ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LogicOp&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#LogicOp|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Fog&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Smoothing&#039;&#039;&#039; {{removed|104.0}}&lt;br /&gt;
 ( (boolean enable | number POINT), &lt;br /&gt;
   (boolean enable | number LINE),&lt;br /&gt;
   (boolean enable | number POLYGON) ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
 ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scissor&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( int x, int y, int w, int h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LineStipple&#039;&#039;&#039;&lt;br /&gt;
  ( string any ) -&amp;gt; nil &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(use springs default line stipple)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
  ( int factor, number pattern ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number [[Lua_ConstGL#PolygonMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonOffset&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number factor, number units ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushAttrib&#039;&#039;&#039;&lt;br /&gt;
  ( [ number [[Lua_ConstGL#glPushAttrib.28.29_bits|attrib]] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopAttrib&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Stencil =&lt;br /&gt;
&#039;&#039;&#039;gl.StencilTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMask&#039;&#039;&#039;&lt;br /&gt;
  ( number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOp&#039;&#039;&#039;&lt;br /&gt;
  ( number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMaskSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOpSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= LineWidth &amp;amp; PointSize =&lt;br /&gt;
&#039;&#039;&#039;gl.LineWidth&#039;&#039;&#039;&lt;br /&gt;
  ( number width ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSize&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(values != 1 can break severely on ATI cards, see http://springrts.com/mantis/view.php?id=2390)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number size ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSprite&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable, [boolean coord_replace, boolean coord_origin_upper] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointParameter&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number v1, number v2, number v3, &lt;br /&gt;
    [ number sizeMin, number sizeMax, number sizeFade ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Textures =&lt;br /&gt;
&#039;&#039;&#039;gl.Texture&#039;&#039;&#039;&lt;br /&gt;
  ( [ number texNum, ] boolean enable | string &amp;lt;span class=note&amp;gt;name&amp;lt;/span&amp;gt; ) -&amp;gt; nil | boolean loaded&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;This is the only call-out that is needed to load and draw any texture in a Lua script. All you have to do is pass it a valid path to a valid png and it will use that image for drawing any subsequent textured rectangles. This is shown in the last line of the following list of valid strings for the name parameter.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99; text-align:left&amp;quot; |`name` may be:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | #12&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 12 buildpic&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %34:1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 34 s3o tex2 (:0-&amp;gt;tex1,:1-&amp;gt;tex2)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %-102:0&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = featureDef 102 s3o tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | !56&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = lua generated texture 56 (= return value of gl.CreateTexture)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units2&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shadow&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = shadowmap&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = specular cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(removed in the latest develop)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $reflection &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = reflection cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(can be mipmaped starting from 104.0.1-714-ga29177f. Set CubeTexGenerateMipMaps=1 in settings)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shading&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = ground shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $grass&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = grass shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $heightmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = heightmap (needs HeightMapTexture=1 set in spring config)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $minimap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = minimap texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = same as &amp;quot;$reflection&amp;quot; {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $sky_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = defined for SSMF maps that have a skyReflectModTex {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = auto generated normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF specular texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_distr&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat distribution texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat normals texture {{new|101.0}}, used as &amp;quot;$ssmf_splat_normals&amp;quot; or &amp;quot;$ssmf_splat_normals:X&amp;quot;, &#039;X&#039; can be a value between 0 and 3, defaults to 0 if &amp;quot;:X&amp;quot; is omitted&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_emission&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF emission texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_parallax&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF parallax texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = currently active info texture (los, airlos, radar, jammer)&amp;lt;br/&amp;gt; Note that textures contain no data until user switches to their respective modes and non-active textures are not updated in the background, so will go stale&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_losmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = los texture (L-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_mtlmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = metal map texture (F4-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_hgtmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = height map texture (F1-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_blkmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = blocking map texture (F2-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the map in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the map in view. {{new|95}} &amp;lt;br/&amp;gt;To translate this to world position coordinates, use:&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;No clip control / clipspace for depth is [-1,1]&#039;&#039;&#039;&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(vec3(gl_TexCoord[0].st, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x) * 2.0 - 1.0, 1.0);&lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;Default if clip control is supported / clipspace for depth is [0,1].&#039;&#039;&#039;&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(gl_TexCoord[0].st * 2.0 - 1.0, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x, 1.0);&lt;br /&gt;
&lt;br /&gt;
  worldpos.xyz = worldpos.xyz / worldpos.w; &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the models in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the models in view.  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | ${opt}:/LuaUI/images/image.png &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = load a texture from the VFS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
   possible ${opt}&#039;s are:&lt;br /&gt;
      &#039;n&#039; = nearest&lt;br /&gt;
      &#039;l&#039; = linear&lt;br /&gt;
      &#039;a&#039; = aniso&lt;br /&gt;
      &#039;i&#039; = invert&lt;br /&gt;
      &#039;g&#039; = greyed&lt;br /&gt;
      &#039;c&#039; = clamped&lt;br /&gt;
      &#039;b&#039; = border&lt;br /&gt;
      &#039;t%r,%g,%b&#039; = tint&lt;br /&gt;
      &#039;r%width,%height&#039; = resize&lt;br /&gt;
   The above ${opt}&#039;s are NOT available for .DDS textures! .dds will load faster than other image formats.&lt;br /&gt;
&lt;br /&gt;
    example: &amp;quot;:iac:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example: &amp;quot;:cr16,16:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example2: &amp;quot;:t1.0,0.5,0:/LuaUI/images/image.png&amp;quot;  (orange tint)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
  [ { &lt;br /&gt;
    [target     = number,] &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(like GL.TEXTURE_1D,GL.TEXTURE_2D,...)&amp;lt;/font&amp;gt; &amp;lt;font color=darkblue&amp;gt; (Added support for GL_TEXTURE_2D_MULTISAMPLE in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [format     = number,]&lt;br /&gt;
    [min_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [mag_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [wrap_s     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_t     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_r     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [aniso      = number,]&lt;br /&gt;
    [border     = boolean,]&lt;br /&gt;
    [fbo        = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [fboDepth   = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [samples    = number,] &amp;lt;font color=darkblue&amp;gt; specify any number here and target = GL_TEXTURE_2D_MULTISAMPLE to create multisample texture (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  } ]&lt;br /&gt;
  ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTexture&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTextureFBO&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TextureInfo&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; nil | {&lt;br /&gt;
      xsize = number,&lt;br /&gt;
      ysize = number,&lt;br /&gt;
      alpha = boolean, //not used yet&lt;br /&gt;
      type  = number,  //not used yet&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
   the format of the texture string is the same as in gl.Texture()&lt;br /&gt;
&amp;lt;/font&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number x | &lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum,&lt;br /&gt;
    number x |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexGen&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexGen&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil       &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CopyToTexture&#039;&#039;&#039;&lt;br /&gt;
  (string texture, int xoff, int yoff, int x, int y, int w, int h &lt;br /&gt;
  [,number target,number level])-&amp;gt;nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderToTexture&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string fbotexture, lua_func ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GenerateMipmap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs glGenerateMipmapEXT!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
The following are primarily intended to be used in conjunction with&lt;br /&gt;
     gl.{Unit,Feature}(objID, ..., raw=true)&lt;br /&gt;
     gl.{Unit,Feature}Shape(defID, ..., raw=true)&lt;br /&gt;
and apply a model&#039;s default textures; easier than gl.Texture(&amp;quot;$%...&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
= PixelReadback =&lt;br /&gt;
&#039;&#039;&#039;gl.SaveImage&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h,&lt;br /&gt;
    string filename [, table {alpha=boolean, yflip=boolean, grayscale16bit=boolean} ] ) -&amp;gt; nil | boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;grayscale16bit is {{new|99.0}} and allows to save single color 16bit PNG&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ReadPixels&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h [, number format = GL.RGBA ] )&lt;br /&gt;
    -&amp;gt; nil &lt;br /&gt;
    | number r,[g,[b,[a]]] &lt;br /&gt;
    | table { { {1 = number r, 2 = number g, 3 = number b, 4 = number a}, ... }, ... }&lt;br /&gt;
&lt;br /&gt;
= Lights =&lt;br /&gt;
&#039;&#039;&#039;gl.Lighting&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ShadeModel&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#ShadeModel|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Light&#039;&#039;&#039;&lt;br /&gt;
  ( int light, &lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param1, number param2, number param3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Material&#039;&#039;&#039;&lt;br /&gt;
  ({&lt;br /&gt;
    ambient   = {number r, number g, number b[, number a]},&lt;br /&gt;
    diffuse   = {number r, number g, number b[, number a]},&lt;br /&gt;
    ambidiff  = {number r, number g, number b[, number a]},&lt;br /&gt;
    emission  = {number r, number g, number b[, number a]},&lt;br /&gt;
    specular  = {number r, number g, number b[, number a]},&lt;br /&gt;
    shininess = number specularExponent&lt;br /&gt;
  }) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Hardware relevant =&lt;br /&gt;
&#039;&#039;&#039;gl.HasExtension&#039;&#039;&#039;&lt;br /&gt;
  ( string extname ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetNumber&#039;&#039;&#039;&lt;br /&gt;
  ( number ext, int count ) -&amp;gt; number [, number, number, ... #count ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetString&#039;&#039;&#039;&lt;br /&gt;
  ( number ext ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= DrawGroundPrimitives =&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundCircle&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z, number radius, number divs [, number slope ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: number divs is the number of sides the circle will have. the higher the smoother the circle (and more GPU intensive) &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundQuad&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: x1,z1,x2 &amp;amp; z2 are rounded, so don&#039;t use it for very small or moving objects. x and z are correspond to the coordinates displayed by the tooltip &amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number z1, number x2, number z2,&lt;br /&gt;
    [ boolean useNorm, &amp;lt;span class=warning&amp;gt;(does nothing!)&amp;lt;/span&amp;gt;&lt;br /&gt;
      [ number tu1, number tv1, number tu2, number tv2 |&lt;br /&gt;
        boolean useTextureCoord ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Queries =&lt;br /&gt;
&#039;&#039;&#039;gl.CreateQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; nil | userdata query&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.RunQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query, function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.GetQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil | number renderedFragments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Extended =&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexNames&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; { [1] = string texture, etc ... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexCoords&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;gets the texcoord of a 3do texture in the 3do texture atlas&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string 3doTextureName ) -&amp;gt; number xstart, number ystart, number xend, number yend&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeState&#039;&#039;&#039;&lt;br /&gt;
  ( number state [, boolean disable_state ], function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Calls glEnable(state) or glDisable(state) (if disable_state==true) and&amp;lt;br&amp;gt;then calls the lua_function and afterwards reverts the state.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetShadowMapParams&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; number xmid, number ymid, number p17, number p18&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMatrixData&#039;&#039;&#039;&lt;br /&gt;
  ( GL.PROJECTION [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( GL.MODELVIEW  [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i] &lt;br /&gt;
  ( GL.TEXTURE    [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( &amp;quot;shadow&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camera&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;caminv&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camprj&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;billboard&amp;quot; )             -&amp;gt; nil | number, etc.. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Flush&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Finish&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Shaders (GLSL) =&lt;br /&gt;
  [[Lua_GLSL_Api]]&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11512</id>
		<title>Lua OpenGL Api</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11512"/>
		<updated>2019-02-17T19:31:03Z</updated>

		<summary type="html">&lt;p&gt;Ivand: /* Textures */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
= Spring =&lt;br /&gt;
&#039;&#039;&#039;gl.GetSun&#039;&#039;&#039;&lt;br /&gt;
  &amp;lt;font style=&amp;quot;font-size:90%&amp;quot;&amp;gt;()        -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;pos&amp;quot; ) -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;shadowDensity&amp;quot; [, &amp;quot;unit&amp;quot;] ) -&amp;gt; number shadowDensity&lt;br /&gt;
  ( &amp;quot;diffuse&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;ambient&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;specular&amp;quot;      [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetAtmosphere&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Sun|Spring.SetAtmosphere]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetWaterRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | string texName | number scalar | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetWaterParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMapRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetMapRenderingParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigScreen&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;used for Unit LODs&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number screenWidth, number screenDistance ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawMiniMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;argument new in 0.82+&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;boolean tansform = true&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SlaveMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( boolean mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( int px, int py, int sx, int sy ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetViewSizes&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number x, number y&lt;br /&gt;
&lt;br /&gt;
= Matrices &amp;amp; Viewport =&lt;br /&gt;
&#039;&#039;&#039;gl.Viewport&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;&#039;gl.Translate&#039;&#039;&#039;&lt;br /&gt;
  (number x, number y, number z) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scale&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rotate&#039;&#039;&#039;&lt;br /&gt;
  ( number angle, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Billboard&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Use this to draw 2d primitives in DrawWorld().&lt;br /&gt;
To render a 2D billboarded quad in the gameworld at world position x,y,z, you do the following (at a minimum; I am skipping blending / depthtesting) here:&lt;br /&gt;
  gl.PushMatrix()&lt;br /&gt;
  gl.Texture(read what you need here)&lt;br /&gt;
  gl.Translate(x,y,z)&lt;br /&gt;
  gl.Billboard()			&lt;br /&gt;
  gl.TexRect(x1,y1,x2,y2)&lt;br /&gt;
  gl.PopMatrix()&amp;lt;/span &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MatrixMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#MatrixMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadIdentity&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( 16 numbers or a [https://github.com/spring/spring/blob/develop/rts/Lua/LuaOpenGLUtils.cpp#L60 matrix name] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Ortho&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Frustum&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushPopMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ClipPlane&#039;&#039;&#039;&lt;br /&gt;
  ( int plane, &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: $plane can only be 1 or 2&amp;lt;/font&amp;gt;&lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number A, number B, number C, number D ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Clear =&lt;br /&gt;
&#039;&#039;&#039;gl.Clear&#039;&#039;&#039;&lt;br /&gt;
  ( GL.DEPTH_BUFFER_BIT [, number cleardepth] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.STENCIL_BUFFER_BIT [, int clearstencil] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.COLOR_BUFFER_BIT | GL.ACCUM_BUFFER_BIT [, number r, number g, number b, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SwapBuffers&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Available only in LuaMenu, meant for frame-limited LuaMenu&#039;s that want identical content in both buffers.&lt;br /&gt;
&lt;br /&gt;
= ResetState/Matrices =&lt;br /&gt;
&#039;&#039;&#039;gl.ResetState&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;DON&#039;T USE IT UNLESS YOU KNOW WHAT YOU ARE DOING! Each call-in has different default states, but this function resets all states to the states below no matter what!&amp;lt;/span&amp;gt;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  ShadeModel = GL.SMOOTH&lt;br /&gt;
  Scissor    = false&lt;br /&gt;
  Texture    = false&lt;br /&gt;
  Lighting    = false,&lt;br /&gt;
  ColorMask  = true, true, true, true&lt;br /&gt;
  DepthMask  = false&lt;br /&gt;
  DepthTest  = false  (GL.LEQUAL)&lt;br /&gt;
  Culling    = false  (GL.BACK)&lt;br /&gt;
  LogicOp    = false  (GL.INVERT)&lt;br /&gt;
  AlphaTest  = false  (GL.GREATER, 0.5f)&lt;br /&gt;
  Blending   = true (GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA)&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ResetMatrices&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  Resets GL.TEXTURE matrix stack&lt;br /&gt;
  Resets GL.MODELVIEW matrix stack&lt;br /&gt;
  Resets GL.PROJECTION matrix stack&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Draw Basics =&lt;br /&gt;
&#039;&#039;&#039;gl.BeginEnd&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Drawing_Primitives|GLType]], function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Color&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b[, number a] } |&lt;br /&gt;
      number r, number g, number b[, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Vertex&#039;&#039;&#039;&lt;br /&gt;
  ( { number x, number y [, number z [, number w ]] } |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Normal&#039;&#039;&#039;&lt;br /&gt;
  (  number x, number y, number z |&lt;br /&gt;
   { number x, number y, number z } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rect&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexRect&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;texture rect&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2,&lt;br /&gt;
  [ boolean flip_s, boolean flip_t | number s1, number t1, number s2, number t2 ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Shape&#039;&#039;&#039;&lt;br /&gt;
 ( number [[Lua_ConstGL#Drawing_Primitives|GLtype]],&lt;br /&gt;
   elements = {&lt;br /&gt;
     [1] = { v | vertex   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;required&amp;lt;/font&amp;gt;&lt;br /&gt;
             n | normal   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             t | texcoord = { number x, number y },                     &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             c | color    = { number r, number g, number b, number a }  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
     },&lt;br /&gt;
     etc ...&lt;br /&gt;
   }&lt;br /&gt;
 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SecondaryColor&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b } |&lt;br /&gt;
      number r, number g, number b ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FogCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Display Lists =&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Display Lists save given vertex attributes in a static buffer, so the GPU can directly read them (without the CPU). Display Lists are a lot faster (10-60x) than standard drawing with glShape/glBeginEnd, so try to use them when ever you can. If you want to learn more about them, g00gle is your friend ;)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateList&#039;&#039;&#039;&lt;br /&gt;
  ( function [,arg1 [,arg2...]] ) -&amp;gt; number listID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CallList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Text =&lt;br /&gt;
&#039;&#039;&#039;gl.Text&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;, number x, number y, number size [, string &amp;lt;span class=note&amp;gt;&amp;quot;options&amp;quot;&amp;lt;/span&amp;gt;] )&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
  options are:&lt;br /&gt;
    horizontal alignment:&lt;br /&gt;
       &#039;c&#039; = center&lt;br /&gt;
       &#039;r&#039; = right&lt;br /&gt;
    vertical alignment:&lt;br /&gt;
       &#039;a&#039; = ascender&lt;br /&gt;
       &#039;t&#039; = top&lt;br /&gt;
       &#039;v&#039; = vertical center&lt;br /&gt;
       &#039;x&#039; = baseline&lt;br /&gt;
       &#039;b&#039; = bottom&lt;br /&gt;
       &#039;d&#039; = descender&lt;br /&gt;
    decorations:&lt;br /&gt;
       &#039;o&#039; = black outline&lt;br /&gt;
       &#039;O&#039; = white outline&lt;br /&gt;
       &#039;s&#039; = shadow&lt;br /&gt;
    other:&lt;br /&gt;
       &#039;n&#039; = don&#039;t round vertex coords to nearest integer (font may get blurry)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
http://home.arcor.de/jkei/fontlines.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextWidth&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;) -&amp;gt; number width  &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextHeight&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;text&amp;quot; ) -&amp;gt; nil | number height, number descender, number numlines &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;further descriptions here: [[GetTextHeight]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&amp;lt;b&amp;gt;If you have multiple gl.Text calls, then you can bunch them between a gl.BeginText and gl.EndText to speedup the rendering.&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;gl.BeginText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.EndText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Unit/Feature Draw Functions =&lt;br /&gt;
&#039;&#039;&#039;gl.Unit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws an unit; on default it uses LOD, with lod&amp;lt;0 it is turned off, else it defines a specific level)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitRaw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(doesn&#039;t apply worldspace-&amp;gt;unit transformation! only works if &amp;lt;i&amp;gt;rawdraw&amp;lt;/i&amp;gt; is true )&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShape&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID, number teamID, bool rawState, bool toScreen, bool opaque ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|101.0}} The three extra boolean arguments make it so that calling only these functions is enough to get correctly rendered models; pass in &#039;false&#039; for the THIRD argument to get the fixed behavior, omit it or pass in &#039;true&#039; [default] to render with your own custom state instead. The FOURTH argument should be &#039;true&#039; if in DrawScreen and &#039;false&#039; (default) if in DrawWorld; any transforms for these two functions *MUST* include a gl.LoadIdentity call when argument #3 is false (whether they are used in DrawWorld or in DrawScreen) the FIFTH argument determines whether the model is drawn opaque (&#039;true&#039; [default]) or with translucency (&#039;false&#039;); only has an effect when argument #3 is false.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; unit space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(unit space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPiece&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the unit piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.UnitPieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Feature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureRaw&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShape&#039;&#039;&#039;&lt;br /&gt;
  ( number featureDefID, number teamID, bool custom, bool drawScreen, bool opaque  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; feature space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(feature space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePiece&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the Feature piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.FeaturePieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawListAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number listID, [ boolean midPos,&lt;br /&gt;
      number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
      number degrees, number rotX, number rotX, number rotZ ] ) -&amp;gt; nil &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawFuncAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean midPos, function [, arg1,... ]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= States (Blending,AlphaTest...) =&lt;br /&gt;
&#039;&#039;&#039;gl.Blending&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
  ( string &amp;lt;span class=note&amp;gt;mode&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99&amp;quot; | mode maybe:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.ONE, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha_add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;reset&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;color&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_COLOR, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;modulate&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.DST_COLOR, GL.ZERO&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;disable&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquation&#039;&#039;&#039;&lt;br /&gt;
  ( number mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquationSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number modeRGB, number modeAlpha ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcRGB]], number [[Lua_ConstGL#BlendingFactorDest|dstRGB]],  number [[Lua_ConstGL#BlendingFactorSrc|srcAlpha]], number [[Lua_ConstGL#BlendingFactorDest|dstAlpha]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.AlphaTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]], number threshold ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Culling&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#Culling|face]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthClamp&#039;&#039;&#039;  &amp;lt;span class=warning&amp;gt;not always available, needs GL.NV_depth_clamp!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ColorMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( boolean r, boolean g, boolean b, boolean a ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LogicOp&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#LogicOp|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Fog&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Smoothing&#039;&#039;&#039; {{removed|104.0}}&lt;br /&gt;
 ( (boolean enable | number POINT), &lt;br /&gt;
   (boolean enable | number LINE),&lt;br /&gt;
   (boolean enable | number POLYGON) ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
 ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scissor&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( int x, int y, int w, int h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LineStipple&#039;&#039;&#039;&lt;br /&gt;
  ( string any ) -&amp;gt; nil &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(use springs default line stipple)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
  ( int factor, number pattern ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number [[Lua_ConstGL#PolygonMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonOffset&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number factor, number units ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushAttrib&#039;&#039;&#039;&lt;br /&gt;
  ( [ number [[Lua_ConstGL#glPushAttrib.28.29_bits|attrib]] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopAttrib&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Stencil =&lt;br /&gt;
&#039;&#039;&#039;gl.StencilTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMask&#039;&#039;&#039;&lt;br /&gt;
  ( number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOp&#039;&#039;&#039;&lt;br /&gt;
  ( number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMaskSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOpSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= LineWidth &amp;amp; PointSize =&lt;br /&gt;
&#039;&#039;&#039;gl.LineWidth&#039;&#039;&#039;&lt;br /&gt;
  ( number width ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSize&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(values != 1 can break severely on ATI cards, see http://springrts.com/mantis/view.php?id=2390)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number size ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSprite&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable, [boolean coord_replace, boolean coord_origin_upper] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointParameter&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number v1, number v2, number v3, &lt;br /&gt;
    [ number sizeMin, number sizeMax, number sizeFade ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Textures =&lt;br /&gt;
&#039;&#039;&#039;gl.Texture&#039;&#039;&#039;&lt;br /&gt;
  ( [ number texNum, ] boolean enable | string &amp;lt;span class=note&amp;gt;name&amp;lt;/span&amp;gt; ) -&amp;gt; nil | boolean loaded&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;This is the only call-out that is needed to load and draw any texture in a Lua script. All you have to do is pass it a valid path to a valid png and it will use that image for drawing any subsequent textured rectangles. This is shown in the last line of the following list of valid strings for the name parameter.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99; text-align:left&amp;quot; |`name` may be:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | #12&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 12 buildpic&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %34:1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 34 s3o tex2 (:0-&amp;gt;tex1,:1-&amp;gt;tex2)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %-102:0&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = featureDef 102 s3o tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | !56&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = lua generated texture 56 (= return value of gl.CreateTexture)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units2&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shadow&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = shadowmap&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = specular cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(removed in the latest develop)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $reflection &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = reflection cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(can be mipmaped starting from 104.0.1-714-ga29177f. Set CubeTexGenerateMipMaps=1 in settings)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shading&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = ground shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $grass&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = grass shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $heightmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = heightmap (needs HeightMapTexture=1 set in spring config)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $minimap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = minimap texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = same as &amp;quot;$reflection&amp;quot; {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $sky_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = defined for SSMF maps that have a skyReflectModTex {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = auto generated normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF specular texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_distr&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat distribution texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat normals texture {{new|101.0}}, used as &amp;quot;$ssmf_splat_normals&amp;quot; or &amp;quot;$ssmf_splat_normals:X&amp;quot;, &#039;X&#039; can be a value between 0 and 3, defaults to 0 if &amp;quot;:X&amp;quot; is omitted&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_emission&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF emission texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_parallax&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF parallax texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = currently active info texture (los, airlos, radar, jammer)&amp;lt;br/&amp;gt; Note that textures contain no data until user switches to their respective modes and non-active textures are not updated in the background, so will go stale&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_losmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = los texture (L-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_mtlmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = metal map texture (F4-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_hgtmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = height map texture (F1-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_blkmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = blocking map texture (F2-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the map in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the map in view. {{new|95}} &amp;lt;br/&amp;gt;To translate this to world position coordinates, use:&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(vec3(gl_TexCoord[0].st, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x) * 2.0 - 1.0 ,1.0);&lt;br /&gt;
  worldpos.xyz = worldpos.xyz / worldpos.w; &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the models in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the models in view.  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | ${opt}:/LuaUI/images/image.png &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = load a texture from the VFS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
   possible ${opt}&#039;s are:&lt;br /&gt;
      &#039;n&#039; = nearest&lt;br /&gt;
      &#039;l&#039; = linear&lt;br /&gt;
      &#039;a&#039; = aniso&lt;br /&gt;
      &#039;i&#039; = invert&lt;br /&gt;
      &#039;g&#039; = greyed&lt;br /&gt;
      &#039;c&#039; = clamped&lt;br /&gt;
      &#039;b&#039; = border&lt;br /&gt;
      &#039;t%r,%g,%b&#039; = tint&lt;br /&gt;
      &#039;r%width,%height&#039; = resize&lt;br /&gt;
   The above ${opt}&#039;s are NOT available for .DDS textures! .dds will load faster than other image formats.&lt;br /&gt;
&lt;br /&gt;
    example: &amp;quot;:iac:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example: &amp;quot;:cr16,16:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example2: &amp;quot;:t1.0,0.5,0:/LuaUI/images/image.png&amp;quot;  (orange tint)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
  [ { &lt;br /&gt;
    [target     = number,] &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(like GL.TEXTURE_1D,GL.TEXTURE_2D,...)&amp;lt;/font&amp;gt; &amp;lt;font color=darkblue&amp;gt; (Added support for GL_TEXTURE_2D_MULTISAMPLE in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [format     = number,]&lt;br /&gt;
    [min_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [mag_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [wrap_s     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_t     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_r     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [aniso      = number,]&lt;br /&gt;
    [border     = boolean,]&lt;br /&gt;
    [fbo        = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [fboDepth   = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [samples    = number,] &amp;lt;font color=darkblue&amp;gt; specify any number here and target = GL_TEXTURE_2D_MULTISAMPLE to create multisample texture (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  } ]&lt;br /&gt;
  ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTexture&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTextureFBO&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TextureInfo&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; nil | {&lt;br /&gt;
      xsize = number,&lt;br /&gt;
      ysize = number,&lt;br /&gt;
      alpha = boolean, //not used yet&lt;br /&gt;
      type  = number,  //not used yet&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
   the format of the texture string is the same as in gl.Texture()&lt;br /&gt;
&amp;lt;/font&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number x | &lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum,&lt;br /&gt;
    number x |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexGen&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexGen&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil       &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CopyToTexture&#039;&#039;&#039;&lt;br /&gt;
  (string texture, int xoff, int yoff, int x, int y, int w, int h &lt;br /&gt;
  [,number target,number level])-&amp;gt;nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderToTexture&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string fbotexture, lua_func ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GenerateMipmap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs glGenerateMipmapEXT!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
The following are primarily intended to be used in conjunction with&lt;br /&gt;
     gl.{Unit,Feature}(objID, ..., raw=true)&lt;br /&gt;
     gl.{Unit,Feature}Shape(defID, ..., raw=true)&lt;br /&gt;
and apply a model&#039;s default textures; easier than gl.Texture(&amp;quot;$%...&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
= PixelReadback =&lt;br /&gt;
&#039;&#039;&#039;gl.SaveImage&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h,&lt;br /&gt;
    string filename [, table {alpha=boolean, yflip=boolean, grayscale16bit=boolean} ] ) -&amp;gt; nil | boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;grayscale16bit is {{new|99.0}} and allows to save single color 16bit PNG&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ReadPixels&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h [, number format = GL.RGBA ] )&lt;br /&gt;
    -&amp;gt; nil &lt;br /&gt;
    | number r,[g,[b,[a]]] &lt;br /&gt;
    | table { { {1 = number r, 2 = number g, 3 = number b, 4 = number a}, ... }, ... }&lt;br /&gt;
&lt;br /&gt;
= Lights =&lt;br /&gt;
&#039;&#039;&#039;gl.Lighting&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ShadeModel&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#ShadeModel|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Light&#039;&#039;&#039;&lt;br /&gt;
  ( int light, &lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param1, number param2, number param3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Material&#039;&#039;&#039;&lt;br /&gt;
  ({&lt;br /&gt;
    ambient   = {number r, number g, number b[, number a]},&lt;br /&gt;
    diffuse   = {number r, number g, number b[, number a]},&lt;br /&gt;
    ambidiff  = {number r, number g, number b[, number a]},&lt;br /&gt;
    emission  = {number r, number g, number b[, number a]},&lt;br /&gt;
    specular  = {number r, number g, number b[, number a]},&lt;br /&gt;
    shininess = number specularExponent&lt;br /&gt;
  }) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Hardware relevant =&lt;br /&gt;
&#039;&#039;&#039;gl.HasExtension&#039;&#039;&#039;&lt;br /&gt;
  ( string extname ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetNumber&#039;&#039;&#039;&lt;br /&gt;
  ( number ext, int count ) -&amp;gt; number [, number, number, ... #count ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetString&#039;&#039;&#039;&lt;br /&gt;
  ( number ext ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= DrawGroundPrimitives =&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundCircle&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z, number radius, number divs [, number slope ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: number divs is the number of sides the circle will have. the higher the smoother the circle (and more GPU intensive) &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundQuad&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: x1,z1,x2 &amp;amp; z2 are rounded, so don&#039;t use it for very small or moving objects. x and z are correspond to the coordinates displayed by the tooltip &amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number z1, number x2, number z2,&lt;br /&gt;
    [ boolean useNorm, &amp;lt;span class=warning&amp;gt;(does nothing!)&amp;lt;/span&amp;gt;&lt;br /&gt;
      [ number tu1, number tv1, number tu2, number tv2 |&lt;br /&gt;
        boolean useTextureCoord ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Queries =&lt;br /&gt;
&#039;&#039;&#039;gl.CreateQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; nil | userdata query&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.RunQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query, function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.GetQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil | number renderedFragments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Extended =&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexNames&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; { [1] = string texture, etc ... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexCoords&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;gets the texcoord of a 3do texture in the 3do texture atlas&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string 3doTextureName ) -&amp;gt; number xstart, number ystart, number xend, number yend&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeState&#039;&#039;&#039;&lt;br /&gt;
  ( number state [, boolean disable_state ], function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Calls glEnable(state) or glDisable(state) (if disable_state==true) and&amp;lt;br&amp;gt;then calls the lua_function and afterwards reverts the state.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetShadowMapParams&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; number xmid, number ymid, number p17, number p18&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMatrixData&#039;&#039;&#039;&lt;br /&gt;
  ( GL.PROJECTION [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( GL.MODELVIEW  [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i] &lt;br /&gt;
  ( GL.TEXTURE    [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( &amp;quot;shadow&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camera&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;caminv&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camprj&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;billboard&amp;quot; )             -&amp;gt; nil | number, etc.. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Flush&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Finish&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Shaders (GLSL) =&lt;br /&gt;
  [[Lua_GLSL_Api]]&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO_and_RBO&amp;diff=11268</id>
		<title>Lua FBO and RBO</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO_and_RBO&amp;diff=11268"/>
		<updated>2019-02-17T19:30:54Z</updated>

		<summary type="html">&lt;p&gt;Ivand: /* RBO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
== FBO ==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateFBO&#039;&#039;&#039;&lt;br /&gt;
  ( [ table initialization ] ) -&amp;gt; userdata [[Lua_FBO#Userdata_FBO|fbo]]&lt;br /&gt;
&amp;lt;font color=darkgreen&amp;gt;&lt;br /&gt;
  initialization table can contain:&lt;br /&gt;
&lt;br /&gt;
    attachment ::= luaTex or RBO or nil or { luaTex [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ] ] }&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
      depth   = attachment,&lt;br /&gt;
      stencil = attachment,&lt;br /&gt;
      color0  = attachment,&lt;br /&gt;
      color1  = attachment,&lt;br /&gt;
      color2  = attachment,&lt;br /&gt;
      ..&lt;br /&gt;
      color15 = attachment,&lt;br /&gt;
      drawbuffers = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(This doesn&#039;t delete the attached objects!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.IsValidFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] ) -&amp;gt; boolean valid [, number [[Lua_ConstGL#FBO_Status|status]] ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] [, boolean identities ] , lua_function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeSetFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(Binds a FBO like gl.ActiveFBO() does, but you have to unbind it yourself!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default screenbuffer)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RawBindFBO&#039;&#039;&#039; &amp;lt;font color=darkblue&amp;gt; (Replaces UnsafeSetFBO starting from 104.0.1-1003-gb3e02a6 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] [, number rawFboId = 0] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default or specified via rawFboId numeric id of FBO)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; number previouslyBoundRawFboId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlitFBO&#039;&#039;&#039; &amp;lt;font color=red&amp;gt;needs GLEW_EXT_framebuffer_blit&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  ( fboSrc , int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    fboDst , int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Userdata FBO===&lt;br /&gt;
   &amp;lt;font color=darkgreen&amp;gt;attachment ::= luaTex or RBO or nil or { luaTex or RBO [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ]] }&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  write-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;fbo.depth&#039;&#039;&#039;   = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.stencil&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.color0&#039;&#039;&#039;  = attachment&lt;br /&gt;
     ..&lt;br /&gt;
    &#039;&#039;&#039;fbo.color15&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.drawbuffers&#039;&#039;&#039; = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    &#039;&#039;&#039;fbo.readbuffer&#039;&#039;&#039;  = GL_COLOR_ATTACHMENT0_EXT&lt;br /&gt;
&lt;br /&gt;
==RBO==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateRBO&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
    [ {&lt;br /&gt;
      target = GL_RENDERBUFFER_EXT,&lt;br /&gt;
      format = [[Lua_ConstGL#RBO_Formats|GL_RGBA]],&lt;br /&gt;
      [samples = number], &amp;lt;font color=darkblue&amp;gt; any number here will result in creation of multisampled RBO (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    } ]) -&amp;gt; userdata [[Lua_FBO#Userdata_RBO|rbo]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteRBO&#039;&#039;&#039;&lt;br /&gt;
  ( rbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
===Userdata RBO===&lt;br /&gt;
  read-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;rbo.target&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.format&#039;&#039;&#039;  = [[Lua_ConstGL#RBO_Formats|number]]&lt;br /&gt;
    &#039;&#039;&#039;rbo.xsize&#039;&#039;&#039;   = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.ysize&#039;&#039;&#039;   = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.valid&#039;&#039;&#039;   = boolean&lt;br /&gt;
    &#039;&#039;&#039;rbo.samples&#039;&#039;&#039; = number &amp;lt;font color=darkblue&amp;gt; will return globalRendering-&amp;gt;msaaLevel for multisampled RBO or 0 otherwise (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO_and_RBO&amp;diff=11267</id>
		<title>Lua FBO and RBO</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO_and_RBO&amp;diff=11267"/>
		<updated>2019-02-17T18:20:37Z</updated>

		<summary type="html">&lt;p&gt;Ivand: /* Userdata RBO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
== FBO ==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateFBO&#039;&#039;&#039;&lt;br /&gt;
  ( [ table initialization ] ) -&amp;gt; userdata [[Lua_FBO#Userdata_FBO|fbo]]&lt;br /&gt;
&amp;lt;font color=darkgreen&amp;gt;&lt;br /&gt;
  initialization table can contain:&lt;br /&gt;
&lt;br /&gt;
    attachment ::= luaTex or RBO or nil or { luaTex [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ] ] }&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
      depth   = attachment,&lt;br /&gt;
      stencil = attachment,&lt;br /&gt;
      color0  = attachment,&lt;br /&gt;
      color1  = attachment,&lt;br /&gt;
      color2  = attachment,&lt;br /&gt;
      ..&lt;br /&gt;
      color15 = attachment,&lt;br /&gt;
      drawbuffers = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(This doesn&#039;t delete the attached objects!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.IsValidFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] ) -&amp;gt; boolean valid [, number [[Lua_ConstGL#FBO_Status|status]] ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] [, boolean identities ] , lua_function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeSetFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(Binds a FBO like gl.ActiveFBO() does, but you have to unbind it yourself!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default screenbuffer)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RawBindFBO&#039;&#039;&#039; &amp;lt;font color=darkblue&amp;gt; (Replaces UnsafeSetFBO starting from 104.0.1-1003-gb3e02a6 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] [, number rawFboId = 0] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default or specified via rawFboId numeric id of FBO)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; number previouslyBoundRawFboId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlitFBO&#039;&#039;&#039; &amp;lt;font color=red&amp;gt;needs GLEW_EXT_framebuffer_blit&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  ( fboSrc , int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    fboDst , int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Userdata FBO===&lt;br /&gt;
   &amp;lt;font color=darkgreen&amp;gt;attachment ::= luaTex or RBO or nil or { luaTex or RBO [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ]] }&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  write-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;fbo.depth&#039;&#039;&#039;   = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.stencil&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.color0&#039;&#039;&#039;  = attachment&lt;br /&gt;
     ..&lt;br /&gt;
    &#039;&#039;&#039;fbo.color15&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.drawbuffers&#039;&#039;&#039; = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    &#039;&#039;&#039;fbo.readbuffer&#039;&#039;&#039;  = GL_COLOR_ATTACHMENT0_EXT&lt;br /&gt;
&lt;br /&gt;
==RBO==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateRBO&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
    [ {&lt;br /&gt;
      target = GL_RENDERBUFFER_EXT,&lt;br /&gt;
      format = [[Lua_ConstGL#RBO_Formats|GL_RGBA]],&lt;br /&gt;
      [samples = number], &amp;lt;font color=darkblue&amp;gt; any (!!!) number here will result in creation of multisampled RBO (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    } ]) -&amp;gt; userdata [[Lua_FBO#Userdata_RBO|rbo]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteRBO&#039;&#039;&#039;&lt;br /&gt;
  ( rbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
===Userdata RBO===&lt;br /&gt;
  read-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;rbo.target&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.format&#039;&#039;&#039;  = [[Lua_ConstGL#RBO_Formats|number]]&lt;br /&gt;
    &#039;&#039;&#039;rbo.xsize&#039;&#039;&#039;   = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.ysize&#039;&#039;&#039;   = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.valid&#039;&#039;&#039;   = boolean&lt;br /&gt;
    &#039;&#039;&#039;rbo.samples&#039;&#039;&#039; = number &amp;lt;font color=darkblue&amp;gt; will return globalRendering-&amp;gt;msaaLevel for multisampled RBO or 0 otherwise (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO_and_RBO&amp;diff=11266</id>
		<title>Lua FBO and RBO</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO_and_RBO&amp;diff=11266"/>
		<updated>2019-02-17T18:20:14Z</updated>

		<summary type="html">&lt;p&gt;Ivand: /* Userdata RBO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
== FBO ==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateFBO&#039;&#039;&#039;&lt;br /&gt;
  ( [ table initialization ] ) -&amp;gt; userdata [[Lua_FBO#Userdata_FBO|fbo]]&lt;br /&gt;
&amp;lt;font color=darkgreen&amp;gt;&lt;br /&gt;
  initialization table can contain:&lt;br /&gt;
&lt;br /&gt;
    attachment ::= luaTex or RBO or nil or { luaTex [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ] ] }&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
      depth   = attachment,&lt;br /&gt;
      stencil = attachment,&lt;br /&gt;
      color0  = attachment,&lt;br /&gt;
      color1  = attachment,&lt;br /&gt;
      color2  = attachment,&lt;br /&gt;
      ..&lt;br /&gt;
      color15 = attachment,&lt;br /&gt;
      drawbuffers = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(This doesn&#039;t delete the attached objects!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.IsValidFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] ) -&amp;gt; boolean valid [, number [[Lua_ConstGL#FBO_Status|status]] ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] [, boolean identities ] , lua_function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeSetFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(Binds a FBO like gl.ActiveFBO() does, but you have to unbind it yourself!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default screenbuffer)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RawBindFBO&#039;&#039;&#039; &amp;lt;font color=darkblue&amp;gt; (Replaces UnsafeSetFBO starting from 104.0.1-1003-gb3e02a6 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] [, number rawFboId = 0] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default or specified via rawFboId numeric id of FBO)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; number previouslyBoundRawFboId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlitFBO&#039;&#039;&#039; &amp;lt;font color=red&amp;gt;needs GLEW_EXT_framebuffer_blit&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  ( fboSrc , int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    fboDst , int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Userdata FBO===&lt;br /&gt;
   &amp;lt;font color=darkgreen&amp;gt;attachment ::= luaTex or RBO or nil or { luaTex or RBO [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ]] }&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  write-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;fbo.depth&#039;&#039;&#039;   = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.stencil&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.color0&#039;&#039;&#039;  = attachment&lt;br /&gt;
     ..&lt;br /&gt;
    &#039;&#039;&#039;fbo.color15&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.drawbuffers&#039;&#039;&#039; = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    &#039;&#039;&#039;fbo.readbuffer&#039;&#039;&#039;  = GL_COLOR_ATTACHMENT0_EXT&lt;br /&gt;
&lt;br /&gt;
==RBO==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateRBO&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
    [ {&lt;br /&gt;
      target = GL_RENDERBUFFER_EXT,&lt;br /&gt;
      format = [[Lua_ConstGL#RBO_Formats|GL_RGBA]],&lt;br /&gt;
      [samples = number], &amp;lt;font color=darkblue&amp;gt; any (!!!) number here will result in creation of multisampled RBO (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    } ]) -&amp;gt; userdata [[Lua_FBO#Userdata_RBO|rbo]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteRBO&#039;&#039;&#039;&lt;br /&gt;
  ( rbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
===Userdata RBO===&lt;br /&gt;
  read-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;rbo.target&#039;&#039;&#039; = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.format&#039;&#039;&#039; = [[Lua_ConstGL#RBO_Formats|number]]&lt;br /&gt;
    &#039;&#039;&#039;rbo.xsize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.ysize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.valid&#039;&#039;&#039;  = boolean&lt;br /&gt;
    &#039;&#039;&#039;rbo.samples&#039;&#039;&#039;    = number &amp;lt;font color=darkblue&amp;gt; will return globalRendering-&amp;gt;msaaLevel for multisampled RBO or 0 otherwise (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO_and_RBO&amp;diff=11265</id>
		<title>Lua FBO and RBO</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO_and_RBO&amp;diff=11265"/>
		<updated>2019-02-17T17:48:53Z</updated>

		<summary type="html">&lt;p&gt;Ivand: /* Userdata RBO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
== FBO ==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateFBO&#039;&#039;&#039;&lt;br /&gt;
  ( [ table initialization ] ) -&amp;gt; userdata [[Lua_FBO#Userdata_FBO|fbo]]&lt;br /&gt;
&amp;lt;font color=darkgreen&amp;gt;&lt;br /&gt;
  initialization table can contain:&lt;br /&gt;
&lt;br /&gt;
    attachment ::= luaTex or RBO or nil or { luaTex [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ] ] }&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
      depth   = attachment,&lt;br /&gt;
      stencil = attachment,&lt;br /&gt;
      color0  = attachment,&lt;br /&gt;
      color1  = attachment,&lt;br /&gt;
      color2  = attachment,&lt;br /&gt;
      ..&lt;br /&gt;
      color15 = attachment,&lt;br /&gt;
      drawbuffers = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(This doesn&#039;t delete the attached objects!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.IsValidFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] ) -&amp;gt; boolean valid [, number [[Lua_ConstGL#FBO_Status|status]] ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] [, boolean identities ] , lua_function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeSetFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(Binds a FBO like gl.ActiveFBO() does, but you have to unbind it yourself!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default screenbuffer)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RawBindFBO&#039;&#039;&#039; &amp;lt;font color=darkblue&amp;gt; (Replaces UnsafeSetFBO starting from 104.0.1-1003-gb3e02a6 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] [, number rawFboId = 0] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default or specified via rawFboId numeric id of FBO)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; number previouslyBoundRawFboId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlitFBO&#039;&#039;&#039; &amp;lt;font color=red&amp;gt;needs GLEW_EXT_framebuffer_blit&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  ( fboSrc , int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    fboDst , int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Userdata FBO===&lt;br /&gt;
   &amp;lt;font color=darkgreen&amp;gt;attachment ::= luaTex or RBO or nil or { luaTex or RBO [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ]] }&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  write-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;fbo.depth&#039;&#039;&#039;   = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.stencil&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.color0&#039;&#039;&#039;  = attachment&lt;br /&gt;
     ..&lt;br /&gt;
    &#039;&#039;&#039;fbo.color15&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.drawbuffers&#039;&#039;&#039; = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    &#039;&#039;&#039;fbo.readbuffer&#039;&#039;&#039;  = GL_COLOR_ATTACHMENT0_EXT&lt;br /&gt;
&lt;br /&gt;
==RBO==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateRBO&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
    [ {&lt;br /&gt;
      target = GL_RENDERBUFFER_EXT,&lt;br /&gt;
      format = [[Lua_ConstGL#RBO_Formats|GL_RGBA]],&lt;br /&gt;
      [samples = number], &amp;lt;font color=darkblue&amp;gt; any (!!!) number here will result in creation of multisampled RBO (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    } ]) -&amp;gt; userdata [[Lua_FBO#Userdata_RBO|rbo]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteRBO&#039;&#039;&#039;&lt;br /&gt;
  ( rbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
===Userdata RBO===&lt;br /&gt;
  read-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;rbo.target&#039;&#039;&#039; = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.format&#039;&#039;&#039; = [[Lua_ConstGL#RBO_Formats|number]]&lt;br /&gt;
    &#039;&#039;&#039;rbo.xsize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.ysize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.valid&#039;&#039;&#039;  = boolean&lt;br /&gt;
    &#039;&#039;&#039;samples&#039;&#039;&#039;    = number &amp;lt;font color=darkblue&amp;gt; will return globalRendering-&amp;gt;msaaLevel for multisampled RBO or 0 otherwise (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO_and_RBO&amp;diff=11264</id>
		<title>Lua FBO and RBO</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO_and_RBO&amp;diff=11264"/>
		<updated>2019-02-17T17:47:30Z</updated>

		<summary type="html">&lt;p&gt;Ivand: /* RBO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
== FBO ==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateFBO&#039;&#039;&#039;&lt;br /&gt;
  ( [ table initialization ] ) -&amp;gt; userdata [[Lua_FBO#Userdata_FBO|fbo]]&lt;br /&gt;
&amp;lt;font color=darkgreen&amp;gt;&lt;br /&gt;
  initialization table can contain:&lt;br /&gt;
&lt;br /&gt;
    attachment ::= luaTex or RBO or nil or { luaTex [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ] ] }&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
      depth   = attachment,&lt;br /&gt;
      stencil = attachment,&lt;br /&gt;
      color0  = attachment,&lt;br /&gt;
      color1  = attachment,&lt;br /&gt;
      color2  = attachment,&lt;br /&gt;
      ..&lt;br /&gt;
      color15 = attachment,&lt;br /&gt;
      drawbuffers = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(This doesn&#039;t delete the attached objects!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.IsValidFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] ) -&amp;gt; boolean valid [, number [[Lua_ConstGL#FBO_Status|status]] ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] [, boolean identities ] , lua_function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeSetFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(Binds a FBO like gl.ActiveFBO() does, but you have to unbind it yourself!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default screenbuffer)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RawBindFBO&#039;&#039;&#039; &amp;lt;font color=darkblue&amp;gt; (Replaces UnsafeSetFBO starting from 104.0.1-1003-gb3e02a6 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] [, number rawFboId = 0] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default or specified via rawFboId numeric id of FBO)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; number previouslyBoundRawFboId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlitFBO&#039;&#039;&#039; &amp;lt;font color=red&amp;gt;needs GLEW_EXT_framebuffer_blit&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  ( fboSrc , int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    fboDst , int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Userdata FBO===&lt;br /&gt;
   &amp;lt;font color=darkgreen&amp;gt;attachment ::= luaTex or RBO or nil or { luaTex or RBO [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ]] }&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  write-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;fbo.depth&#039;&#039;&#039;   = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.stencil&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.color0&#039;&#039;&#039;  = attachment&lt;br /&gt;
     ..&lt;br /&gt;
    &#039;&#039;&#039;fbo.color15&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.drawbuffers&#039;&#039;&#039; = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    &#039;&#039;&#039;fbo.readbuffer&#039;&#039;&#039;  = GL_COLOR_ATTACHMENT0_EXT&lt;br /&gt;
&lt;br /&gt;
==RBO==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateRBO&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
    [ {&lt;br /&gt;
      target = GL_RENDERBUFFER_EXT,&lt;br /&gt;
      format = [[Lua_ConstGL#RBO_Formats|GL_RGBA]],&lt;br /&gt;
      [samples = number], &amp;lt;font color=darkblue&amp;gt; any (!!!) number here will result in creation of multisampled RBO (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    } ]) -&amp;gt; userdata [[Lua_FBO#Userdata_RBO|rbo]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteRBO&#039;&#039;&#039;&lt;br /&gt;
  ( rbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
===Userdata RBO===&lt;br /&gt;
  read-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;rbo.target&#039;&#039;&#039; = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.format&#039;&#039;&#039; = [[Lua_ConstGL#RBO_Formats|number]]&lt;br /&gt;
    &#039;&#039;&#039;rbo.xsize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.ysize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.valid&#039;&#039;&#039;  = boolean&lt;br /&gt;
    &#039;&#039;&#039;samples&#039;&#039;&#039;    = number &amp;lt;font color=darkblue&amp;gt; (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO_and_RBO&amp;diff=11263</id>
		<title>Lua FBO and RBO</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO_and_RBO&amp;diff=11263"/>
		<updated>2019-02-17T17:46:26Z</updated>

		<summary type="html">&lt;p&gt;Ivand: /* RBO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
== FBO ==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateFBO&#039;&#039;&#039;&lt;br /&gt;
  ( [ table initialization ] ) -&amp;gt; userdata [[Lua_FBO#Userdata_FBO|fbo]]&lt;br /&gt;
&amp;lt;font color=darkgreen&amp;gt;&lt;br /&gt;
  initialization table can contain:&lt;br /&gt;
&lt;br /&gt;
    attachment ::= luaTex or RBO or nil or { luaTex [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ] ] }&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
      depth   = attachment,&lt;br /&gt;
      stencil = attachment,&lt;br /&gt;
      color0  = attachment,&lt;br /&gt;
      color1  = attachment,&lt;br /&gt;
      color2  = attachment,&lt;br /&gt;
      ..&lt;br /&gt;
      color15 = attachment,&lt;br /&gt;
      drawbuffers = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(This doesn&#039;t delete the attached objects!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.IsValidFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] ) -&amp;gt; boolean valid [, number [[Lua_ConstGL#FBO_Status|status]] ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] [, boolean identities ] , lua_function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeSetFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(Binds a FBO like gl.ActiveFBO() does, but you have to unbind it yourself!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default screenbuffer)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RawBindFBO&#039;&#039;&#039; &amp;lt;font color=darkblue&amp;gt; (Replaces UnsafeSetFBO starting from 104.0.1-1003-gb3e02a6 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] [, number rawFboId = 0] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default or specified via rawFboId numeric id of FBO)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; number previouslyBoundRawFboId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlitFBO&#039;&#039;&#039; &amp;lt;font color=red&amp;gt;needs GLEW_EXT_framebuffer_blit&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  ( fboSrc , int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    fboDst , int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Userdata FBO===&lt;br /&gt;
   &amp;lt;font color=darkgreen&amp;gt;attachment ::= luaTex or RBO or nil or { luaTex or RBO [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ]] }&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  write-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;fbo.depth&#039;&#039;&#039;   = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.stencil&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.color0&#039;&#039;&#039;  = attachment&lt;br /&gt;
     ..&lt;br /&gt;
    &#039;&#039;&#039;fbo.color15&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.drawbuffers&#039;&#039;&#039; = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    &#039;&#039;&#039;fbo.readbuffer&#039;&#039;&#039;  = GL_COLOR_ATTACHMENT0_EXT&lt;br /&gt;
&lt;br /&gt;
==RBO==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateRBO&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
    [ {&lt;br /&gt;
      target = GL_RENDERBUFFER_EXT,&lt;br /&gt;
      format = [[Lua_ConstGL#RBO_Formats|GL_RGBA]],&lt;br /&gt;
      samples = number &amp;lt;font color=darkblue&amp;gt; any (!!!) number here will result in creation of multisampled RBO (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    } ]) -&amp;gt; userdata [[Lua_FBO#Userdata_RBO|rbo]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteRBO&#039;&#039;&#039;&lt;br /&gt;
  ( rbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
===Userdata RBO===&lt;br /&gt;
  read-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;rbo.target&#039;&#039;&#039; = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.format&#039;&#039;&#039; = [[Lua_ConstGL#RBO_Formats|number]]&lt;br /&gt;
    &#039;&#039;&#039;rbo.xsize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.ysize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.valid&#039;&#039;&#039;  = boolean&lt;br /&gt;
    &#039;&#039;&#039;samples&#039;&#039;&#039;    = number &amp;lt;font color=darkblue&amp;gt; (Added in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11511</id>
		<title>Lua OpenGL Api</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11511"/>
		<updated>2019-02-17T17:43:20Z</updated>

		<summary type="html">&lt;p&gt;Ivand: /* Textures */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
= Spring =&lt;br /&gt;
&#039;&#039;&#039;gl.GetSun&#039;&#039;&#039;&lt;br /&gt;
  &amp;lt;font style=&amp;quot;font-size:90%&amp;quot;&amp;gt;()        -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;pos&amp;quot; ) -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;shadowDensity&amp;quot; [, &amp;quot;unit&amp;quot;] ) -&amp;gt; number shadowDensity&lt;br /&gt;
  ( &amp;quot;diffuse&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;ambient&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;specular&amp;quot;      [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetAtmosphere&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Sun|Spring.SetAtmosphere]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetWaterRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | string texName | number scalar | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetWaterParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMapRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetMapRenderingParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigScreen&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;used for Unit LODs&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number screenWidth, number screenDistance ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawMiniMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;argument new in 0.82+&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;boolean tansform = true&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SlaveMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( boolean mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( int px, int py, int sx, int sy ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetViewSizes&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number x, number y&lt;br /&gt;
&lt;br /&gt;
= Matrices &amp;amp; Viewport =&lt;br /&gt;
&#039;&#039;&#039;gl.Viewport&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;&#039;gl.Translate&#039;&#039;&#039;&lt;br /&gt;
  (number x, number y, number z) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scale&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rotate&#039;&#039;&#039;&lt;br /&gt;
  ( number angle, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Billboard&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Use this to draw 2d primitives in DrawWorld().&lt;br /&gt;
To render a 2D billboarded quad in the gameworld at world position x,y,z, you do the following (at a minimum; I am skipping blending / depthtesting) here:&lt;br /&gt;
  gl.PushMatrix()&lt;br /&gt;
  gl.Texture(read what you need here)&lt;br /&gt;
  gl.Translate(x,y,z)&lt;br /&gt;
  gl.Billboard()			&lt;br /&gt;
  gl.TexRect(x1,y1,x2,y2)&lt;br /&gt;
  gl.PopMatrix()&amp;lt;/span &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MatrixMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#MatrixMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadIdentity&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( 16 numbers or a [https://github.com/spring/spring/blob/develop/rts/Lua/LuaOpenGLUtils.cpp#L60 matrix name] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Ortho&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Frustum&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushPopMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ClipPlane&#039;&#039;&#039;&lt;br /&gt;
  ( int plane, &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: $plane can only be 1 or 2&amp;lt;/font&amp;gt;&lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number A, number B, number C, number D ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Clear =&lt;br /&gt;
&#039;&#039;&#039;gl.Clear&#039;&#039;&#039;&lt;br /&gt;
  ( GL.DEPTH_BUFFER_BIT [, number cleardepth] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.STENCIL_BUFFER_BIT [, int clearstencil] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.COLOR_BUFFER_BIT | GL.ACCUM_BUFFER_BIT [, number r, number g, number b, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SwapBuffers&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Available only in LuaMenu, meant for frame-limited LuaMenu&#039;s that want identical content in both buffers.&lt;br /&gt;
&lt;br /&gt;
= ResetState/Matrices =&lt;br /&gt;
&#039;&#039;&#039;gl.ResetState&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;DON&#039;T USE IT UNLESS YOU KNOW WHAT YOU ARE DOING! Each call-in has different default states, but this function resets all states to the states below no matter what!&amp;lt;/span&amp;gt;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  ShadeModel = GL.SMOOTH&lt;br /&gt;
  Scissor    = false&lt;br /&gt;
  Texture    = false&lt;br /&gt;
  Lighting    = false,&lt;br /&gt;
  ColorMask  = true, true, true, true&lt;br /&gt;
  DepthMask  = false&lt;br /&gt;
  DepthTest  = false  (GL.LEQUAL)&lt;br /&gt;
  Culling    = false  (GL.BACK)&lt;br /&gt;
  LogicOp    = false  (GL.INVERT)&lt;br /&gt;
  AlphaTest  = false  (GL.GREATER, 0.5f)&lt;br /&gt;
  Blending   = true (GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA)&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ResetMatrices&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  Resets GL.TEXTURE matrix stack&lt;br /&gt;
  Resets GL.MODELVIEW matrix stack&lt;br /&gt;
  Resets GL.PROJECTION matrix stack&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Draw Basics =&lt;br /&gt;
&#039;&#039;&#039;gl.BeginEnd&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Drawing_Primitives|GLType]], function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Color&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b[, number a] } |&lt;br /&gt;
      number r, number g, number b[, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Vertex&#039;&#039;&#039;&lt;br /&gt;
  ( { number x, number y [, number z [, number w ]] } |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Normal&#039;&#039;&#039;&lt;br /&gt;
  (  number x, number y, number z |&lt;br /&gt;
   { number x, number y, number z } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rect&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexRect&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;texture rect&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2,&lt;br /&gt;
  [ boolean flip_s, boolean flip_t | number s1, number t1, number s2, number t2 ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Shape&#039;&#039;&#039;&lt;br /&gt;
 ( number [[Lua_ConstGL#Drawing_Primitives|GLtype]],&lt;br /&gt;
   elements = {&lt;br /&gt;
     [1] = { v | vertex   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;required&amp;lt;/font&amp;gt;&lt;br /&gt;
             n | normal   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             t | texcoord = { number x, number y },                     &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             c | color    = { number r, number g, number b, number a }  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
     },&lt;br /&gt;
     etc ...&lt;br /&gt;
   }&lt;br /&gt;
 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SecondaryColor&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b } |&lt;br /&gt;
      number r, number g, number b ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FogCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Display Lists =&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Display Lists save given vertex attributes in a static buffer, so the GPU can directly read them (without the CPU). Display Lists are a lot faster (10-60x) than standard drawing with glShape/glBeginEnd, so try to use them when ever you can. If you want to learn more about them, g00gle is your friend ;)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateList&#039;&#039;&#039;&lt;br /&gt;
  ( function [,arg1 [,arg2...]] ) -&amp;gt; number listID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CallList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Text =&lt;br /&gt;
&#039;&#039;&#039;gl.Text&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;, number x, number y, number size [, string &amp;lt;span class=note&amp;gt;&amp;quot;options&amp;quot;&amp;lt;/span&amp;gt;] )&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
  options are:&lt;br /&gt;
    horizontal alignment:&lt;br /&gt;
       &#039;c&#039; = center&lt;br /&gt;
       &#039;r&#039; = right&lt;br /&gt;
    vertical alignment:&lt;br /&gt;
       &#039;a&#039; = ascender&lt;br /&gt;
       &#039;t&#039; = top&lt;br /&gt;
       &#039;v&#039; = vertical center&lt;br /&gt;
       &#039;x&#039; = baseline&lt;br /&gt;
       &#039;b&#039; = bottom&lt;br /&gt;
       &#039;d&#039; = descender&lt;br /&gt;
    decorations:&lt;br /&gt;
       &#039;o&#039; = black outline&lt;br /&gt;
       &#039;O&#039; = white outline&lt;br /&gt;
       &#039;s&#039; = shadow&lt;br /&gt;
    other:&lt;br /&gt;
       &#039;n&#039; = don&#039;t round vertex coords to nearest integer (font may get blurry)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
http://home.arcor.de/jkei/fontlines.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextWidth&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;) -&amp;gt; number width  &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextHeight&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;text&amp;quot; ) -&amp;gt; nil | number height, number descender, number numlines &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;further descriptions here: [[GetTextHeight]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&amp;lt;b&amp;gt;If you have multiple gl.Text calls, then you can bunch them between a gl.BeginText and gl.EndText to speedup the rendering.&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;gl.BeginText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.EndText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Unit/Feature Draw Functions =&lt;br /&gt;
&#039;&#039;&#039;gl.Unit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws an unit; on default it uses LOD, with lod&amp;lt;0 it is turned off, else it defines a specific level)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitRaw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(doesn&#039;t apply worldspace-&amp;gt;unit transformation! only works if &amp;lt;i&amp;gt;rawdraw&amp;lt;/i&amp;gt; is true )&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShape&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID, number teamID, bool rawState, bool toScreen, bool opaque ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|101.0}} The three extra boolean arguments make it so that calling only these functions is enough to get correctly rendered models; pass in &#039;false&#039; for the THIRD argument to get the fixed behavior, omit it or pass in &#039;true&#039; [default] to render with your own custom state instead. The FOURTH argument should be &#039;true&#039; if in DrawScreen and &#039;false&#039; (default) if in DrawWorld; any transforms for these two functions *MUST* include a gl.LoadIdentity call when argument #3 is false (whether they are used in DrawWorld or in DrawScreen) the FIFTH argument determines whether the model is drawn opaque (&#039;true&#039; [default]) or with translucency (&#039;false&#039;); only has an effect when argument #3 is false.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; unit space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(unit space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPiece&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the unit piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.UnitPieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Feature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureRaw&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShape&#039;&#039;&#039;&lt;br /&gt;
  ( number featureDefID, number teamID, bool custom, bool drawScreen, bool opaque  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; feature space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(feature space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePiece&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the Feature piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.FeaturePieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawListAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number listID, [ boolean midPos,&lt;br /&gt;
      number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
      number degrees, number rotX, number rotX, number rotZ ] ) -&amp;gt; nil &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawFuncAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean midPos, function [, arg1,... ]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= States (Blending,AlphaTest...) =&lt;br /&gt;
&#039;&#039;&#039;gl.Blending&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
  ( string &amp;lt;span class=note&amp;gt;mode&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99&amp;quot; | mode maybe:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.ONE, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha_add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;reset&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;color&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_COLOR, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;modulate&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.DST_COLOR, GL.ZERO&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;disable&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquation&#039;&#039;&#039;&lt;br /&gt;
  ( number mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquationSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number modeRGB, number modeAlpha ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcRGB]], number [[Lua_ConstGL#BlendingFactorDest|dstRGB]],  number [[Lua_ConstGL#BlendingFactorSrc|srcAlpha]], number [[Lua_ConstGL#BlendingFactorDest|dstAlpha]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.AlphaTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]], number threshold ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Culling&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#Culling|face]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthClamp&#039;&#039;&#039;  &amp;lt;span class=warning&amp;gt;not always available, needs GL.NV_depth_clamp!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ColorMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( boolean r, boolean g, boolean b, boolean a ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LogicOp&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#LogicOp|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Fog&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Smoothing&#039;&#039;&#039; {{removed|104.0}}&lt;br /&gt;
 ( (boolean enable | number POINT), &lt;br /&gt;
   (boolean enable | number LINE),&lt;br /&gt;
   (boolean enable | number POLYGON) ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
 ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scissor&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( int x, int y, int w, int h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LineStipple&#039;&#039;&#039;&lt;br /&gt;
  ( string any ) -&amp;gt; nil &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(use springs default line stipple)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
  ( int factor, number pattern ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number [[Lua_ConstGL#PolygonMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonOffset&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number factor, number units ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushAttrib&#039;&#039;&#039;&lt;br /&gt;
  ( [ number [[Lua_ConstGL#glPushAttrib.28.29_bits|attrib]] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopAttrib&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Stencil =&lt;br /&gt;
&#039;&#039;&#039;gl.StencilTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMask&#039;&#039;&#039;&lt;br /&gt;
  ( number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOp&#039;&#039;&#039;&lt;br /&gt;
  ( number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMaskSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOpSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= LineWidth &amp;amp; PointSize =&lt;br /&gt;
&#039;&#039;&#039;gl.LineWidth&#039;&#039;&#039;&lt;br /&gt;
  ( number width ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSize&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(values != 1 can break severely on ATI cards, see http://springrts.com/mantis/view.php?id=2390)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number size ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSprite&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable, [boolean coord_replace, boolean coord_origin_upper] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointParameter&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number v1, number v2, number v3, &lt;br /&gt;
    [ number sizeMin, number sizeMax, number sizeFade ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Textures =&lt;br /&gt;
&#039;&#039;&#039;gl.Texture&#039;&#039;&#039;&lt;br /&gt;
  ( [ number texNum, ] boolean enable | string &amp;lt;span class=note&amp;gt;name&amp;lt;/span&amp;gt; ) -&amp;gt; nil | boolean loaded&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;This is the only call-out that is needed to load and draw any texture in a Lua script. All you have to do is pass it a valid path to a valid png and it will use that image for drawing any subsequent textured rectangles. This is shown in the last line of the following list of valid strings for the name parameter.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99; text-align:left&amp;quot; |`name` may be:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | #12&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 12 buildpic&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %34:1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 34 s3o tex2 (:0-&amp;gt;tex1,:1-&amp;gt;tex2)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %-102:0&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = featureDef 102 s3o tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | !56&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = lua generated texture 56 (= return value of gl.CreateTexture)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units2&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shadow&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = shadowmap&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = specular cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(removed in the latest develop)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $reflection &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = reflection cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(can be mipmaped starting from 104.0.1-714-ga29177f. Set CubeTexGenerateMipMaps=1 in settings)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shading&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = ground shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $grass&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = grass shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $heightmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = heightmap (needs HeightMapTexture=1 set in spring config)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $minimap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = minimap texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = same as &amp;quot;$reflection&amp;quot; {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $sky_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = defined for SSMF maps that have a skyReflectModTex {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = auto generated normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF specular texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_distr&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat distribution texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat normals texture {{new|101.0}}, used as &amp;quot;$ssmf_splat_normals&amp;quot; or &amp;quot;$ssmf_splat_normals:X&amp;quot;, &#039;X&#039; can be a value between 0 and 3, defaults to 0 if &amp;quot;:X&amp;quot; is omitted&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_emission&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF emission texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_parallax&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF parallax texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = currently active info texture (los, airlos, radar, jammer)&amp;lt;br/&amp;gt; Note that textures contain no data until user switches to their respective modes and non-active textures are not updated in the background, so will go stale&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_losmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = los texture (L-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_mtlmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = metal map texture (F4-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_hgtmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = height map texture (F1-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_blkmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = blocking map texture (F2-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the map in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the map in view. {{new|95}} &amp;lt;br/&amp;gt;To translate this to world position coordinates, use:&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(vec3(gl_TexCoord[0].st, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x) * 2.0 - 1.0 ,1.0);&lt;br /&gt;
  worldpos.xyz = worldpos.xyz / worldpos.w; &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the models in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the models in view.  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | ${opt}:/LuaUI/images/image.png &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = load a texture from the VFS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
   possible ${opt}&#039;s are:&lt;br /&gt;
      &#039;n&#039; = nearest&lt;br /&gt;
      &#039;l&#039; = linear&lt;br /&gt;
      &#039;a&#039; = aniso&lt;br /&gt;
      &#039;i&#039; = invert&lt;br /&gt;
      &#039;g&#039; = greyed&lt;br /&gt;
      &#039;c&#039; = clamped&lt;br /&gt;
      &#039;b&#039; = border&lt;br /&gt;
      &#039;t%r,%g,%b&#039; = tint&lt;br /&gt;
      &#039;r%width,%height&#039; = resize&lt;br /&gt;
   The above ${opt}&#039;s are NOT available for .DDS textures! .dds will load faster than other image formats.&lt;br /&gt;
&lt;br /&gt;
    example: &amp;quot;:iac:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example: &amp;quot;:cr16,16:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example2: &amp;quot;:t1.0,0.5,0:/LuaUI/images/image.png&amp;quot;  (orange tint)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
  [ { &lt;br /&gt;
    [target     = number,] &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(like GL.TEXTURE_1D,GL.TEXTURE_2D,...)&amp;lt;/font&amp;gt; &amp;lt;font color=darkblue&amp;gt; (Added support for GL_TEXTURE_2D_MULTISAMPLE in 104.0.1-1015-g8e36ef2 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [format     = number,]&lt;br /&gt;
    [min_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [mag_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [wrap_s     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_t     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_r     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [aniso      = number,]&lt;br /&gt;
    [border     = boolean,]&lt;br /&gt;
    [fbo        = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [fboDepth   = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  } ]&lt;br /&gt;
  ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTexture&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTextureFBO&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TextureInfo&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; nil | {&lt;br /&gt;
      xsize = number,&lt;br /&gt;
      ysize = number,&lt;br /&gt;
      alpha = boolean, //not used yet&lt;br /&gt;
      type  = number,  //not used yet&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
   the format of the texture string is the same as in gl.Texture()&lt;br /&gt;
&amp;lt;/font&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number x | &lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum,&lt;br /&gt;
    number x |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexGen&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexGen&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil       &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CopyToTexture&#039;&#039;&#039;&lt;br /&gt;
  (string texture, int xoff, int yoff, int x, int y, int w, int h &lt;br /&gt;
  [,number target,number level])-&amp;gt;nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderToTexture&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string fbotexture, lua_func ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GenerateMipmap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs glGenerateMipmapEXT!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
The following are primarily intended to be used in conjunction with&lt;br /&gt;
     gl.{Unit,Feature}(objID, ..., raw=true)&lt;br /&gt;
     gl.{Unit,Feature}Shape(defID, ..., raw=true)&lt;br /&gt;
and apply a model&#039;s default textures; easier than gl.Texture(&amp;quot;$%...&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
= PixelReadback =&lt;br /&gt;
&#039;&#039;&#039;gl.SaveImage&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h,&lt;br /&gt;
    string filename [, table {alpha=boolean, yflip=boolean, grayscale16bit=boolean} ] ) -&amp;gt; nil | boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;grayscale16bit is {{new|99.0}} and allows to save single color 16bit PNG&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ReadPixels&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h [, number format = GL.RGBA ] )&lt;br /&gt;
    -&amp;gt; nil &lt;br /&gt;
    | number r,[g,[b,[a]]] &lt;br /&gt;
    | table { { {1 = number r, 2 = number g, 3 = number b, 4 = number a}, ... }, ... }&lt;br /&gt;
&lt;br /&gt;
= Lights =&lt;br /&gt;
&#039;&#039;&#039;gl.Lighting&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ShadeModel&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#ShadeModel|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Light&#039;&#039;&#039;&lt;br /&gt;
  ( int light, &lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param1, number param2, number param3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Material&#039;&#039;&#039;&lt;br /&gt;
  ({&lt;br /&gt;
    ambient   = {number r, number g, number b[, number a]},&lt;br /&gt;
    diffuse   = {number r, number g, number b[, number a]},&lt;br /&gt;
    ambidiff  = {number r, number g, number b[, number a]},&lt;br /&gt;
    emission  = {number r, number g, number b[, number a]},&lt;br /&gt;
    specular  = {number r, number g, number b[, number a]},&lt;br /&gt;
    shininess = number specularExponent&lt;br /&gt;
  }) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Hardware relevant =&lt;br /&gt;
&#039;&#039;&#039;gl.HasExtension&#039;&#039;&#039;&lt;br /&gt;
  ( string extname ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetNumber&#039;&#039;&#039;&lt;br /&gt;
  ( number ext, int count ) -&amp;gt; number [, number, number, ... #count ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetString&#039;&#039;&#039;&lt;br /&gt;
  ( number ext ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= DrawGroundPrimitives =&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundCircle&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z, number radius, number divs [, number slope ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: number divs is the number of sides the circle will have. the higher the smoother the circle (and more GPU intensive) &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundQuad&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: x1,z1,x2 &amp;amp; z2 are rounded, so don&#039;t use it for very small or moving objects. x and z are correspond to the coordinates displayed by the tooltip &amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number z1, number x2, number z2,&lt;br /&gt;
    [ boolean useNorm, &amp;lt;span class=warning&amp;gt;(does nothing!)&amp;lt;/span&amp;gt;&lt;br /&gt;
      [ number tu1, number tv1, number tu2, number tv2 |&lt;br /&gt;
        boolean useTextureCoord ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Queries =&lt;br /&gt;
&#039;&#039;&#039;gl.CreateQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; nil | userdata query&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.RunQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query, function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.GetQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil | number renderedFragments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Extended =&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexNames&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; { [1] = string texture, etc ... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexCoords&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;gets the texcoord of a 3do texture in the 3do texture atlas&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string 3doTextureName ) -&amp;gt; number xstart, number ystart, number xend, number yend&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeState&#039;&#039;&#039;&lt;br /&gt;
  ( number state [, boolean disable_state ], function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Calls glEnable(state) or glDisable(state) (if disable_state==true) and&amp;lt;br&amp;gt;then calls the lua_function and afterwards reverts the state.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetShadowMapParams&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; number xmid, number ymid, number p17, number p18&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMatrixData&#039;&#039;&#039;&lt;br /&gt;
  ( GL.PROJECTION [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( GL.MODELVIEW  [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i] &lt;br /&gt;
  ( GL.TEXTURE    [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( &amp;quot;shadow&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camera&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;caminv&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camprj&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;billboard&amp;quot; )             -&amp;gt; nil | number, etc.. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Flush&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Finish&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Shaders (GLSL) =&lt;br /&gt;
  [[Lua_GLSL_Api]]&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO&amp;diff=11253</id>
		<title>Lua FBO</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO&amp;diff=11253"/>
		<updated>2019-02-16T22:12:53Z</updated>

		<summary type="html">&lt;p&gt;Ivand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== FBO ==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateFBO&#039;&#039;&#039;&lt;br /&gt;
  ( [ table initialization ] ) -&amp;gt; userdata [[Lua_FBO#Userdata_FBO|fbo]]&lt;br /&gt;
&amp;lt;font color=darkgreen&amp;gt;&lt;br /&gt;
  initialization table can contain:&lt;br /&gt;
&lt;br /&gt;
    attachment ::= luaTex or RBO or nil or { luaTex [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ] ] }&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
      depth   = attachment,&lt;br /&gt;
      stencil = attachment,&lt;br /&gt;
      color0  = attachment,&lt;br /&gt;
      color1  = attachment,&lt;br /&gt;
      color2  = attachment,&lt;br /&gt;
      ..&lt;br /&gt;
      color15 = attachment,&lt;br /&gt;
      drawbuffers = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(This doesn&#039;t delete the attached objects!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.IsValidFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] ) -&amp;gt; boolean valid [, number [[Lua_ConstGL#FBO_Status|status]] ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] [, boolean identities ] , lua_function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeSetFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(Binds a FBO like gl.ActiveFBO() does, but you have to unbind it yourself!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default screenbuffer)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RawBindFBO&#039;&#039;&#039; &amp;lt;font color=darkblue&amp;gt; (Replaces UnsafeSetFBO starting from 104.0.1-1003-gb3e02a6 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] [, number rawFboId = 0] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default or specified via rawFboId numeric id of FBO)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; number previouslyBoundRawFboId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlitFBO&#039;&#039;&#039; &amp;lt;font color=red&amp;gt;needs GLEW_EXT_framebuffer_blit&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  ( fboSrc , int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    fboDst , int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Userdata FBO===&lt;br /&gt;
   &amp;lt;font color=darkgreen&amp;gt;attachment ::= luaTex or RBO or nil or { luaTex or RBO [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ]] }&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  write-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;fbo.depth&#039;&#039;&#039;   = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.stencil&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.color0&#039;&#039;&#039;  = attachment&lt;br /&gt;
     ..&lt;br /&gt;
    &#039;&#039;&#039;fbo.color15&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.drawbuffers&#039;&#039;&#039; = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    &#039;&#039;&#039;fbo.readbuffer&#039;&#039;&#039;  = GL_COLOR_ATTACHMENT0_EXT&lt;br /&gt;
&lt;br /&gt;
==RBO==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateRBO&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
    [ {&lt;br /&gt;
      target = GL_RENDERBUFFER_EXT,&lt;br /&gt;
      format = [[Lua_ConstGL#RBO_Formats|GL_RGBA]],&lt;br /&gt;
      multisample = boolean &amp;lt;font color=darkblue&amp;gt; (Added in 104.0.1-10XX-xxxxxxx maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    } ]) -&amp;gt; userdata [[Lua_FBO#Userdata_RBO|rbo]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteRBO&#039;&#039;&#039;&lt;br /&gt;
  ( rbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
===Userdata RBO===&lt;br /&gt;
  read-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;rbo.target&#039;&#039;&#039; = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.format&#039;&#039;&#039; = [[Lua_ConstGL#RBO_Formats|number]]&lt;br /&gt;
    &#039;&#039;&#039;rbo.xsize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.ysize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.valid&#039;&#039;&#039;  = boolean&lt;br /&gt;
    &#039;&#039;&#039;multisample&#039;&#039;&#039; = boolean &amp;lt;font color=darkblue&amp;gt; (Added in 104.0.1-10XX-xxxxxxx maintenance)&amp;lt;/font&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO_and_RBO&amp;diff=11262</id>
		<title>Lua FBO and RBO</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO_and_RBO&amp;diff=11262"/>
		<updated>2019-02-16T21:45:53Z</updated>

		<summary type="html">&lt;p&gt;Ivand: FBO&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
== FBO ==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateFBO&#039;&#039;&#039;&lt;br /&gt;
  ( [ table initialization ] ) -&amp;gt; userdata [[Lua_FBO#Userdata_FBO|fbo]]&lt;br /&gt;
&amp;lt;font color=darkgreen&amp;gt;&lt;br /&gt;
  initialization table can contain:&lt;br /&gt;
&lt;br /&gt;
    attachment ::= luaTex or RBO or nil or { luaTex [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ] ] }&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
      depth   = attachment,&lt;br /&gt;
      stencil = attachment,&lt;br /&gt;
      color0  = attachment,&lt;br /&gt;
      color1  = attachment,&lt;br /&gt;
      color2  = attachment,&lt;br /&gt;
      ..&lt;br /&gt;
      color15 = attachment,&lt;br /&gt;
      drawbuffers = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(This doesn&#039;t delete the attached objects!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.IsValidFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] ) -&amp;gt; boolean valid [, number [[Lua_ConstGL#FBO_Status|status]] ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] [, boolean identities ] , lua_function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeSetFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(Binds a FBO like gl.ActiveFBO() does, but you have to unbind it yourself!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default screenbuffer)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RawBindFBO&#039;&#039;&#039; &amp;lt;font color=darkblue&amp;gt; (Replaces UnsafeSetFBO starting from 104.0.1-1003-gb3e02a6 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] [, number rawFboId = 0] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default or specified via rawFboId numeric id of FBO)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; number previouslyBoundRawFboId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlitFBO&#039;&#039;&#039; &amp;lt;font color=red&amp;gt;needs GLEW_EXT_framebuffer_blit&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  ( fboSrc , int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    fboDst , int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Userdata FBO===&lt;br /&gt;
   &amp;lt;font color=darkgreen&amp;gt;attachment ::= luaTex or RBO or nil or { luaTex or RBO [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ]] }&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  write-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;fbo.depth&#039;&#039;&#039;   = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.stencil&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.color0&#039;&#039;&#039;  = attachment&lt;br /&gt;
     ..&lt;br /&gt;
    &#039;&#039;&#039;fbo.color15&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.drawbuffers&#039;&#039;&#039; = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    &#039;&#039;&#039;fbo.readbuffer&#039;&#039;&#039;  = GL_COLOR_ATTACHMENT0_EXT&lt;br /&gt;
&lt;br /&gt;
==RBO==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateRBO&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
    [ {&lt;br /&gt;
      target = GL_RENDERBUFFER_EXT,&lt;br /&gt;
      format = [[Lua_ConstGL#RBO_Formats|GL_RGBA]],&lt;br /&gt;
      multisample = boolean &amp;lt;font color=darkblue&amp;gt; (Added in 104.0.1-10XX-xxxxxxx maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    } ]) -&amp;gt; userdata [[Lua_FBO#Userdata_RBO|rbo]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteRBO&#039;&#039;&#039;&lt;br /&gt;
  ( rbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
===Userdata RBO===&lt;br /&gt;
  read-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;rbo.target&#039;&#039;&#039; = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.format&#039;&#039;&#039; = [[Lua_ConstGL#RBO_Formats|number]]&lt;br /&gt;
    &#039;&#039;&#039;rbo.xsize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.ysize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.valid&#039;&#039;&#039;  = boolean&lt;br /&gt;
    &#039;&#039;&#039;multisample&#039;&#039;&#039; = boolean &amp;lt;font color=darkblue&amp;gt; (Added in 104.0.1-10XX-xxxxxxx maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO_and_RBO&amp;diff=11261</id>
		<title>Lua FBO and RBO</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO_and_RBO&amp;diff=11261"/>
		<updated>2019-02-16T21:45:26Z</updated>

		<summary type="html">&lt;p&gt;Ivand: Copied more up-to-date content from https://springrts.com/wiki/Lua_FBO&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateFBO&#039;&#039;&#039;&lt;br /&gt;
  ( [ table initialization ] ) -&amp;gt; userdata [[Lua_FBO#Userdata_FBO|fbo]]&lt;br /&gt;
&amp;lt;font color=darkgreen&amp;gt;&lt;br /&gt;
  initialization table can contain:&lt;br /&gt;
&lt;br /&gt;
    attachment ::= luaTex or RBO or nil or { luaTex [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ] ] }&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
      depth   = attachment,&lt;br /&gt;
      stencil = attachment,&lt;br /&gt;
      color0  = attachment,&lt;br /&gt;
      color1  = attachment,&lt;br /&gt;
      color2  = attachment,&lt;br /&gt;
      ..&lt;br /&gt;
      color15 = attachment,&lt;br /&gt;
      drawbuffers = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(This doesn&#039;t delete the attached objects!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.IsValidFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] ) -&amp;gt; boolean valid [, number [[Lua_ConstGL#FBO_Status|status]] ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] [, boolean identities ] , lua_function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeSetFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(Binds a FBO like gl.ActiveFBO() does, but you have to unbind it yourself!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default screenbuffer)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RawBindFBO&#039;&#039;&#039; &amp;lt;font color=darkblue&amp;gt; (Replaces UnsafeSetFBO starting from 104.0.1-1003-gb3e02a6 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] [, number rawFboId = 0] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default or specified via rawFboId numeric id of FBO)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; number previouslyBoundRawFboId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlitFBO&#039;&#039;&#039; &amp;lt;font color=red&amp;gt;needs GLEW_EXT_framebuffer_blit&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  ( fboSrc , int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    fboDst , int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Userdata FBO===&lt;br /&gt;
   &amp;lt;font color=darkgreen&amp;gt;attachment ::= luaTex or RBO or nil or { luaTex or RBO [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ]] }&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  write-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;fbo.depth&#039;&#039;&#039;   = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.stencil&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.color0&#039;&#039;&#039;  = attachment&lt;br /&gt;
     ..&lt;br /&gt;
    &#039;&#039;&#039;fbo.color15&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.drawbuffers&#039;&#039;&#039; = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    &#039;&#039;&#039;fbo.readbuffer&#039;&#039;&#039;  = GL_COLOR_ATTACHMENT0_EXT&lt;br /&gt;
&lt;br /&gt;
==RBO==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateRBO&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
    [ {&lt;br /&gt;
      target = GL_RENDERBUFFER_EXT,&lt;br /&gt;
      format = [[Lua_ConstGL#RBO_Formats|GL_RGBA]],&lt;br /&gt;
      multisample = boolean &amp;lt;font color=darkblue&amp;gt; (Added in 104.0.1-10XX-xxxxxxx maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    } ]) -&amp;gt; userdata [[Lua_FBO#Userdata_RBO|rbo]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteRBO&#039;&#039;&#039;&lt;br /&gt;
  ( rbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
===Userdata RBO===&lt;br /&gt;
  read-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;rbo.target&#039;&#039;&#039; = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.format&#039;&#039;&#039; = [[Lua_ConstGL#RBO_Formats|number]]&lt;br /&gt;
    &#039;&#039;&#039;rbo.xsize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.ysize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.valid&#039;&#039;&#039;  = boolean&lt;br /&gt;
    &#039;&#039;&#039;multisample&#039;&#039;&#039; = boolean &amp;lt;font color=darkblue&amp;gt; (Added in 104.0.1-10XX-xxxxxxx maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11510</id>
		<title>Lua OpenGL Api</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11510"/>
		<updated>2019-02-16T21:42:40Z</updated>

		<summary type="html">&lt;p&gt;Ivand: multisample CreateTexture&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
= Spring =&lt;br /&gt;
&#039;&#039;&#039;gl.GetSun&#039;&#039;&#039;&lt;br /&gt;
  &amp;lt;font style=&amp;quot;font-size:90%&amp;quot;&amp;gt;()        -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;pos&amp;quot; ) -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;shadowDensity&amp;quot; [, &amp;quot;unit&amp;quot;] ) -&amp;gt; number shadowDensity&lt;br /&gt;
  ( &amp;quot;diffuse&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;ambient&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;specular&amp;quot;      [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetAtmosphere&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Sun|Spring.SetAtmosphere]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetWaterRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | string texName | number scalar | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetWaterParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMapRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetMapRenderingParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigScreen&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;used for Unit LODs&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number screenWidth, number screenDistance ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawMiniMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;argument new in 0.82+&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;boolean tansform = true&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SlaveMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( boolean mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( int px, int py, int sx, int sy ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetViewSizes&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number x, number y&lt;br /&gt;
&lt;br /&gt;
= Matrices &amp;amp; Viewport =&lt;br /&gt;
&#039;&#039;&#039;gl.Viewport&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;&#039;gl.Translate&#039;&#039;&#039;&lt;br /&gt;
  (number x, number y, number z) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scale&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rotate&#039;&#039;&#039;&lt;br /&gt;
  ( number angle, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Billboard&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Use this to draw 2d primitives in DrawWorld().&lt;br /&gt;
To render a 2D billboarded quad in the gameworld at world position x,y,z, you do the following (at a minimum; I am skipping blending / depthtesting) here:&lt;br /&gt;
  gl.PushMatrix()&lt;br /&gt;
  gl.Texture(read what you need here)&lt;br /&gt;
  gl.Translate(x,y,z)&lt;br /&gt;
  gl.Billboard()			&lt;br /&gt;
  gl.TexRect(x1,y1,x2,y2)&lt;br /&gt;
  gl.PopMatrix()&amp;lt;/span &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MatrixMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#MatrixMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadIdentity&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( 16 numbers or a [https://github.com/spring/spring/blob/develop/rts/Lua/LuaOpenGLUtils.cpp#L60 matrix name] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Ortho&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Frustum&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushPopMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ClipPlane&#039;&#039;&#039;&lt;br /&gt;
  ( int plane, &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: $plane can only be 1 or 2&amp;lt;/font&amp;gt;&lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number A, number B, number C, number D ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Clear =&lt;br /&gt;
&#039;&#039;&#039;gl.Clear&#039;&#039;&#039;&lt;br /&gt;
  ( GL.DEPTH_BUFFER_BIT [, number cleardepth] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.STENCIL_BUFFER_BIT [, int clearstencil] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.COLOR_BUFFER_BIT | GL.ACCUM_BUFFER_BIT [, number r, number g, number b, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SwapBuffers&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Available only in LuaMenu, meant for frame-limited LuaMenu&#039;s that want identical content in both buffers.&lt;br /&gt;
&lt;br /&gt;
= ResetState/Matrices =&lt;br /&gt;
&#039;&#039;&#039;gl.ResetState&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;DON&#039;T USE IT UNLESS YOU KNOW WHAT YOU ARE DOING! Each call-in has different default states, but this function resets all states to the states below no matter what!&amp;lt;/span&amp;gt;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  ShadeModel = GL.SMOOTH&lt;br /&gt;
  Scissor    = false&lt;br /&gt;
  Texture    = false&lt;br /&gt;
  Lighting    = false,&lt;br /&gt;
  ColorMask  = true, true, true, true&lt;br /&gt;
  DepthMask  = false&lt;br /&gt;
  DepthTest  = false  (GL.LEQUAL)&lt;br /&gt;
  Culling    = false  (GL.BACK)&lt;br /&gt;
  LogicOp    = false  (GL.INVERT)&lt;br /&gt;
  AlphaTest  = false  (GL.GREATER, 0.5f)&lt;br /&gt;
  Blending   = true (GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA)&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ResetMatrices&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  Resets GL.TEXTURE matrix stack&lt;br /&gt;
  Resets GL.MODELVIEW matrix stack&lt;br /&gt;
  Resets GL.PROJECTION matrix stack&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Draw Basics =&lt;br /&gt;
&#039;&#039;&#039;gl.BeginEnd&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Drawing_Primitives|GLType]], function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Color&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b[, number a] } |&lt;br /&gt;
      number r, number g, number b[, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Vertex&#039;&#039;&#039;&lt;br /&gt;
  ( { number x, number y [, number z [, number w ]] } |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Normal&#039;&#039;&#039;&lt;br /&gt;
  (  number x, number y, number z |&lt;br /&gt;
   { number x, number y, number z } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rect&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexRect&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;texture rect&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2,&lt;br /&gt;
  [ boolean flip_s, boolean flip_t | number s1, number t1, number s2, number t2 ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Shape&#039;&#039;&#039;&lt;br /&gt;
 ( number [[Lua_ConstGL#Drawing_Primitives|GLtype]],&lt;br /&gt;
   elements = {&lt;br /&gt;
     [1] = { v | vertex   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;required&amp;lt;/font&amp;gt;&lt;br /&gt;
             n | normal   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             t | texcoord = { number x, number y },                     &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             c | color    = { number r, number g, number b, number a }  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
     },&lt;br /&gt;
     etc ...&lt;br /&gt;
   }&lt;br /&gt;
 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SecondaryColor&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b } |&lt;br /&gt;
      number r, number g, number b ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FogCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Display Lists =&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Display Lists save given vertex attributes in a static buffer, so the GPU can directly read them (without the CPU). Display Lists are a lot faster (10-60x) than standard drawing with glShape/glBeginEnd, so try to use them when ever you can. If you want to learn more about them, g00gle is your friend ;)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateList&#039;&#039;&#039;&lt;br /&gt;
  ( function [,arg1 [,arg2...]] ) -&amp;gt; number listID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CallList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Text =&lt;br /&gt;
&#039;&#039;&#039;gl.Text&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;, number x, number y, number size [, string &amp;lt;span class=note&amp;gt;&amp;quot;options&amp;quot;&amp;lt;/span&amp;gt;] )&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
  options are:&lt;br /&gt;
    horizontal alignment:&lt;br /&gt;
       &#039;c&#039; = center&lt;br /&gt;
       &#039;r&#039; = right&lt;br /&gt;
    vertical alignment:&lt;br /&gt;
       &#039;a&#039; = ascender&lt;br /&gt;
       &#039;t&#039; = top&lt;br /&gt;
       &#039;v&#039; = vertical center&lt;br /&gt;
       &#039;x&#039; = baseline&lt;br /&gt;
       &#039;b&#039; = bottom&lt;br /&gt;
       &#039;d&#039; = descender&lt;br /&gt;
    decorations:&lt;br /&gt;
       &#039;o&#039; = black outline&lt;br /&gt;
       &#039;O&#039; = white outline&lt;br /&gt;
       &#039;s&#039; = shadow&lt;br /&gt;
    other:&lt;br /&gt;
       &#039;n&#039; = don&#039;t round vertex coords to nearest integer (font may get blurry)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
http://home.arcor.de/jkei/fontlines.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextWidth&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;) -&amp;gt; number width  &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextHeight&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;text&amp;quot; ) -&amp;gt; nil | number height, number descender, number numlines &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;further descriptions here: [[GetTextHeight]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&amp;lt;b&amp;gt;If you have multiple gl.Text calls, then you can bunch them between a gl.BeginText and gl.EndText to speedup the rendering.&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;gl.BeginText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.EndText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Unit/Feature Draw Functions =&lt;br /&gt;
&#039;&#039;&#039;gl.Unit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws an unit; on default it uses LOD, with lod&amp;lt;0 it is turned off, else it defines a specific level)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitRaw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(doesn&#039;t apply worldspace-&amp;gt;unit transformation! only works if &amp;lt;i&amp;gt;rawdraw&amp;lt;/i&amp;gt; is true )&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShape&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID, number teamID, bool rawState, bool toScreen, bool opaque ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|101.0}} The three extra boolean arguments make it so that calling only these functions is enough to get correctly rendered models; pass in &#039;false&#039; for the THIRD argument to get the fixed behavior, omit it or pass in &#039;true&#039; [default] to render with your own custom state instead. The FOURTH argument should be &#039;true&#039; if in DrawScreen and &#039;false&#039; (default) if in DrawWorld; any transforms for these two functions *MUST* include a gl.LoadIdentity call when argument #3 is false (whether they are used in DrawWorld or in DrawScreen) the FIFTH argument determines whether the model is drawn opaque (&#039;true&#039; [default]) or with translucency (&#039;false&#039;); only has an effect when argument #3 is false.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; unit space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(unit space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPiece&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the unit piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.UnitPieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Feature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureRaw&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShape&#039;&#039;&#039;&lt;br /&gt;
  ( number featureDefID, number teamID, bool custom, bool drawScreen, bool opaque  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; feature space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(feature space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePiece&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the Feature piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.FeaturePieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawListAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number listID, [ boolean midPos,&lt;br /&gt;
      number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
      number degrees, number rotX, number rotX, number rotZ ] ) -&amp;gt; nil &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawFuncAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean midPos, function [, arg1,... ]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= States (Blending,AlphaTest...) =&lt;br /&gt;
&#039;&#039;&#039;gl.Blending&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
  ( string &amp;lt;span class=note&amp;gt;mode&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99&amp;quot; | mode maybe:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.ONE, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha_add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;reset&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;color&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_COLOR, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;modulate&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.DST_COLOR, GL.ZERO&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;disable&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquation&#039;&#039;&#039;&lt;br /&gt;
  ( number mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquationSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number modeRGB, number modeAlpha ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcRGB]], number [[Lua_ConstGL#BlendingFactorDest|dstRGB]],  number [[Lua_ConstGL#BlendingFactorSrc|srcAlpha]], number [[Lua_ConstGL#BlendingFactorDest|dstAlpha]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.AlphaTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]], number threshold ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Culling&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#Culling|face]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthClamp&#039;&#039;&#039;  &amp;lt;span class=warning&amp;gt;not always available, needs GL.NV_depth_clamp!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ColorMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( boolean r, boolean g, boolean b, boolean a ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LogicOp&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#LogicOp|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Fog&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Smoothing&#039;&#039;&#039; {{removed|104.0}}&lt;br /&gt;
 ( (boolean enable | number POINT), &lt;br /&gt;
   (boolean enable | number LINE),&lt;br /&gt;
   (boolean enable | number POLYGON) ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
 ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scissor&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( int x, int y, int w, int h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LineStipple&#039;&#039;&#039;&lt;br /&gt;
  ( string any ) -&amp;gt; nil &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(use springs default line stipple)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
  ( int factor, number pattern ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number [[Lua_ConstGL#PolygonMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonOffset&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number factor, number units ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushAttrib&#039;&#039;&#039;&lt;br /&gt;
  ( [ number [[Lua_ConstGL#glPushAttrib.28.29_bits|attrib]] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopAttrib&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Stencil =&lt;br /&gt;
&#039;&#039;&#039;gl.StencilTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMask&#039;&#039;&#039;&lt;br /&gt;
  ( number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOp&#039;&#039;&#039;&lt;br /&gt;
  ( number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMaskSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOpSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= LineWidth &amp;amp; PointSize =&lt;br /&gt;
&#039;&#039;&#039;gl.LineWidth&#039;&#039;&#039;&lt;br /&gt;
  ( number width ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSize&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(values != 1 can break severely on ATI cards, see http://springrts.com/mantis/view.php?id=2390)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number size ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSprite&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable, [boolean coord_replace, boolean coord_origin_upper] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointParameter&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number v1, number v2, number v3, &lt;br /&gt;
    [ number sizeMin, number sizeMax, number sizeFade ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Textures =&lt;br /&gt;
&#039;&#039;&#039;gl.Texture&#039;&#039;&#039;&lt;br /&gt;
  ( [ number texNum, ] boolean enable | string &amp;lt;span class=note&amp;gt;name&amp;lt;/span&amp;gt; ) -&amp;gt; nil | boolean loaded&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;This is the only call-out that is needed to load and draw any texture in a Lua script. All you have to do is pass it a valid path to a valid png and it will use that image for drawing any subsequent textured rectangles. This is shown in the last line of the following list of valid strings for the name parameter.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99; text-align:left&amp;quot; |`name` may be:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | #12&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 12 buildpic&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %34:1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 34 s3o tex2 (:0-&amp;gt;tex1,:1-&amp;gt;tex2)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %-102:0&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = featureDef 102 s3o tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | !56&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = lua generated texture 56 (= return value of gl.CreateTexture)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units2&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shadow&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = shadowmap&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = specular cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(removed in the latest develop)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $reflection &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = reflection cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(can be mipmaped starting from 104.0.1-714-ga29177f. Set CubeTexGenerateMipMaps=1 in settings)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shading&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = ground shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $grass&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = grass shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $heightmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = heightmap (needs HeightMapTexture=1 set in spring config)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $minimap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = minimap texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = same as &amp;quot;$reflection&amp;quot; {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $sky_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = defined for SSMF maps that have a skyReflectModTex {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = auto generated normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF specular texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_distr&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat distribution texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat normals texture {{new|101.0}}, used as &amp;quot;$ssmf_splat_normals&amp;quot; or &amp;quot;$ssmf_splat_normals:X&amp;quot;, &#039;X&#039; can be a value between 0 and 3, defaults to 0 if &amp;quot;:X&amp;quot; is omitted&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_emission&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF emission texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_parallax&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF parallax texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = currently active info texture (los, airlos, radar, jammer)&amp;lt;br/&amp;gt; Note that textures contain no data until user switches to their respective modes and non-active textures are not updated in the background, so will go stale&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_losmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = los texture (L-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_mtlmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = metal map texture (F4-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_hgtmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = height map texture (F1-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_blkmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = blocking map texture (F2-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the map in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the map in view. {{new|95}} &amp;lt;br/&amp;gt;To translate this to world position coordinates, use:&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(vec3(gl_TexCoord[0].st, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x) * 2.0 - 1.0 ,1.0);&lt;br /&gt;
  worldpos.xyz = worldpos.xyz / worldpos.w; &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the models in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the models in view.  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | ${opt}:/LuaUI/images/image.png &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = load a texture from the VFS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
   possible ${opt}&#039;s are:&lt;br /&gt;
      &#039;n&#039; = nearest&lt;br /&gt;
      &#039;l&#039; = linear&lt;br /&gt;
      &#039;a&#039; = aniso&lt;br /&gt;
      &#039;i&#039; = invert&lt;br /&gt;
      &#039;g&#039; = greyed&lt;br /&gt;
      &#039;c&#039; = clamped&lt;br /&gt;
      &#039;b&#039; = border&lt;br /&gt;
      &#039;t%r,%g,%b&#039; = tint&lt;br /&gt;
      &#039;r%width,%height&#039; = resize&lt;br /&gt;
   The above ${opt}&#039;s are NOT available for .DDS textures! .dds will load faster than other image formats.&lt;br /&gt;
&lt;br /&gt;
    example: &amp;quot;:iac:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example: &amp;quot;:cr16,16:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example2: &amp;quot;:t1.0,0.5,0:/LuaUI/images/image.png&amp;quot;  (orange tint)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
  [ { &lt;br /&gt;
    [target     = number,] &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(like GL.TEXTURE_1D,GL.TEXTURE_2D,...)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [format     = number,]&lt;br /&gt;
    [min_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [mag_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [wrap_s     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_t     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_r     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [aniso      = number,]&lt;br /&gt;
    [border     = boolean,]&lt;br /&gt;
    [fbo        = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [fboDepth   = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [multisample = boolean] &amp;lt;font color=darkblue&amp;gt; (Added in 104.0.1-10XX-xxxxxxx maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  } ]&lt;br /&gt;
  ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTexture&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTextureFBO&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TextureInfo&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; nil | {&lt;br /&gt;
      xsize = number,&lt;br /&gt;
      ysize = number,&lt;br /&gt;
      alpha = boolean, //not used yet&lt;br /&gt;
      type  = number,  //not used yet&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
   the format of the texture string is the same as in gl.Texture()&lt;br /&gt;
&amp;lt;/font&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number x | &lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum,&lt;br /&gt;
    number x |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexGen&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexGen&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil       &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CopyToTexture&#039;&#039;&#039;&lt;br /&gt;
  (string texture, int xoff, int yoff, int x, int y, int w, int h &lt;br /&gt;
  [,number target,number level])-&amp;gt;nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderToTexture&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string fbotexture, lua_func ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GenerateMipmap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs glGenerateMipmapEXT!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
The following are primarily intended to be used in conjunction with&lt;br /&gt;
     gl.{Unit,Feature}(objID, ..., raw=true)&lt;br /&gt;
     gl.{Unit,Feature}Shape(defID, ..., raw=true)&lt;br /&gt;
and apply a model&#039;s default textures; easier than gl.Texture(&amp;quot;$%...&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
= PixelReadback =&lt;br /&gt;
&#039;&#039;&#039;gl.SaveImage&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h,&lt;br /&gt;
    string filename [, table {alpha=boolean, yflip=boolean, grayscale16bit=boolean} ] ) -&amp;gt; nil | boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;grayscale16bit is {{new|99.0}} and allows to save single color 16bit PNG&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ReadPixels&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h [, number format = GL.RGBA ] )&lt;br /&gt;
    -&amp;gt; nil &lt;br /&gt;
    | number r,[g,[b,[a]]] &lt;br /&gt;
    | table { { {1 = number r, 2 = number g, 3 = number b, 4 = number a}, ... }, ... }&lt;br /&gt;
&lt;br /&gt;
= Lights =&lt;br /&gt;
&#039;&#039;&#039;gl.Lighting&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ShadeModel&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#ShadeModel|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Light&#039;&#039;&#039;&lt;br /&gt;
  ( int light, &lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param1, number param2, number param3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Material&#039;&#039;&#039;&lt;br /&gt;
  ({&lt;br /&gt;
    ambient   = {number r, number g, number b[, number a]},&lt;br /&gt;
    diffuse   = {number r, number g, number b[, number a]},&lt;br /&gt;
    ambidiff  = {number r, number g, number b[, number a]},&lt;br /&gt;
    emission  = {number r, number g, number b[, number a]},&lt;br /&gt;
    specular  = {number r, number g, number b[, number a]},&lt;br /&gt;
    shininess = number specularExponent&lt;br /&gt;
  }) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Hardware relevant =&lt;br /&gt;
&#039;&#039;&#039;gl.HasExtension&#039;&#039;&#039;&lt;br /&gt;
  ( string extname ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetNumber&#039;&#039;&#039;&lt;br /&gt;
  ( number ext, int count ) -&amp;gt; number [, number, number, ... #count ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetString&#039;&#039;&#039;&lt;br /&gt;
  ( number ext ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= DrawGroundPrimitives =&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundCircle&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z, number radius, number divs [, number slope ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: number divs is the number of sides the circle will have. the higher the smoother the circle (and more GPU intensive) &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundQuad&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: x1,z1,x2 &amp;amp; z2 are rounded, so don&#039;t use it for very small or moving objects. x and z are correspond to the coordinates displayed by the tooltip &amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number z1, number x2, number z2,&lt;br /&gt;
    [ boolean useNorm, &amp;lt;span class=warning&amp;gt;(does nothing!)&amp;lt;/span&amp;gt;&lt;br /&gt;
      [ number tu1, number tv1, number tu2, number tv2 |&lt;br /&gt;
        boolean useTextureCoord ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Queries =&lt;br /&gt;
&#039;&#039;&#039;gl.CreateQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; nil | userdata query&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.RunQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query, function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.GetQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil | number renderedFragments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Extended =&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexNames&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; { [1] = string texture, etc ... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexCoords&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;gets the texcoord of a 3do texture in the 3do texture atlas&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string 3doTextureName ) -&amp;gt; number xstart, number ystart, number xend, number yend&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeState&#039;&#039;&#039;&lt;br /&gt;
  ( number state [, boolean disable_state ], function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Calls glEnable(state) or glDisable(state) (if disable_state==true) and&amp;lt;br&amp;gt;then calls the lua_function and afterwards reverts the state.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetShadowMapParams&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; number xmid, number ymid, number p17, number p18&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMatrixData&#039;&#039;&#039;&lt;br /&gt;
  ( GL.PROJECTION [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( GL.MODELVIEW  [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i] &lt;br /&gt;
  ( GL.TEXTURE    [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( &amp;quot;shadow&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camera&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;caminv&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camprj&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;billboard&amp;quot; )             -&amp;gt; nil | number, etc.. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Flush&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Finish&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Shaders (GLSL) =&lt;br /&gt;
  [[Lua_GLSL_Api]]&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO&amp;diff=11252</id>
		<title>Lua FBO</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO&amp;diff=11252"/>
		<updated>2019-02-16T21:41:20Z</updated>

		<summary type="html">&lt;p&gt;Ivand: /* RBO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== FBO ==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateFBO&#039;&#039;&#039;&lt;br /&gt;
  ( [ table initialization ] ) -&amp;gt; userdata [[Lua_FBO#Userdata_FBO|fbo]]&lt;br /&gt;
&amp;lt;font color=darkgreen&amp;gt;&lt;br /&gt;
  initialization table can contain:&lt;br /&gt;
&lt;br /&gt;
    attachment ::= luaTex or RBO or nil or { luaTex [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ] ] }&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
      depth   = attachment,&lt;br /&gt;
      stencil = attachment,&lt;br /&gt;
      color0  = attachment,&lt;br /&gt;
      color1  = attachment,&lt;br /&gt;
      color2  = attachment,&lt;br /&gt;
      ..&lt;br /&gt;
      color15 = attachment,&lt;br /&gt;
      drawbuffers = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(This doesn&#039;t delete the attached objects!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.IsValidFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] ) -&amp;gt; boolean valid [, number [[Lua_ConstGL#FBO_Status|status]] ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] [, boolean identities ] , lua_function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeSetFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(Binds a FBO like gl.ActiveFBO() does, but you have to unbind it yourself!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default screenbuffer)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RawBindFBO&#039;&#039;&#039; &amp;lt;font color=darkblue&amp;gt; (Replaces UnsafeSetFBO starting from 104.0.1-1003-gb3e02a6 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] [, number rawFboId = 0] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default or specified via rawFboId numeric id of FBO)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; number previouslyBoundRawFboId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlitFBO&#039;&#039;&#039; &amp;lt;font color=red&amp;gt;needs GLEW_EXT_framebuffer_blit&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  ( fboSrc , int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    fboDst , int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Userdata FBO===&lt;br /&gt;
   &amp;lt;font color=darkgreen&amp;gt;attachment ::= luaTex or RBO or nil or { luaTex or RBO [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ]] }&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  write-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;fbo.depth&#039;&#039;&#039;   = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.stencil&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.color0&#039;&#039;&#039;  = attachment&lt;br /&gt;
     ..&lt;br /&gt;
    &#039;&#039;&#039;fbo.color15&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.drawbuffers&#039;&#039;&#039; = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    &#039;&#039;&#039;fbo.readbuffer&#039;&#039;&#039;  = GL_COLOR_ATTACHMENT0_EXT&lt;br /&gt;
&lt;br /&gt;
==RBO==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateRBO&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
    [ {&lt;br /&gt;
      target = GL_RENDERBUFFER_EXT,&lt;br /&gt;
      format = [[Lua_ConstGL#RBO_Formats|GL_RGBA]],&lt;br /&gt;
      multisample = boolean &amp;lt;font color=darkblue&amp;gt; (Added in 104.0.1-10XX-xxxxxxx maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    } ]) -&amp;gt; userdata [[Lua_FBO#Userdata_RBO|rbo]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteRBO&#039;&#039;&#039;&lt;br /&gt;
  ( rbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
===Userdata RBO===&lt;br /&gt;
  read-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;rbo.target&#039;&#039;&#039; = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.format&#039;&#039;&#039; = [[Lua_ConstGL#RBO_Formats|number]]&lt;br /&gt;
    &#039;&#039;&#039;rbo.xsize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.ysize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.valid&#039;&#039;&#039;  = boolean&lt;br /&gt;
    &#039;&#039;&#039;multisample&#039;&#039;&#039; = boolean &amp;lt;font color=darkblue&amp;gt; (Added in 104.0.1-10XX-xxxxxxx maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO&amp;diff=11251</id>
		<title>Lua FBO</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO&amp;diff=11251"/>
		<updated>2019-02-16T21:40:48Z</updated>

		<summary type="html">&lt;p&gt;Ivand: /* RBO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== FBO ==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateFBO&#039;&#039;&#039;&lt;br /&gt;
  ( [ table initialization ] ) -&amp;gt; userdata [[Lua_FBO#Userdata_FBO|fbo]]&lt;br /&gt;
&amp;lt;font color=darkgreen&amp;gt;&lt;br /&gt;
  initialization table can contain:&lt;br /&gt;
&lt;br /&gt;
    attachment ::= luaTex or RBO or nil or { luaTex [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ] ] }&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
      depth   = attachment,&lt;br /&gt;
      stencil = attachment,&lt;br /&gt;
      color0  = attachment,&lt;br /&gt;
      color1  = attachment,&lt;br /&gt;
      color2  = attachment,&lt;br /&gt;
      ..&lt;br /&gt;
      color15 = attachment,&lt;br /&gt;
      drawbuffers = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(This doesn&#039;t delete the attached objects!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.IsValidFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] ) -&amp;gt; boolean valid [, number [[Lua_ConstGL#FBO_Status|status]] ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] [, boolean identities ] , lua_function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeSetFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(Binds a FBO like gl.ActiveFBO() does, but you have to unbind it yourself!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default screenbuffer)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RawBindFBO&#039;&#039;&#039; &amp;lt;font color=darkblue&amp;gt; (Replaces UnsafeSetFBO starting from 104.0.1-1003-gb3e02a6 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] [, number rawFboId = 0] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default or specified via rawFboId numeric id of FBO)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; number previouslyBoundRawFboId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlitFBO&#039;&#039;&#039; &amp;lt;font color=red&amp;gt;needs GLEW_EXT_framebuffer_blit&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  ( fboSrc , int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    fboDst , int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Userdata FBO===&lt;br /&gt;
   &amp;lt;font color=darkgreen&amp;gt;attachment ::= luaTex or RBO or nil or { luaTex or RBO [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ]] }&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  write-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;fbo.depth&#039;&#039;&#039;   = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.stencil&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.color0&#039;&#039;&#039;  = attachment&lt;br /&gt;
     ..&lt;br /&gt;
    &#039;&#039;&#039;fbo.color15&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.drawbuffers&#039;&#039;&#039; = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    &#039;&#039;&#039;fbo.readbuffer&#039;&#039;&#039;  = GL_COLOR_ATTACHMENT0_EXT&lt;br /&gt;
&lt;br /&gt;
==RBO==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateRBO&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
    [ {&lt;br /&gt;
      target = GL_RENDERBUFFER_EXT,&lt;br /&gt;
      format = [[Lua_ConstGL#RBO_Formats|GL_RGBA]],&lt;br /&gt;
      multisample = [[boolean]] &amp;lt;font color=darkblue&amp;gt; (Added in 104.0.1-10XX-xxxxxxx maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
    } ]) -&amp;gt; userdata [[Lua_FBO#Userdata_RBO|rbo]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteRBO&#039;&#039;&#039;&lt;br /&gt;
  ( rbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
===Userdata RBO===&lt;br /&gt;
  read-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;rbo.target&#039;&#039;&#039; = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.format&#039;&#039;&#039; = [[Lua_ConstGL#RBO_Formats|number]]&lt;br /&gt;
    &#039;&#039;&#039;rbo.xsize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.ysize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.valid&#039;&#039;&#039;  = boolean&lt;br /&gt;
    &#039;&#039;&#039;multisample&#039;&#039;&#039; = boolean &amp;lt;font color=darkblue&amp;gt; (Added in 104.0.1-10XX-xxxxxxx maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO&amp;diff=11250</id>
		<title>Lua FBO</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO&amp;diff=11250"/>
		<updated>2019-02-16T21:39:03Z</updated>

		<summary type="html">&lt;p&gt;Ivand: multisample /* RBO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== FBO ==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateFBO&#039;&#039;&#039;&lt;br /&gt;
  ( [ table initialization ] ) -&amp;gt; userdata [[Lua_FBO#Userdata_FBO|fbo]]&lt;br /&gt;
&amp;lt;font color=darkgreen&amp;gt;&lt;br /&gt;
  initialization table can contain:&lt;br /&gt;
&lt;br /&gt;
    attachment ::= luaTex or RBO or nil or { luaTex [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ] ] }&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
      depth   = attachment,&lt;br /&gt;
      stencil = attachment,&lt;br /&gt;
      color0  = attachment,&lt;br /&gt;
      color1  = attachment,&lt;br /&gt;
      color2  = attachment,&lt;br /&gt;
      ..&lt;br /&gt;
      color15 = attachment,&lt;br /&gt;
      drawbuffers = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(This doesn&#039;t delete the attached objects!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.IsValidFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] ) -&amp;gt; boolean valid [, number [[Lua_ConstGL#FBO_Status|status]] ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] [, boolean identities ] , lua_function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeSetFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(Binds a FBO like gl.ActiveFBO() does, but you have to unbind it yourself!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default screenbuffer)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RawBindFBO&#039;&#039;&#039; &amp;lt;font color=darkblue&amp;gt; (Replaces UnsafeSetFBO starting from 104.0.1-1003-gb3e02a6 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] [, number rawFboId = 0] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default or specified via rawFboId numeric id of FBO)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; number previouslyBoundRawFboId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlitFBO&#039;&#039;&#039; &amp;lt;font color=red&amp;gt;needs GLEW_EXT_framebuffer_blit&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  ( fboSrc , int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    fboDst , int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Userdata FBO===&lt;br /&gt;
   &amp;lt;font color=darkgreen&amp;gt;attachment ::= luaTex or RBO or nil or { luaTex or RBO [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ]] }&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  write-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;fbo.depth&#039;&#039;&#039;   = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.stencil&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.color0&#039;&#039;&#039;  = attachment&lt;br /&gt;
     ..&lt;br /&gt;
    &#039;&#039;&#039;fbo.color15&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.drawbuffers&#039;&#039;&#039; = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    &#039;&#039;&#039;fbo.readbuffer&#039;&#039;&#039;  = GL_COLOR_ATTACHMENT0_EXT&lt;br /&gt;
&lt;br /&gt;
==RBO==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateRBO&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
    [ {&lt;br /&gt;
      target = GL_RENDERBUFFER_EXT,&lt;br /&gt;
      format = [[Lua_ConstGL#RBO_Formats|GL_RGBA]],&lt;br /&gt;
    } ]) -&amp;gt; userdata [[Lua_FBO#Userdata_RBO|rbo]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteRBO&#039;&#039;&#039;&lt;br /&gt;
  ( rbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
===Userdata RBO===&lt;br /&gt;
  read-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;rbo.target&#039;&#039;&#039; = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.format&#039;&#039;&#039; = [[Lua_ConstGL#RBO_Formats|number]]&lt;br /&gt;
    &#039;&#039;&#039;rbo.xsize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.ysize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.valid&#039;&#039;&#039;  = boolean&lt;br /&gt;
    &#039;&#039;&#039;multisample&#039;&#039;&#039; = boolean &amp;lt;font color=darkblue&amp;gt; (Added in 104.0.1-10XX-xxxxxxx maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO&amp;diff=11249</id>
		<title>Lua FBO</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_FBO&amp;diff=11249"/>
		<updated>2019-02-15T23:51:09Z</updated>

		<summary type="html">&lt;p&gt;Ivand: RawBindFBO change&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== FBO ==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateFBO&#039;&#039;&#039;&lt;br /&gt;
  ( [ table initialization ] ) -&amp;gt; userdata [[Lua_FBO#Userdata_FBO|fbo]]&lt;br /&gt;
&amp;lt;font color=darkgreen&amp;gt;&lt;br /&gt;
  initialization table can contain:&lt;br /&gt;
&lt;br /&gt;
    attachment ::= luaTex or RBO or nil or { luaTex [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ] ] }&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
      depth   = attachment,&lt;br /&gt;
      stencil = attachment,&lt;br /&gt;
      color0  = attachment,&lt;br /&gt;
      color1  = attachment,&lt;br /&gt;
      color2  = attachment,&lt;br /&gt;
      ..&lt;br /&gt;
      color15 = attachment,&lt;br /&gt;
      drawbuffers = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(This doesn&#039;t delete the attached objects!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.IsValidFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] ) -&amp;gt; boolean valid [, number [[Lua_ConstGL#FBO_Status|status]] ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveFBO&#039;&#039;&#039;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] ] [, boolean identities ] , lua_function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeSetFBO&#039;&#039;&#039; &amp;lt;font color=darkgreen&amp;gt;(Binds a FBO like gl.ActiveFBO() does, but you have to unbind it yourself!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default screenbuffer)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RawBindFBO&#039;&#039;&#039; &amp;lt;font color=darkblue&amp;gt; (Replaces UnsafeSetFBO starting from 104.0.1-1003-gb3e02a6 maintenance)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( nil [, number [[Lua_ConstGL#FBO_Targets|target]] = GL_FRAMEBUFFER_EXT ] [, number rawFboId = 0] ) -&amp;gt; nil &amp;lt;font color=darkgreen&amp;gt;(Bind default or specified via rawFboId numeric id of FBO)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( fbo [, number [[Lua_ConstGL#FBO_Targets|target]] = fbo.target ] ) -&amp;gt; number previouslyBoundRawFboId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlitFBO&#039;&#039;&#039; &amp;lt;font color=red&amp;gt;needs GLEW_EXT_framebuffer_blit&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  ( fboSrc , int x0Src,y0Src,x1Src,y1Src,&lt;br /&gt;
    fboDst , int x0Dst,y0Dst,x1Dst,y1Dst&lt;br /&gt;
    [, number mask = [[Lua_ConstGL#Clear_Bits|GL_COLOR_BUFFER_BIT]] [, number filter = GL_NEAREST ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Userdata FBO===&lt;br /&gt;
   &amp;lt;font color=darkgreen&amp;gt;attachment ::= luaTex or RBO or nil or { luaTex or RBO [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ]] }&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  write-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;fbo.depth&#039;&#039;&#039;   = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.stencil&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.color0&#039;&#039;&#039;  = attachment&lt;br /&gt;
     ..&lt;br /&gt;
    &#039;&#039;&#039;fbo.color15&#039;&#039;&#039; = attachment&lt;br /&gt;
    &#039;&#039;&#039;fbo.drawbuffers&#039;&#039;&#039; = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}&lt;br /&gt;
    &#039;&#039;&#039;fbo.readbuffer&#039;&#039;&#039;  = GL_COLOR_ATTACHMENT0_EXT&lt;br /&gt;
&lt;br /&gt;
==RBO==&lt;br /&gt;
&#039;&#039;&#039;gl.CreateRBO&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
    [ {&lt;br /&gt;
      target = GL_RENDERBUFFER_EXT,&lt;br /&gt;
      format = [[Lua_ConstGL#RBO_Formats|GL_RGBA]],&lt;br /&gt;
    } ]) -&amp;gt; userdata [[Lua_FBO#Userdata_RBO|rbo]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteRBO&#039;&#039;&#039;&lt;br /&gt;
  ( rbo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
===Userdata RBO===&lt;br /&gt;
  read-only methods are:&lt;br /&gt;
    &#039;&#039;&#039;rbo.target&#039;&#039;&#039; = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.format&#039;&#039;&#039; = [[Lua_ConstGL#RBO_Formats|number]]&lt;br /&gt;
    &#039;&#039;&#039;rbo.xsize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.ysize&#039;&#039;&#039;  = number&lt;br /&gt;
    &#039;&#039;&#039;rbo.valid&#039;&#039;&#039;  = boolean&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_VFS&amp;diff=12471</id>
		<title>Lua VFS</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_VFS&amp;diff=12471"/>
		<updated>2018-10-26T00:00:35Z</updated>

		<summary type="html">&lt;p&gt;Ivand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
= Modes =&lt;br /&gt;
&#039;&#039;&#039;VFS.RAW&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.MOD&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.MAP&#039;&#039;&#039;  {{new|104.0}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.BASE&#039;&#039;&#039;  {{new|104.0}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.MENU&#039;&#039;&#039;  {{new|104.0}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.ZIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.RAW_FIRST&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.ZIP_FIRST&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.RAW_ONLY&#039;&#039;&#039; &amp;lt;font color=#55ee99&amp;gt;(same as VFS.RAW)&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.ZIP_ONLY&#039;&#039;&#039; &amp;lt;font color=#55ee99&amp;gt;(same as VFS.ZIP)&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Files =&lt;br /&gt;
&#039;&#039;&#039;VFS.Include&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;(if enviroment=nil then use current one)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string &amp;quot;filename&amp;quot; [, table enviroment = nil [, number mode ] ] ) -&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;VFS.LoadFile&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;filename&amp;quot; [, number mode ] ) -&amp;gt; nil | string data&lt;br /&gt;
&#039;&#039;&#039;VFS.FileExists&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;filename&amp;quot; [, number mode ] ) -&amp;gt; boolean&lt;br /&gt;
&amp;lt;span class=note&amp;gt;example usage: if VFS.FileExists(&amp;quot;maps/Castles.sdz&amp;quot;) then ... end &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.DirList&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;directory&amp;quot; [, string &amp;quot;pattern&amp;quot; = &amp;quot;*&amp;quot;  [, number mode ] ] )&lt;br /&gt;
    -&amp;gt; { [1] = string filename, ... }&lt;br /&gt;
&#039;&#039;&#039;VFS.SubDirs&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;directory&amp;quot;, [, string &amp;quot;pattern&amp;quot; = &amp;quot;*&amp;quot;  [, number mode ] ] )&lt;br /&gt;
    -&amp;gt; { [1] = string subdir1, ... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.GetAvailableAIs&#039;&#039;&#039;&lt;br /&gt;
  ( [ string gameName] [, string mapName ] )&lt;br /&gt;
    -&amp;gt; { ai1, ai2, ... }&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Gets a list of all Spring AIs. The optional gameName and mapName parameters can be used to include game/map specific LuaAIs in the list.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.UseArchive&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;unsynced only!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string &amp;quot;filename&amp;quot; [, number mode ], lua_function [, arg1 [,arg2 ]] )&lt;br /&gt;
    -&amp;gt; result1,result2,... of the given lua_function&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Loads an archive &#039;&#039;&#039;temporarely&#039;&#039;&#039; in the VFS and then runs the given lua_function,&amp;lt;br&amp;gt;which can make usage of the files in the archive.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.MapArchive&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;unsynced only!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string &amp;quot;filename/modname of archive&amp;quot;, [string checksum of archive] )&lt;br /&gt;
    -&amp;gt; bool&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Permanently loads an archive into the VFS (to load zipped music collections etc.). &amp;lt;br&amp;gt; Does nothing if the archive is already loaded in the VFS (won&#039;t reload even if there are &amp;lt;br&amp;gt; changes made to the archive). If checksum is given it checks if the to be loaded file is correct,&amp;lt;br&amp;gt;if not then it won&#039;t load it and return false.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.UnmapArchive&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;unsynced only! available in 98.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string &amp;quot;filename/modname of archive&amp;quot;)&lt;br /&gt;
    -&amp;gt; bool&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Removes an already loaded archive (see VFS.MapArchive)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.CompressFolder&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;unsynced only!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string &amp;quot;folderPath&amp;quot; [, string &amp;quot;archiveType&amp;quot; ] [, string &amp;quot;compressedFilePath&amp;quot; ] &amp;lt;br&amp;gt; [, bool includeFolder ] [, number mode ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Compresses the specified folder. &amp;lt;br&amp;gt;archiveType defines the compression type which can currently be only &amp;quot;zip&amp;quot; &amp;lt;br&amp;gt;includeFolder specifies whether the archive should have the specified folder as root (defaults to false) &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Generic hash =&lt;br /&gt;
&#039;&#039;&#039;VFS.CalculateHash&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string input, number hashType)&lt;br /&gt;
    -&amp;gt; string md5hash&lt;br /&gt;
&lt;br /&gt;
Calculates hash (in base64 form) of a given string (with md5 support initially). Note supplying 0 (MD5) as hashType is mandatory&lt;br /&gt;
&lt;br /&gt;
= Archives =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.GetMaps&#039;&#039;&#039; {{new|98.0}}&lt;br /&gt;
  ( ) -&amp;gt; {&lt;br /&gt;
   [1] = string mapName, ...&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.GetGames&#039;&#039;&#039; {{new|98.0}}&lt;br /&gt;
  ( ) -&amp;gt; {&lt;br /&gt;
   [1] = string gameName, ...&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.GetAllArchives&#039;&#039;&#039; {{new|98.0}}&lt;br /&gt;
  ( ) -&amp;gt; {&lt;br /&gt;
   [1] = string archiveName, ...&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.HasArchive&#039;&#039;&#039; {{new|98.0}}&lt;br /&gt;
  ( string archiveName ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.GetArchiveInfo&#039;&#039;&#039; {{new|98.0}}&lt;br /&gt;
  ( string archiveName ) - &amp;gt;&lt;br /&gt;
     {        &lt;br /&gt;
          name = string,&lt;br /&gt;
          shortname = string,&lt;br /&gt;
          version = string,&lt;br /&gt;
          mutator = string,&lt;br /&gt;
          game = string,&lt;br /&gt;
          shortgame = string,&lt;br /&gt;
          description = string,&lt;br /&gt;
          mapfile = string,&lt;br /&gt;
          modtype = number,     &lt;br /&gt;
      }&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;modtype values:1=primary, 0=hidden, 3=map&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.GetArchiveChecksum&#039;&#039;&#039; {{new|98.0}}&lt;br /&gt;
  ( string archiveName ) -&amp;gt; string singleArchiveChecksum, string completeArchiveChecksum&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.GetArchiveDependencies&#039;&#039;&#039; {{new|98.0}}&lt;br /&gt;
  ( string archiveName ) -&amp;gt; { &lt;br /&gt;
    [1] = string archiveName, ... &lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.GetArchiveReplaces&#039;&#039;&#039; {{new|98.0}}&lt;br /&gt;
  ( string archiveName ) -&amp;gt; { &lt;br /&gt;
    [1] = string archiveName, ... &lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.DownloadArchive&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( name, category ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Category must be one of: map, game, engine.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.AbortDownload&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( id ) -&amp;gt; boolean foundAndRemoved&lt;br /&gt;
&lt;br /&gt;
Additional functions are available as part of the [[Lua_UnsyncedCtrl#.28Virtual-.29FileSystem|unsynced ctrl]].&lt;br /&gt;
&lt;br /&gt;
= Packing =&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot; style=&amp;quot;font-size:110%&amp;quot;&amp;gt;The Pack- and Unpack-functions are used to convert numbers-&amp;gt;strings and strings-&amp;gt;numbers.&lt;br /&gt;
So you can read a binary file and then convert the received strings back to numbers and the other way around. Also you can use it in combination with the SendLuaXYZMsg-functions.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.PackU8&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.PackU16&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.PackU32&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.PackS8&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.PackS16&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.PackS32&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.PackF32&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;arguments are:&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.PackX( number arg1, number arg2, number arg3, ... )&#039;&#039;&#039; -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.PackX( {[1]=number,[2]=number,..} )&#039;&#039;&#039; -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.UnpackU8&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.UnpackU16&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.UnpackU32&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.UnpackS8&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.UnpackS16&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.UnpackS32&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.UnpackF32&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;arguments are:&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.UnpackX( string &amp;quot;binary&amp;quot; [, number position = 1] [, number count] )&#039;&#039;&#039;&lt;br /&gt;
  -&amp;gt; number | table { [1]=number,[2]=number,.. }&lt;br /&gt;
&lt;br /&gt;
= Zlib =&lt;br /&gt;
&#039;&#039;&#039;VFS.ZlibCompress&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;unsynced only!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string &amp;quot;uncompressedStr&amp;quot; )&lt;br /&gt;
    -&amp;gt; nil | string &amp;quot;compressedStr&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VFS.ZlibDecompress&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;available in synced, too!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string &amp;quot;compressedStr&amp;quot; [, number uncompressed size = 65500] )&lt;br /&gt;
    -&amp;gt; nil | string &amp;quot;uncompressedStr&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11509</id>
		<title>Lua OpenGL Api</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11509"/>
		<updated>2018-09-17T06:39:51Z</updated>

		<summary type="html">&lt;p&gt;Ivand: /* Textures */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
= Spring =&lt;br /&gt;
&#039;&#039;&#039;gl.GetSun&#039;&#039;&#039;&lt;br /&gt;
  &amp;lt;font style=&amp;quot;font-size:90%&amp;quot;&amp;gt;()        -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;pos&amp;quot; ) -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;shadowDensity&amp;quot; [, &amp;quot;unit&amp;quot;] ) -&amp;gt; number shadowDensity&lt;br /&gt;
  ( &amp;quot;diffuse&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;ambient&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;specular&amp;quot;      [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetAtmosphere&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Sun|Spring.SetAtmosphere]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetWaterRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | string texName | number scalar | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetWaterParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMapRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetMapRenderingParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigScreen&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;used for Unit LODs&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number screenWidth, number screenDistance ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawMiniMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;argument new in 0.82+&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;boolean tansform = true&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SlaveMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( boolean mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( int px, int py, int sx, int sy ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetViewSizes&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number x, number y&lt;br /&gt;
&lt;br /&gt;
= Matrices &amp;amp; Viewport =&lt;br /&gt;
&#039;&#039;&#039;gl.Viewport&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;&#039;gl.Translate&#039;&#039;&#039;&lt;br /&gt;
  (number x, number y, number z) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scale&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rotate&#039;&#039;&#039;&lt;br /&gt;
  ( number angle, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Billboard&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Use this to draw 2d primitives in DrawWorld().&lt;br /&gt;
To render a 2D billboarded quad in the gameworld at world position x,y,z, you do the following (at a minimum; I am skipping blending / depthtesting) here:&lt;br /&gt;
  gl.PushMatrix()&lt;br /&gt;
  gl.Texture(read what you need here)&lt;br /&gt;
  gl.Translate(x,y,z)&lt;br /&gt;
  gl.Billboard()			&lt;br /&gt;
  gl.TexRect(x1,y1,x2,y2)&lt;br /&gt;
  gl.PopMatrix()&amp;lt;/span &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MatrixMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#MatrixMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadIdentity&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( 16 numbers or a [https://github.com/spring/spring/blob/develop/rts/Lua/LuaOpenGLUtils.cpp#L60 matrix name] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Ortho&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Frustum&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushPopMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ClipPlane&#039;&#039;&#039;&lt;br /&gt;
  ( int plane, &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: $plane can only be 1 or 2&amp;lt;/font&amp;gt;&lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number A, number B, number C, number D ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Clear =&lt;br /&gt;
&#039;&#039;&#039;gl.Clear&#039;&#039;&#039;&lt;br /&gt;
  ( GL.DEPTH_BUFFER_BIT [, number cleardepth] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.STENCIL_BUFFER_BIT [, int clearstencil] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.COLOR_BUFFER_BIT | GL.ACCUM_BUFFER_BIT [, number r, number g, number b, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SwapBuffers&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Available only in LuaMenu, meant for frame-limited LuaMenu&#039;s that want identical content in both buffers.&lt;br /&gt;
&lt;br /&gt;
= ResetState/Matrices =&lt;br /&gt;
&#039;&#039;&#039;gl.ResetState&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;DON&#039;T USE IT UNLESS YOU KNOW WHAT YOU ARE DOING! Each call-in has different default states, but this function resets all states to the states below no matter what!&amp;lt;/span&amp;gt;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  ShadeModel = GL.SMOOTH&lt;br /&gt;
  Scissor    = false&lt;br /&gt;
  Texture    = false&lt;br /&gt;
  Lighting    = false,&lt;br /&gt;
  ColorMask  = true, true, true, true&lt;br /&gt;
  DepthMask  = false&lt;br /&gt;
  DepthTest  = false  (GL.LEQUAL)&lt;br /&gt;
  Culling    = false  (GL.BACK)&lt;br /&gt;
  LogicOp    = false  (GL.INVERT)&lt;br /&gt;
  AlphaTest  = false  (GL.GREATER, 0.5f)&lt;br /&gt;
  Blending   = true (GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA)&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ResetMatrices&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  Resets GL.TEXTURE matrix stack&lt;br /&gt;
  Resets GL.MODELVIEW matrix stack&lt;br /&gt;
  Resets GL.PROJECTION matrix stack&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Draw Basics =&lt;br /&gt;
&#039;&#039;&#039;gl.BeginEnd&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Drawing_Primitives|GLType]], function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Color&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b[, number a] } |&lt;br /&gt;
      number r, number g, number b[, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Vertex&#039;&#039;&#039;&lt;br /&gt;
  ( { number x, number y [, number z [, number w ]] } |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Normal&#039;&#039;&#039;&lt;br /&gt;
  (  number x, number y, number z |&lt;br /&gt;
   { number x, number y, number z } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rect&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexRect&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;texture rect&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2,&lt;br /&gt;
  [ boolean flip_s, boolean flip_t | number s1, number t1, number s2, number t2 ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Shape&#039;&#039;&#039;&lt;br /&gt;
 ( number [[Lua_ConstGL#Drawing_Primitives|GLtype]],&lt;br /&gt;
   elements = {&lt;br /&gt;
     [1] = { v | vertex   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;required&amp;lt;/font&amp;gt;&lt;br /&gt;
             n | normal   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             t | texcoord = { number x, number y },                     &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             c | color    = { number r, number g, number b, number a }  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
     },&lt;br /&gt;
     etc ...&lt;br /&gt;
   }&lt;br /&gt;
 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SecondaryColor&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b } |&lt;br /&gt;
      number r, number g, number b ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FogCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Display Lists =&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Display Lists save given vertex attributes in a static buffer, so the GPU can directly read them (without the CPU). Display Lists are a lot faster (10-60x) than standard drawing with glShape/glBeginEnd, so try to use them when ever you can. If you want to learn more about them, g00gle is your friend ;)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateList&#039;&#039;&#039;&lt;br /&gt;
  ( function [,arg1 [,arg2...]] ) -&amp;gt; number listID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CallList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Text =&lt;br /&gt;
&#039;&#039;&#039;gl.Text&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;, number x, number y, number size [, string &amp;lt;span class=note&amp;gt;&amp;quot;options&amp;quot;&amp;lt;/span&amp;gt;] )&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
  options are:&lt;br /&gt;
    horizontal alignment:&lt;br /&gt;
       &#039;c&#039; = center&lt;br /&gt;
       &#039;r&#039; = right&lt;br /&gt;
    vertical alignment:&lt;br /&gt;
       &#039;a&#039; = ascender&lt;br /&gt;
       &#039;t&#039; = top&lt;br /&gt;
       &#039;v&#039; = vertical center&lt;br /&gt;
       &#039;x&#039; = baseline&lt;br /&gt;
       &#039;b&#039; = bottom&lt;br /&gt;
       &#039;d&#039; = descender&lt;br /&gt;
    decorations:&lt;br /&gt;
       &#039;o&#039; = black outline&lt;br /&gt;
       &#039;O&#039; = white outline&lt;br /&gt;
       &#039;s&#039; = shadow&lt;br /&gt;
    other:&lt;br /&gt;
       &#039;n&#039; = don&#039;t round vertex coords to nearest integer (font may get blurry)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
http://home.arcor.de/jkei/fontlines.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextWidth&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;) -&amp;gt; number width  &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextHeight&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;text&amp;quot; ) -&amp;gt; nil | number height, number descender, number numlines &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;further descriptions here: [[GetTextHeight]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&amp;lt;b&amp;gt;If you have multiple gl.Text calls, then you can bunch them between a gl.BeginText and gl.EndText to speedup the rendering.&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;gl.BeginText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.EndText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Unit/Feature Draw Functions =&lt;br /&gt;
&#039;&#039;&#039;gl.Unit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws an unit; on default it uses LOD, with lod&amp;lt;0 it is turned off, else it defines a specific level)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitRaw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(doesn&#039;t apply worldspace-&amp;gt;unit transformation! only works if &amp;lt;i&amp;gt;rawdraw&amp;lt;/i&amp;gt; is true )&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShape&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID, number teamID, bool rawState, bool toScreen, bool opaque ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|101.0}} The three extra boolean arguments make it so that calling only these functions is enough to get correctly rendered models; pass in &#039;false&#039; for the THIRD argument to get the fixed behavior, omit it or pass in &#039;true&#039; [default] to render with your own custom state instead. The FOURTH argument should be &#039;true&#039; if in DrawScreen and &#039;false&#039; (default) if in DrawWorld; any transforms for these two functions *MUST* include a gl.LoadIdentity call when argument #3 is false (whether they are used in DrawWorld or in DrawScreen) the FIFTH argument determines whether the model is drawn opaque (&#039;true&#039; [default]) or with translucency (&#039;false&#039;); only has an effect when argument #3 is false.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; unit space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(unit space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPiece&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the unit piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.UnitPieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Feature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureRaw&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShape&#039;&#039;&#039;&lt;br /&gt;
  ( number featureDefID, number teamID, bool custom, bool drawScreen, bool opaque  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; feature space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(feature space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePiece&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the Feature piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.FeaturePieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawListAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number listID, [ boolean midPos,&lt;br /&gt;
      number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
      number degrees, number rotX, number rotX, number rotZ ] ) -&amp;gt; nil &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawFuncAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean midPos, function [, arg1,... ]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= States (Blending,AlphaTest...) =&lt;br /&gt;
&#039;&#039;&#039;gl.Blending&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
  ( string &amp;lt;span class=note&amp;gt;mode&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99&amp;quot; | mode maybe:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.ONE, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha_add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;reset&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;color&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_COLOR, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;modulate&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.DST_COLOR, GL.ZERO&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;disable&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquation&#039;&#039;&#039;&lt;br /&gt;
  ( number mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquationSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number modeRGB, number modeAlpha ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcRGB]], number [[Lua_ConstGL#BlendingFactorDest|dstRGB]],  number [[Lua_ConstGL#BlendingFactorSrc|srcAlpha]], number [[Lua_ConstGL#BlendingFactorDest|dstAlpha]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.AlphaTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]], number threshold ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Culling&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#Culling|face]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthClamp&#039;&#039;&#039;  &amp;lt;span class=warning&amp;gt;not always available, needs GL.NV_depth_clamp!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ColorMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( boolean r, boolean g, boolean b, boolean a ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LogicOp&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#LogicOp|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Fog&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Smoothing&#039;&#039;&#039; {{removed|104.0}}&lt;br /&gt;
 ( (boolean enable | number POINT), &lt;br /&gt;
   (boolean enable | number LINE),&lt;br /&gt;
   (boolean enable | number POLYGON) ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
 ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scissor&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( int x, int y, int w, int h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LineStipple&#039;&#039;&#039;&lt;br /&gt;
  ( string any ) -&amp;gt; nil &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(use springs default line stipple)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
  ( int factor, number pattern ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number [[Lua_ConstGL#PolygonMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonOffset&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number factor, number units ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushAttrib&#039;&#039;&#039;&lt;br /&gt;
  ( [ number [[Lua_ConstGL#glPushAttrib.28.29_bits|attrib]] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopAttrib&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Stencil =&lt;br /&gt;
&#039;&#039;&#039;gl.StencilTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMask&#039;&#039;&#039;&lt;br /&gt;
  ( number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOp&#039;&#039;&#039;&lt;br /&gt;
  ( number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMaskSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOpSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= LineWidth &amp;amp; PointSize =&lt;br /&gt;
&#039;&#039;&#039;gl.LineWidth&#039;&#039;&#039;&lt;br /&gt;
  ( number width ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSize&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(values != 1 can break severely on ATI cards, see http://springrts.com/mantis/view.php?id=2390)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number size ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSprite&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable, [boolean coord_replace, boolean coord_origin_upper] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointParameter&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number v1, number v2, number v3, &lt;br /&gt;
    [ number sizeMin, number sizeMax, number sizeFade ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Textures =&lt;br /&gt;
&#039;&#039;&#039;gl.Texture&#039;&#039;&#039;&lt;br /&gt;
  ( [ number texNum, ] boolean enable | string &amp;lt;span class=note&amp;gt;name&amp;lt;/span&amp;gt; ) -&amp;gt; nil | boolean loaded&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;This is the only call-out that is needed to load and draw any texture in a Lua script. All you have to do is pass it a valid path to a valid png and it will use that image for drawing any subsequent textured rectangles. This is shown in the last line of the following list of valid strings for the name parameter.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99; text-align:left&amp;quot; |`name` may be:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | #12&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 12 buildpic&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %34:1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 34 s3o tex2 (:0-&amp;gt;tex1,:1-&amp;gt;tex2)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %-102:0&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = featureDef 102 s3o tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | !56&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = lua generated texture 56 (= return value of gl.CreateTexture)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units2&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shadow&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = shadowmap&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = specular cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(removed in the latest develop)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $reflection &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = reflection cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(can be mipmaped starting from 104.0.1-714-ga29177f. Set CubeTexGenerateMipMaps=1 in settings)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shading&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = ground shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $grass&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = grass shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $heightmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = heightmap (needs HeightMapTexture=1 set in spring config)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $minimap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = minimap texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = same as &amp;quot;$reflection&amp;quot; {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $sky_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = defined for SSMF maps that have a skyReflectModTex {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = auto generated normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF specular texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_distr&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat distribution texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat normals texture {{new|101.0}}, used as &amp;quot;$ssmf_splat_normals&amp;quot; or &amp;quot;$ssmf_splat_normals:X&amp;quot;, &#039;X&#039; can be a value between 0 and 3, defaults to 0 if &amp;quot;:X&amp;quot; is omitted&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_emission&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF emission texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_parallax&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF parallax texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = currently active info texture (los, airlos, radar, jammer)&amp;lt;br/&amp;gt; Note that textures contain no data until user switches to their respective modes and non-active textures are not updated in the background, so will go stale&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_losmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = los texture (L-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_mtlmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = metal map texture (F4-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_hgtmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = height map texture (F1-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_blkmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = blocking map texture (F2-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the map in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the map in view. {{new|95}} &amp;lt;br/&amp;gt;To translate this to world position coordinates, use:&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(vec3(gl_TexCoord[0].st, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x) * 2.0 - 1.0 ,1.0);&lt;br /&gt;
  worldpos.xyz = worldpos.xyz / worldpos.w; &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the models in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the models in view.  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | ${opt}:/LuaUI/images/image.png &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = load a texture from the VFS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
   possible ${opt}&#039;s are:&lt;br /&gt;
      &#039;n&#039; = nearest&lt;br /&gt;
      &#039;l&#039; = linear&lt;br /&gt;
      &#039;a&#039; = aniso&lt;br /&gt;
      &#039;i&#039; = invert&lt;br /&gt;
      &#039;g&#039; = greyed&lt;br /&gt;
      &#039;c&#039; = clamped&lt;br /&gt;
      &#039;b&#039; = border&lt;br /&gt;
      &#039;t%r,%g,%b&#039; = tint&lt;br /&gt;
      &#039;r%width,%height&#039; = resize&lt;br /&gt;
   The above ${opt}&#039;s are NOT available for .DDS textures! .dds will load faster than other image formats.&lt;br /&gt;
&lt;br /&gt;
    example: &amp;quot;:iac:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example: &amp;quot;:cr16,16:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example2: &amp;quot;:t1.0,0.5,0:/LuaUI/images/image.png&amp;quot;  (orange tint)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
  [ { &lt;br /&gt;
    [target     = number,] &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(like GL.TEXTURE_1D,GL.TEXTURE_2D,...)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [format     = number,]&lt;br /&gt;
    [min_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [mag_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [wrap_s     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_t     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_r     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [aniso      = number,]&lt;br /&gt;
    [border     = boolean,]&lt;br /&gt;
    [fbo        = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [fboDepth   = boolean] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  } ]&lt;br /&gt;
  ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTexture&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTextureFBO&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TextureInfo&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; nil | {&lt;br /&gt;
      xsize = number,&lt;br /&gt;
      ysize = number,&lt;br /&gt;
      alpha = boolean, //not used yet&lt;br /&gt;
      type  = number,  //not used yet&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
   the format of the texture string is the same as in gl.Texture()&lt;br /&gt;
&amp;lt;/font&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number x | &lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum,&lt;br /&gt;
    number x |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexGen&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexGen&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil       &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CopyToTexture&#039;&#039;&#039;&lt;br /&gt;
  (string texture, int xoff, int yoff, int x, int y, int w, int h &lt;br /&gt;
  [,number target,number level])-&amp;gt;nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderToTexture&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string fbotexture, lua_func ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GenerateMipmap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs glGenerateMipmapEXT!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
The following are primarily intended to be used in conjunction with&lt;br /&gt;
     gl.{Unit,Feature}(objID, ..., raw=true)&lt;br /&gt;
     gl.{Unit,Feature}Shape(defID, ..., raw=true)&lt;br /&gt;
and apply a model&#039;s default textures; easier than gl.Texture(&amp;quot;$%...&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
= PixelReadback =&lt;br /&gt;
&#039;&#039;&#039;gl.SaveImage&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h,&lt;br /&gt;
    string filename [, table {alpha=boolean, yflip=boolean, grayscale16bit=boolean} ] ) -&amp;gt; nil | boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;grayscale16bit is {{new|99.0}} and allows to save single color 16bit PNG&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ReadPixels&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h [, number format = GL.RGBA ] )&lt;br /&gt;
    -&amp;gt; nil &lt;br /&gt;
    | number r,[g,[b,[a]]] &lt;br /&gt;
    | table { { {1 = number r, 2 = number g, 3 = number b, 4 = number a}, ... }, ... }&lt;br /&gt;
&lt;br /&gt;
= Lights =&lt;br /&gt;
&#039;&#039;&#039;gl.Lighting&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ShadeModel&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#ShadeModel|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Light&#039;&#039;&#039;&lt;br /&gt;
  ( int light, &lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param1, number param2, number param3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Material&#039;&#039;&#039;&lt;br /&gt;
  ({&lt;br /&gt;
    ambient   = {number r, number g, number b[, number a]},&lt;br /&gt;
    diffuse   = {number r, number g, number b[, number a]},&lt;br /&gt;
    ambidiff  = {number r, number g, number b[, number a]},&lt;br /&gt;
    emission  = {number r, number g, number b[, number a]},&lt;br /&gt;
    specular  = {number r, number g, number b[, number a]},&lt;br /&gt;
    shininess = number specularExponent&lt;br /&gt;
  }) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Hardware relevant =&lt;br /&gt;
&#039;&#039;&#039;gl.HasExtension&#039;&#039;&#039;&lt;br /&gt;
  ( string extname ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetNumber&#039;&#039;&#039;&lt;br /&gt;
  ( number ext, int count ) -&amp;gt; number [, number, number, ... #count ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetString&#039;&#039;&#039;&lt;br /&gt;
  ( number ext ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= DrawGroundPrimitives =&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundCircle&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z, number radius, number divs [, number slope ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: number divs is the number of sides the circle will have. the higher the smoother the circle (and more GPU intensive) &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundQuad&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: x1,z1,x2 &amp;amp; z2 are rounded, so don&#039;t use it for very small or moving objects. x and z are correspond to the coordinates displayed by the tooltip &amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number z1, number x2, number z2,&lt;br /&gt;
    [ boolean useNorm, &amp;lt;span class=warning&amp;gt;(does nothing!)&amp;lt;/span&amp;gt;&lt;br /&gt;
      [ number tu1, number tv1, number tu2, number tv2 |&lt;br /&gt;
        boolean useTextureCoord ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Queries =&lt;br /&gt;
&#039;&#039;&#039;gl.CreateQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; nil | userdata query&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.RunQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query, function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.GetQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil | number renderedFragments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Extended =&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexNames&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; { [1] = string texture, etc ... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexCoords&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;gets the texcoord of a 3do texture in the 3do texture atlas&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string 3doTextureName ) -&amp;gt; number xstart, number ystart, number xend, number yend&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeState&#039;&#039;&#039;&lt;br /&gt;
  ( number state [, boolean disable_state ], function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Calls glEnable(state) or glDisable(state) (if disable_state==true) and&amp;lt;br&amp;gt;then calls the lua_function and afterwards reverts the state.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetShadowMapParams&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; number xmid, number ymid, number p17, number p18&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMatrixData&#039;&#039;&#039;&lt;br /&gt;
  ( GL.PROJECTION [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( GL.MODELVIEW  [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i] &lt;br /&gt;
  ( GL.TEXTURE    [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( &amp;quot;shadow&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camera&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;caminv&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camprj&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;billboard&amp;quot; )             -&amp;gt; nil | number, etc.. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Flush&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Finish&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Shaders (GLSL) =&lt;br /&gt;
  [[Lua_GLSL_Api]]&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11508</id>
		<title>Lua OpenGL Api</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_OpenGL_Api&amp;diff=11508"/>
		<updated>2018-09-17T06:32:30Z</updated>

		<summary type="html">&lt;p&gt;Ivand: /* Textures */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
= Spring =&lt;br /&gt;
&#039;&#039;&#039;gl.GetSun&#039;&#039;&#039;&lt;br /&gt;
  &amp;lt;font style=&amp;quot;font-size:90%&amp;quot;&amp;gt;()        -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;pos&amp;quot; ) -&amp;gt; number sunPosX, number sunPosY, number sunPosZ&lt;br /&gt;
  ( &amp;quot;shadowDensity&amp;quot; [, &amp;quot;unit&amp;quot;] ) -&amp;gt; number shadowDensity&lt;br /&gt;
  ( &amp;quot;diffuse&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;ambient&amp;quot;       [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&lt;br /&gt;
  ( &amp;quot;specular&amp;quot;      [, &amp;quot;unit&amp;quot;] ) -&amp;gt; nil | number r, number g, number b&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetAtmosphere&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Sun|Spring.SetAtmosphere]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetWaterRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | string texName | number scalar | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetWaterParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMapRendering&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name ) -&amp;gt; number r, number g, number b | boolean active | nil&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;See [[Lua_UnsyncedCtrl#Developers|Spring.SetMapRenderingParams]] for details.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigScreen&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;used for Unit LODs&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number screenWidth, number screenDistance ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawMiniMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;argument new in 0.82+&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;boolean tansform = true&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SlaveMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( boolean mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ConfigMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( int px, int py, int sx, int sy ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetViewSizes&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number x, number y&lt;br /&gt;
&lt;br /&gt;
= Matrices &amp;amp; Viewport =&lt;br /&gt;
&#039;&#039;&#039;gl.Viewport&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopMatrix&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;&#039;gl.Translate&#039;&#039;&#039;&lt;br /&gt;
  (number x, number y, number z) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scale&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rotate&#039;&#039;&#039;&lt;br /&gt;
  ( number angle, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Billboard&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Use this to draw 2d primitives in DrawWorld().&lt;br /&gt;
To render a 2D billboarded quad in the gameworld at world position x,y,z, you do the following (at a minimum; I am skipping blending / depthtesting) here:&lt;br /&gt;
  gl.PushMatrix()&lt;br /&gt;
  gl.Texture(read what you need here)&lt;br /&gt;
  gl.Translate(x,y,z)&lt;br /&gt;
  gl.Billboard()			&lt;br /&gt;
  gl.TexRect(x1,y1,x2,y2)&lt;br /&gt;
  gl.PopMatrix()&amp;lt;/span &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MatrixMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#MatrixMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadIdentity&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LoadMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( 16 numbers or a [https://github.com/spring/spring/blob/develop/rts/Lua/LuaOpenGLUtils.cpp#L60 matrix name] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Ortho&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Frustum&#039;&#039;&#039;&lt;br /&gt;
  ( number left, number right, number bottom, number top, number near, number far ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushPopMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( ?? ) -&amp;gt; ??&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ClipPlane&#039;&#039;&#039;&lt;br /&gt;
  ( int plane, &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: $plane can only be 1 or 2&amp;lt;/font&amp;gt;&lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number A, number B, number C, number D ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Clear =&lt;br /&gt;
&#039;&#039;&#039;gl.Clear&#039;&#039;&#039;&lt;br /&gt;
  ( GL.DEPTH_BUFFER_BIT [, number cleardepth] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.STENCIL_BUFFER_BIT [, int clearstencil] ) -&amp;gt; nil&lt;br /&gt;
  ( GL.COLOR_BUFFER_BIT | GL.ACCUM_BUFFER_BIT [, number r, number g, number b, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SwapBuffers&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Available only in LuaMenu, meant for frame-limited LuaMenu&#039;s that want identical content in both buffers.&lt;br /&gt;
&lt;br /&gt;
= ResetState/Matrices =&lt;br /&gt;
&#039;&#039;&#039;gl.ResetState&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;DON&#039;T USE IT UNLESS YOU KNOW WHAT YOU ARE DOING! Each call-in has different default states, but this function resets all states to the states below no matter what!&amp;lt;/span&amp;gt;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  ShadeModel = GL.SMOOTH&lt;br /&gt;
  Scissor    = false&lt;br /&gt;
  Texture    = false&lt;br /&gt;
  Lighting    = false,&lt;br /&gt;
  ColorMask  = true, true, true, true&lt;br /&gt;
  DepthMask  = false&lt;br /&gt;
  DepthTest  = false  (GL.LEQUAL)&lt;br /&gt;
  Culling    = false  (GL.BACK)&lt;br /&gt;
  LogicOp    = false  (GL.INVERT)&lt;br /&gt;
  AlphaTest  = false  (GL.GREATER, 0.5f)&lt;br /&gt;
  Blending   = true (GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA)&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ResetMatrices&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  Resets GL.TEXTURE matrix stack&lt;br /&gt;
  Resets GL.MODELVIEW matrix stack&lt;br /&gt;
  Resets GL.PROJECTION matrix stack&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Draw Basics =&lt;br /&gt;
&#039;&#039;&#039;gl.BeginEnd&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Drawing_Primitives|GLType]], function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Color&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b[, number a] } |&lt;br /&gt;
      number r, number g, number b[, number a] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Vertex&#039;&#039;&#039;&lt;br /&gt;
  ( { number x, number y [, number z [, number w ]] } |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Normal&#039;&#039;&#039;&lt;br /&gt;
  (  number x, number y, number z |&lt;br /&gt;
   { number x, number y, number z } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Rect&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexRect&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;texture rect&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number y1, number x2, number y2,&lt;br /&gt;
  [ boolean flip_s, boolean flip_t | number s1, number t1, number s2, number t2 ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Shape&#039;&#039;&#039;&lt;br /&gt;
 ( number [[Lua_ConstGL#Drawing_Primitives|GLtype]],&lt;br /&gt;
   elements = {&lt;br /&gt;
     [1] = { v | vertex   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;required&amp;lt;/font&amp;gt;&lt;br /&gt;
             n | normal   = { number x, number y, number z },           &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             t | texcoord = { number x, number y },                     &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
             c | color    = { number r, number g, number b, number a }  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;optional&amp;lt;/font&amp;gt;&lt;br /&gt;
     },&lt;br /&gt;
     etc ...&lt;br /&gt;
   }&lt;br /&gt;
 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SecondaryColor&#039;&#039;&#039;&lt;br /&gt;
  ( { number r, number g, number b } |&lt;br /&gt;
      number r, number g, number b ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FogCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Display Lists =&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Display Lists save given vertex attributes in a static buffer, so the GPU can directly read them (without the CPU). Display Lists are a lot faster (10-60x) than standard drawing with glShape/glBeginEnd, so try to use them when ever you can. If you want to learn more about them, g00gle is your friend ;)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateList&#039;&#039;&#039;&lt;br /&gt;
  ( function [,arg1 [,arg2...]] ) -&amp;gt; number listID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CallList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteList&#039;&#039;&#039;&lt;br /&gt;
  ( number listID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Text =&lt;br /&gt;
&#039;&#039;&#039;gl.Text&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;, number x, number y, number size [, string &amp;lt;span class=note&amp;gt;&amp;quot;options&amp;quot;&amp;lt;/span&amp;gt;] )&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
  options are:&lt;br /&gt;
    horizontal alignment:&lt;br /&gt;
       &#039;c&#039; = center&lt;br /&gt;
       &#039;r&#039; = right&lt;br /&gt;
    vertical alignment:&lt;br /&gt;
       &#039;a&#039; = ascender&lt;br /&gt;
       &#039;t&#039; = top&lt;br /&gt;
       &#039;v&#039; = vertical center&lt;br /&gt;
       &#039;x&#039; = baseline&lt;br /&gt;
       &#039;b&#039; = bottom&lt;br /&gt;
       &#039;d&#039; = descender&lt;br /&gt;
    decorations:&lt;br /&gt;
       &#039;o&#039; = black outline&lt;br /&gt;
       &#039;O&#039; = white outline&lt;br /&gt;
       &#039;s&#039; = shadow&lt;br /&gt;
    other:&lt;br /&gt;
       &#039;n&#039; = don&#039;t round vertex coords to nearest integer (font may get blurry)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
http://home.arcor.de/jkei/fontlines.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextWidth&#039;&#039;&#039;&lt;br /&gt;
  (string &amp;quot;text&amp;quot;) -&amp;gt; number width  &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetTextHeight&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;text&amp;quot; ) -&amp;gt; nil | number height, number descender, number numlines &amp;lt;span class=note&amp;gt;(in pixels, with a font size of 1.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;further descriptions here: [[GetTextHeight]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&amp;lt;b&amp;gt;If you have multiple gl.Text calls, then you can bunch them between a gl.BeginText and gl.EndText to speedup the rendering.&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;gl.BeginText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.EndText&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Unit/Feature Draw Functions =&lt;br /&gt;
&#039;&#039;&#039;gl.Unit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws an unit; on default it uses LOD, with lod&amp;lt;0 it is turned off, else it defines a specific level)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitRaw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(doesn&#039;t apply worldspace-&amp;gt;unit transformation! only works if &amp;lt;i&amp;gt;rawdraw&amp;lt;/i&amp;gt; is true )&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShape&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID, number teamID, bool rawState, bool toScreen, bool opaque ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|101.0}} The three extra boolean arguments make it so that calling only these functions is enough to get correctly rendered models; pass in &#039;false&#039; for the THIRD argument to get the fixed behavior, omit it or pass in &#039;true&#039; [default] to render with your own custom state instead. The FOURTH argument should be &#039;true&#039; if in DrawScreen and &#039;false&#039; (default) if in DrawWorld; any transforms for these two functions *MUST* include a gl.LoadIdentity call when argument #3 is false (whether they are used in DrawWorld or in DrawScreen) the FIFTH argument determines whether the model is drawn opaque (&#039;true&#039; [default]) or with translucency (&#039;false&#039;); only has an effect when argument #3 is false.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; unit space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMultMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(unit space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPiece&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the unit piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitPieceMatrix&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.UnitPieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Feature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureRaw&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, [ boolean rawdraw, int lod ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShape&#039;&#039;&#039;&lt;br /&gt;
  ( number featureDefID, number teamID, bool custom, bool drawScreen, bool opaque  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(world space -&amp;gt; feature space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMultMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(feature space -&amp;gt; piece space)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePiece&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(draws the Feature piece)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeaturePieceMatrix&#039;&#039;&#039; {{new|101.0}} &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(use gl.FeaturePieceMultMatrix instead!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, int piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawListAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number listID, [ boolean midPos,&lt;br /&gt;
      number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
      number degrees, number rotX, number rotX, number rotZ ] ) -&amp;gt; nil &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawFuncAtUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean midPos, function [, arg1,... ]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= States (Blending,AlphaTest...) =&lt;br /&gt;
&#039;&#039;&#039;gl.Blending&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
  ( string &amp;lt;span class=note&amp;gt;mode&amp;lt;/span&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99&amp;quot; | mode maybe:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.ONE, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha_add&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;alpha&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;reset&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;color&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_COLOR, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;modulate&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.DST_COLOR, GL.ZERO&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | &amp;quot;disable&amp;quot;&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquation&#039;&#039;&#039;&lt;br /&gt;
  ( number mode ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcmode]], number [[Lua_ConstGL#BlendingFactorDest|dstmode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendEquationSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number modeRGB, number modeAlpha ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.BlendFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#BlendingFactorSrc|srcRGB]], number [[Lua_ConstGL#BlendingFactorDest|dstRGB]],  number [[Lua_ConstGL#BlendingFactorSrc|srcAlpha]], number [[Lua_ConstGL#BlendingFactorDest|dstAlpha]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.AlphaTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]], number threshold ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#AlphaFunction and  DepthFunction|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Culling&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#Culling|face]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthClamp&#039;&#039;&#039;  &amp;lt;span class=warning&amp;gt;not always available, needs GL.NV_depth_clamp!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DepthMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ColorMask&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( boolean r, boolean g, boolean b, boolean a ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LogicOp&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number [[Lua_ConstGL#LogicOp|func]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Fog&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Smoothing&#039;&#039;&#039; {{removed|104.0}}&lt;br /&gt;
 ( (boolean enable | number POINT), &lt;br /&gt;
   (boolean enable | number LINE),&lt;br /&gt;
   (boolean enable | number POLYGON) ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.EdgeFlag&#039;&#039;&#039;&lt;br /&gt;
 ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Scissor&#039;&#039;&#039;&lt;br /&gt;
  ( boolean ) -&amp;gt; nil&lt;br /&gt;
  ( int x, int y, int w, int h ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.LineStipple&#039;&#039;&#039;&lt;br /&gt;
  ( string any ) -&amp;gt; nil &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(use springs default line stipple)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
  ( int factor, number pattern ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonMode&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number [[Lua_ConstGL#PolygonMode|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PolygonOffset&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable | number factor, number units ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PushAttrib&#039;&#039;&#039;&lt;br /&gt;
  ( [ number [[Lua_ConstGL#glPushAttrib.28.29_bits|attrib]] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PopAttrib&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Stencil =&lt;br /&gt;
&#039;&#039;&#039;gl.StencilTest&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMask&#039;&#039;&#039;&lt;br /&gt;
  ( number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFunc&#039;&#039;&#039;&lt;br /&gt;
  ( number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOp&#039;&#039;&#039;&lt;br /&gt;
  ( number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.StencilMaskSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilFuncSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number func, number ref, number mask ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.StencilOpSeparate&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;(needs openGL2.0!)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number [[Lua_ConstGL#Culling|face]], number fail, number zfail, number zpass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= LineWidth &amp;amp; PointSize =&lt;br /&gt;
&#039;&#039;&#039;gl.LineWidth&#039;&#039;&#039;&lt;br /&gt;
  ( number width ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSize&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(values != 1 can break severely on ATI cards, see http://springrts.com/mantis/view.php?id=2390)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number size ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointSprite&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable, [boolean coord_replace, boolean coord_origin_upper] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.PointParameter&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs openGL2.0!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number v1, number v2, number v3, &lt;br /&gt;
    [ number sizeMin, number sizeMax, number sizeFade ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Textures =&lt;br /&gt;
&#039;&#039;&#039;gl.Texture&#039;&#039;&#039;&lt;br /&gt;
  ( [ number texNum, ] boolean enable | string &amp;lt;span class=note&amp;gt;name&amp;lt;/span&amp;gt; ) -&amp;gt; nil | boolean loaded&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;This is the only call-out that is needed to load and draw any texture in a Lua script. All you have to do is pass it a valid path to a valid png and it will use that image for drawing any subsequent textured rectangles. This is shown in the last line of the following list of valid strings for the name parameter.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin-top: -5px; margin-left:5px&amp;quot;&lt;br /&gt;
! style=&amp;quot;color:#55ee99; text-align:left&amp;quot; |`name` may be:&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | #12&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 12 buildpic&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %34:1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = unitDef 34 s3o tex2 (:0-&amp;gt;tex1,:1-&amp;gt;tex2)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | %-102:0&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = featureDef 102 s3o tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | !56&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = lua generated texture 56 (= return value of gl.CreateTexture)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units1&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $units2&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = 3do textureatlas tex2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shadow&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = shadowmap&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = specular cube map &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(removed in the latest develop)&amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = reflection cube map&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $shading&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = ground shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $grass&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = grass shading texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $heightmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = heightmap (needs HeightMapTexture=1 set in spring config)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $minimap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = minimap texture&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = same as &amp;quot;$reflection&amp;quot; {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $sky_reflection&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = defined for SSMF maps that have a skyReflectModTex {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = auto generated normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF normals texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_specular&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF specular texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_distr&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat distribution texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_detail&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat detail texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_splat_normals&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF splat normals texture {{new|101.0}}, used as &amp;quot;$ssmf_splat_normals&amp;quot; or &amp;quot;$ssmf_splat_normals:X&amp;quot;, &#039;X&#039; can be a value between 0 and 3, defaults to 0 if &amp;quot;:X&amp;quot; is omitted&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_emission&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF emission texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $ssmf_parallax&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = SSMF parallax texture {{new|101.0}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = currently active info texture (los, airlos, radar, jammer)&amp;lt;br/&amp;gt; Note that textures contain no data until user switches to their respective modes and non-active textures are not updated in the background, so will go stale&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_losmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = los texture (L-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_mtlmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = metal map texture (F4-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_hgtmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = height map texture (F1-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $info_blkmap&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = blocking map texture (F2-view)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the map in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the map in view {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use) {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $map_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the map in view. {{new|95}} &amp;lt;br/&amp;gt;To translate this to world position coordinates, use:&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  vec4 worldpos= viewProjectionInv * vec4(vec3(gl_TexCoord[0].st, &lt;br /&gt;
  texture2D( map_gbuffer_zvaltex,gl_TexCoord[0].st ).x) * 2.0 - 1.0 ,1.0);&lt;br /&gt;
  worldpos.xyz = worldpos.xyz / worldpos.w; &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_normtex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the smoothed normals buffer of the models in view in world space coordinates (note that to get true normal vectors from it, you must multiply the vector by 2 and subtract 1)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_difftex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the diffuse texture buffer of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_spectex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the specular textures of the models in view  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_emittex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for emissive materials (bloom would be the canonical use)  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_misctex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = for arbitrary shader data  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | $model_gbuffer_zvaltex&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = contains the depth values (z-buffer) of the models in view.  {{new|95}}&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | ${opt}:/LuaUI/images/image.png &lt;br /&gt;
| style=&amp;quot;color:#55ee99&amp;quot; | = load a texture from the VFS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
   possible ${opt}&#039;s are:&lt;br /&gt;
      &#039;n&#039; = nearest&lt;br /&gt;
      &#039;l&#039; = linear&lt;br /&gt;
      &#039;a&#039; = aniso&lt;br /&gt;
      &#039;i&#039; = invert&lt;br /&gt;
      &#039;g&#039; = greyed&lt;br /&gt;
      &#039;c&#039; = clamped&lt;br /&gt;
      &#039;b&#039; = border&lt;br /&gt;
      &#039;t%r,%g,%b&#039; = tint&lt;br /&gt;
      &#039;r%width,%height&#039; = resize&lt;br /&gt;
   The above ${opt}&#039;s are NOT available for .DDS textures! .dds will load faster than other image formats.&lt;br /&gt;
&lt;br /&gt;
    example: &amp;quot;:iac:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example: &amp;quot;:cr16,16:/LuaUI/images/image.png&amp;quot;&lt;br /&gt;
    example2: &amp;quot;:t1.0,0.5,0:/LuaUI/images/image.png&amp;quot;  (orange tint)&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int xsize, int ysize,&lt;br /&gt;
  [ { &lt;br /&gt;
    [target     = number,] &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(like GL.TEXTURE_1D,GL.TEXTURE_2D,...)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [format     = number,]&lt;br /&gt;
    [min_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [mag_filter = [[Lua_ConstGL#Texture_Filtering|number]],]&lt;br /&gt;
    [wrap_s     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_t     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [wrap_r     = [[Lua_ConstGL#Texture_Clamping|number]],]&lt;br /&gt;
    [aniso      = number,]&lt;br /&gt;
    [border     = boolean,]&lt;br /&gt;
    [fbo        = boolean,] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
    [fboDepth   = boolean] &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  } ]&lt;br /&gt;
  ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTexture&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteTextureFBO&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TextureInfo&#039;&#039;&#039;&lt;br /&gt;
  ( string texture ) -&amp;gt; nil | {&lt;br /&gt;
      xsize = number,&lt;br /&gt;
      ysize = number,&lt;br /&gt;
      alpha = boolean, //not used yet&lt;br /&gt;
      type  = number,  //not used yet&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
   the format of the texture string is the same as in gl.Texture()&lt;br /&gt;
&amp;lt;/font&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( number x | &lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexCoord&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum,&lt;br /&gt;
    number x |&lt;br /&gt;
    number x, number y |&lt;br /&gt;
    number x, number y, number z |&lt;br /&gt;
    number x, number y, number z, number w |&lt;br /&gt;
    { number x [, number y [, number z [, number w ]]] } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexEnv&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Environment|target]], number [[Lua_ConstGL#Texture_Environment|pname]],&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Environment|value]] |&lt;br /&gt;
    number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.TexGen&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.MultiTexGen&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, number [[Lua_ConstGL#Texture_Generation|target]],&lt;br /&gt;
    boolean state |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number value |&lt;br /&gt;
    number [[Lua_ConstGL#Texture_Generation|pname]], number var1, number var2, number var3 ) -&amp;gt; nil       &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CopyToTexture&#039;&#039;&#039;&lt;br /&gt;
  (string texture, int xoff, int yoff, int x, int y, int w, int h &lt;br /&gt;
  [,number target,number level])-&amp;gt;nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.RenderToTexture&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs GLEW_EXT_framebuffer_object!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string fbotexture, lua_func ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GenerateMipmap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;(needs glGenerateMipmapEXT!)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string texture ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
The following are primarily intended to be used in conjunction with&lt;br /&gt;
     gl.{Unit,Feature}(objID, ..., raw=true)&lt;br /&gt;
     gl.{Unit,Feature}Shape(defID, ..., raw=true)&lt;br /&gt;
and apply a model&#039;s default textures; easier than gl.Texture(&amp;quot;$%...&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnitShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number unitDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.FeatureShapeTextures&#039;&#039;&#039; &lt;br /&gt;
  ( number featureDefID, boolean enable ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
= PixelReadback =&lt;br /&gt;
&#039;&#039;&#039;gl.SaveImage&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h,&lt;br /&gt;
    string filename [, table {alpha=boolean, yflip=boolean, grayscale16bit=boolean} ] ) -&amp;gt; nil | boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;grayscale16bit is {{new|99.0}} and allows to save single color 16bit PNG&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ReadPixels&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number w, number h [, number format = GL.RGBA ] )&lt;br /&gt;
    -&amp;gt; nil &lt;br /&gt;
    | number r,[g,[b,[a]]] &lt;br /&gt;
    | table { { {1 = number r, 2 = number g, 3 = number b, 4 = number a}, ... }, ... }&lt;br /&gt;
&lt;br /&gt;
= Lights =&lt;br /&gt;
&#039;&#039;&#039;gl.Lighting&#039;&#039;&#039;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ShadeModel&#039;&#039;&#039;&lt;br /&gt;
  ( number [[Lua_ConstGL#ShadeModel|mode]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Light&#039;&#039;&#039;&lt;br /&gt;
  ( int light, &lt;br /&gt;
  boolean enable |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param |&lt;br /&gt;
  number [[Lua_ConstGL#Light_Specification|pname]], number param1, number param2, number param3 ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Material&#039;&#039;&#039;&lt;br /&gt;
  ({&lt;br /&gt;
    ambient   = {number r, number g, number b[, number a]},&lt;br /&gt;
    diffuse   = {number r, number g, number b[, number a]},&lt;br /&gt;
    ambidiff  = {number r, number g, number b[, number a]},&lt;br /&gt;
    emission  = {number r, number g, number b[, number a]},&lt;br /&gt;
    specular  = {number r, number g, number b[, number a]},&lt;br /&gt;
    shininess = number specularExponent&lt;br /&gt;
  }) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Hardware relevant =&lt;br /&gt;
&#039;&#039;&#039;gl.HasExtension&#039;&#039;&#039;&lt;br /&gt;
  ( string extname ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetNumber&#039;&#039;&#039;&lt;br /&gt;
  ( number ext, int count ) -&amp;gt; number [, number, number, ... #count ]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetString&#039;&#039;&#039;&lt;br /&gt;
  ( number ext ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= DrawGroundPrimitives =&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundCircle&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z, number radius, number divs [, number slope ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: number divs is the number of sides the circle will have. the higher the smoother the circle (and more GPU intensive) &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DrawGroundQuad&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note: x1,z1,x2 &amp;amp; z2 are rounded, so don&#039;t use it for very small or moving objects. x and z are correspond to the coordinates displayed by the tooltip &amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number z1, number x2, number z2,&lt;br /&gt;
    [ boolean useNorm, &amp;lt;span class=warning&amp;gt;(does nothing!)&amp;lt;/span&amp;gt;&lt;br /&gt;
      [ number tu1, number tv1, number tu2, number tv2 |&lt;br /&gt;
        boolean useTextureCoord ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Queries =&lt;br /&gt;
&#039;&#039;&#039;gl.CreateQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; nil | userdata query&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.RunQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query, function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;gl.GetQuery&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs &amp;gt;=OpengGL2.0!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( userdata query ) -&amp;gt; nil | number renderedFragments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Extended =&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveTexture&#039;&#039;&#039;&lt;br /&gt;
  ( int texNum, function [, arg1,... ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexNames&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; { [1] = string texture, etc ... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetGlobalTexCoords&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;gets the texcoord of a 3do texture in the 3do texture atlas&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string 3doTextureName ) -&amp;gt; number xstart, number ystart, number xend, number yend&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UnsafeState&#039;&#039;&#039;&lt;br /&gt;
  ( number state [, boolean disable_state ], function, arg1, arg2, ... ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Calls glEnable(state) or glDisable(state) (if disable_state==true) and&amp;lt;br&amp;gt;then calls the lua_function and afterwards reverts the state.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetShadowMapParams&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; number xmid, number ymid, number p17, number p18&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetMatrixData&#039;&#039;&#039;&lt;br /&gt;
  ( GL.PROJECTION [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( GL.MODELVIEW  [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i] &lt;br /&gt;
  ( GL.TEXTURE    [, int i] ) -&amp;gt; nil | number, etc.. | number Matrix[i]&lt;br /&gt;
  ( &amp;quot;shadow&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camera&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;caminv&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;camprj&amp;quot; )                -&amp;gt; nil | number, etc.. &lt;br /&gt;
  ( &amp;quot;billboard&amp;quot; )             -&amp;gt; nil | number, etc.. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Flush&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Finish&#039;&#039;&#039;&lt;br /&gt;
  () -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Shaders (GLSL) =&lt;br /&gt;
  [[Lua_GLSL_Api]]&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_ConstGL&amp;diff=11200</id>
		<title>Lua ConstGL</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_ConstGL&amp;diff=11200"/>
		<updated>2018-08-13T18:04:33Z</updated>

		<summary type="html">&lt;p&gt;Ivand: Added a few recent exposed OpenGL constants&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
== Drawing Primitives ==&lt;br /&gt;
&#039;&#039;&#039;GL.POINTS&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINES&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE_LOOP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE_STRIP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TRIANGLES&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TRIANGLE_STRIP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TRIANGLE_FAN&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.QUADS&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.QUAD_STRIP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POLYGON&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PATCHES&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#0000ee&amp;quot;&amp;gt;Available for spring versions &amp;gt;= 104.0.1-596 (maintenance).&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BlendingFactorDest ==&lt;br /&gt;
&#039;&#039;&#039;GL.ZERO&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_SRC_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_SRC_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DST_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_DST_ALPHA&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== BlendingFactorSrc ==&lt;br /&gt;
&#039;&#039;&#039;GL.ZERO&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_SRC_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_SRC_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DST_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_DST_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DST_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_DST_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_ALPHA_SATURATE&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== AlphaFunction and DepthFunction ==&lt;br /&gt;
&#039;&#039;&#039;GL.NEVER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LESS&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EQUAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LEQUAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.GREATER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NOTEQUAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.GEQUAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ALWAYS&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== LogicOp ==&lt;br /&gt;
&#039;&#039;&#039;GL.CLEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.AND&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.AND_REVERSE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.COPY&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.AND_INVERTED&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NOOP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.XOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EQUIV&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.INVERT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OR_REVERSE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.COPY_INVERTED&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OR_INVERTED&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NAND&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SET&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Culling ==&lt;br /&gt;
&#039;&#039;&#039;GL.BACK&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FRONT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FRONT_AND_BACK&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== PolygonMode ==&lt;br /&gt;
&#039;&#039;&#039;GL.POINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FILL&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Clear Bits ==&lt;br /&gt;
&#039;&#039;&#039;GL.DEPTH_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ACCUM_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.STENCIL_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.COLOR_BUFFER_BIT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== ShadeModel ==&lt;br /&gt;
&#039;&#039;&#039;GL.FLAT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SMOOTH&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== MatrixMode ==&lt;br /&gt;
&#039;&#039;&#039;GL.MODELVIEW&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PROJECTION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Texture Filtering ==&lt;br /&gt;
&#039;&#039;&#039;GL.NEAREST&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NEAREST_MIPMAP_NEAREST&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINEAR_MIPMAP_NEAREST&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NEAREST_MIPMAP_LINEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINEAR_MIPMAP_LINEAR&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Texture Clamping ==&lt;br /&gt;
&#039;&#039;&#039;GL.REPEAT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.MIRRORED_REPEAT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.CLAMP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.CLAMP_TO_EDGE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.CLAMP_TO_BORDER&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Texture Environment ==&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_ENV&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_ENV_MODE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_ENV_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.MODULATE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DECAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.BLEND&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.REPLACE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;GL_TEXTURE_FILTER_CONTROL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL_TEXTURE_LOD_BIAS&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Texture Generation ==&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_GEN_MODE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EYE_PLANE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OBJECT_PLANE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EYE_LINEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OBJECT_LINEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPHERE_MAP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NORMAL_MAP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.REFLECTION_MAP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.S&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.T&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.R&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.Q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== glPushAttrib() bits ==&lt;br /&gt;
&#039;&#039;&#039;GL.CURRENT_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POINT_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POLYGON_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POLYGON_STIPPLE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PIXEL_MODE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LIGHTING_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FOG_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DEPTH_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ACCUM_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.STENCIL_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.VIEWPORT_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TRANSFORM_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ENABLE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.COLOR_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.HINT_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EVAL_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LIST_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SCISSOR_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ALL_ATTRIB_BITS&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== glHint() targets ==&lt;br /&gt;
&#039;&#039;&#039;GL.FOG_HINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE_SMOOTH_HINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POINT_SMOOTH_HINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POLYGON_SMOOTH_HINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PERSPECTIVE_CORRECTION_HINT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== glHint() modes ==&lt;br /&gt;
&#039;&#039;&#039;GL.DONT_CARE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FASTEST&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NICEST&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Light Specification ==&lt;br /&gt;
&#039;&#039;&#039;GL.AMBIENT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DIFFUSE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPECULAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POSITION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPOT_DIRECTION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPOT_EXPONENT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPOT_CUTOFF&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.CONSTANT_ATTENUATION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINEAR_ATTENUATION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.QUADRATIC_ATTENUATION&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Shader types ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;#0000ee&amp;quot;&amp;gt;Available for spring versions &amp;gt;= 104.0.1-596 (maintenance).&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.VERTEX_SHADER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TESS_CONTROL_SHADER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TESS_EVALUATION_SHADER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.GEOMETRY_SHADER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FRAGMENT_SHADER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Geometry shader parameters ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;#0000ee&amp;quot;&amp;gt;Available for spring versions &amp;gt;= 104.0.1-596 (maintenance).&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.GEOMETRY_INPUT_TYPE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.GEOMETRY_OUTPUT_TYPE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.GEOMETRY_VERTICES_OUT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tesselation control shader parameters ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;#0000ee&amp;quot;&amp;gt;Available for spring versions &amp;gt;= 104.0.1-596 (maintenance).&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PATCH_VERTICES&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PATCH_DEFAULT_OUTER_LEVEL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PATCH_DEFAULT_INNER_LEVEL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Usefull, but not included constants==&lt;br /&gt;
===Texture Formats===&lt;br /&gt;
  &#039;&#039;&#039;GL_RGBA16F_ARB&#039;&#039;&#039; = 0x881A&lt;br /&gt;
  &#039;&#039;&#039;GL_RGBA32F_ARB&#039;&#039;&#039; = 0x8814&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT&#039;&#039;&#039;   = 0x1902&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT16&#039;&#039;&#039; = 0x81A5&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT24&#039;&#039;&#039; = 0x81A6&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT32&#039;&#039;&#039; = 0x81A7&lt;br /&gt;
&lt;br /&gt;
===RBO Formats===&lt;br /&gt;
  &#039;&#039;&#039;GL_RGB&#039;&#039;&#039;             = 0x1907&lt;br /&gt;
  &#039;&#039;&#039;GL_RGBA&#039;&#039;&#039;            = 0x1908&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT&#039;&#039;&#039; = 0x1902&lt;br /&gt;
  &#039;&#039;&#039;GL_STENCIL_INDEX&#039;&#039;&#039;   = 0x1901&lt;br /&gt;
&lt;br /&gt;
===FBO Targets===&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_EXT&#039;&#039;&#039;      = 0x8D40&lt;br /&gt;
  &#039;&#039;&#039;GL_READ_FRAMEBUFFER_EXT&#039;&#039;&#039; = 0x8CA8&lt;br /&gt;
  &#039;&#039;&#039;GL_DRAW_FRAMEBUFFER_EXT&#039;&#039;&#039; = 0x8CA9&lt;br /&gt;
&lt;br /&gt;
===FBO Status===&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_COMPLETE_EXT&#039;&#039;&#039;                        = 0x8CD5&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT&#039;&#039;&#039;           = 0x8CD6&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT&#039;&#039;&#039;   = 0x8CD7&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT&#039;&#039;&#039; = 0x8CD8&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT&#039;&#039;&#039;           = 0x8CD9&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT&#039;&#039;&#039;              = 0x8CDA&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT&#039;&#039;&#039;          = 0x8CDB&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT&#039;&#039;&#039;          = 0x8CDC&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_UNSUPPORTED_EXT&#039;&#039;&#039;                     = 0x8CDD&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_STATUS_ERROR_EXT&#039;&#039;&#039;                    = 0x8CDE&lt;br /&gt;
&lt;br /&gt;
===FBO Attachments===&lt;br /&gt;
  &#039;&#039;&#039;GL_COLOR_ATTACHMENT0_EXT&#039;&#039;&#039;  = 0x8CE0&lt;br /&gt;
  ..&lt;br /&gt;
  &#039;&#039;&#039;GL_COLOR_ATTACHMENT15_EXT&#039;&#039;&#039; = 0x8CEF&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_ATTACHMENT_EXT&#039;&#039;&#039;   = 0x8D00&lt;br /&gt;
  &#039;&#039;&#039;GL_STENCIL_ATTACHMENT_EXT&#039;&#039;&#039; = 0x8D20&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_ConstGL&amp;diff=11199</id>
		<title>Lua ConstGL</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_ConstGL&amp;diff=11199"/>
		<updated>2018-08-13T17:51:25Z</updated>

		<summary type="html">&lt;p&gt;Ivand: /* Shader types */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
== Drawing Primitives ==&lt;br /&gt;
&#039;&#039;&#039;GL.POINTS&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINES&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE_LOOP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE_STRIP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TRIANGLES&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TRIANGLE_STRIP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TRIANGLE_FAN&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.QUADS&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.QUAD_STRIP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POLYGON&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PATCHES&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#0000ee&amp;quot;&amp;gt;Available for spring versions &amp;gt;= 104.0.1-596 (maintenance).&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BlendingFactorDest ==&lt;br /&gt;
&#039;&#039;&#039;GL.ZERO&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_SRC_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_SRC_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DST_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_DST_ALPHA&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== BlendingFactorSrc ==&lt;br /&gt;
&#039;&#039;&#039;GL.ZERO&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_SRC_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_SRC_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DST_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_DST_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DST_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_DST_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_ALPHA_SATURATE&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== AlphaFunction and DepthFunction ==&lt;br /&gt;
&#039;&#039;&#039;GL.NEVER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LESS&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EQUAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LEQUAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.GREATER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NOTEQUAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.GEQUAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ALWAYS&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== LogicOp ==&lt;br /&gt;
&#039;&#039;&#039;GL.CLEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.AND&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.AND_REVERSE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.COPY&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.AND_INVERTED&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NOOP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.XOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EQUIV&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.INVERT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OR_REVERSE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.COPY_INVERTED&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OR_INVERTED&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NAND&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SET&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Culling ==&lt;br /&gt;
&#039;&#039;&#039;GL.BACK&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FRONT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FRONT_AND_BACK&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== PolygonMode ==&lt;br /&gt;
&#039;&#039;&#039;GL.POINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FILL&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Clear Bits ==&lt;br /&gt;
&#039;&#039;&#039;GL.DEPTH_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ACCUM_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.STENCIL_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.COLOR_BUFFER_BIT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== ShadeModel ==&lt;br /&gt;
&#039;&#039;&#039;GL.FLAT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SMOOTH&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== MatrixMode ==&lt;br /&gt;
&#039;&#039;&#039;GL.MODELVIEW&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PROJECTION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Texture Filtering ==&lt;br /&gt;
&#039;&#039;&#039;GL.NEAREST&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NEAREST_MIPMAP_NEAREST&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINEAR_MIPMAP_NEAREST&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NEAREST_MIPMAP_LINEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINEAR_MIPMAP_LINEAR&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Texture Clamping ==&lt;br /&gt;
&#039;&#039;&#039;GL.REPEAT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.MIRRORED_REPEAT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.CLAMP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.CLAMP_TO_EDGE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.CLAMP_TO_BORDER&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Texture Environment ==&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_ENV&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_ENV_MODE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_ENV_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.MODULATE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DECAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.BLEND&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.REPLACE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;GL_TEXTURE_FILTER_CONTROL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL_TEXTURE_LOD_BIAS&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Texture Generation ==&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_GEN_MODE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EYE_PLANE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OBJECT_PLANE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EYE_LINEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OBJECT_LINEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPHERE_MAP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NORMAL_MAP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.REFLECTION_MAP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.S&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.T&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.R&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.Q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== glPushAttrib() bits ==&lt;br /&gt;
&#039;&#039;&#039;GL.CURRENT_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POINT_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POLYGON_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POLYGON_STIPPLE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PIXEL_MODE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LIGHTING_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FOG_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DEPTH_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ACCUM_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.STENCIL_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.VIEWPORT_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TRANSFORM_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ENABLE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.COLOR_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.HINT_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EVAL_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LIST_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SCISSOR_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ALL_ATTRIB_BITS&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== glHint() targets ==&lt;br /&gt;
&#039;&#039;&#039;GL.FOG_HINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE_SMOOTH_HINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POINT_SMOOTH_HINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POLYGON_SMOOTH_HINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PERSPECTIVE_CORRECTION_HINT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== glHint() modes ==&lt;br /&gt;
&#039;&#039;&#039;GL.DONT_CARE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FASTEST&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NICEST&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Light Specification ==&lt;br /&gt;
&#039;&#039;&#039;GL.AMBIENT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DIFFUSE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPECULAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POSITION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPOT_DIRECTION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPOT_EXPONENT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPOT_CUTOFF&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.CONSTANT_ATTENUATION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINEAR_ATTENUATION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.QUADRATIC_ATTENUATION&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Shader types ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;#0000ee&amp;quot;&amp;gt;Available for spring versions &amp;gt;= 104.0.1-596 (maintenance).&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.VERTEX_SHADER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TESS_CONTROL_SHADER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TESS_EVALUATION_SHADER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.GEOMETRY_SHADER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FRAGMENT_SHADER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Usefull, but not included constants==&lt;br /&gt;
===Texture Formats===&lt;br /&gt;
  &#039;&#039;&#039;GL_RGBA16F_ARB&#039;&#039;&#039; = 0x881A&lt;br /&gt;
  &#039;&#039;&#039;GL_RGBA32F_ARB&#039;&#039;&#039; = 0x8814&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT&#039;&#039;&#039;   = 0x1902&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT16&#039;&#039;&#039; = 0x81A5&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT24&#039;&#039;&#039; = 0x81A6&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT32&#039;&#039;&#039; = 0x81A7&lt;br /&gt;
&lt;br /&gt;
===RBO Formats===&lt;br /&gt;
  &#039;&#039;&#039;GL_RGB&#039;&#039;&#039;             = 0x1907&lt;br /&gt;
  &#039;&#039;&#039;GL_RGBA&#039;&#039;&#039;            = 0x1908&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT&#039;&#039;&#039; = 0x1902&lt;br /&gt;
  &#039;&#039;&#039;GL_STENCIL_INDEX&#039;&#039;&#039;   = 0x1901&lt;br /&gt;
&lt;br /&gt;
===FBO Targets===&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_EXT&#039;&#039;&#039;      = 0x8D40&lt;br /&gt;
  &#039;&#039;&#039;GL_READ_FRAMEBUFFER_EXT&#039;&#039;&#039; = 0x8CA8&lt;br /&gt;
  &#039;&#039;&#039;GL_DRAW_FRAMEBUFFER_EXT&#039;&#039;&#039; = 0x8CA9&lt;br /&gt;
&lt;br /&gt;
===FBO Status===&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_COMPLETE_EXT&#039;&#039;&#039;                        = 0x8CD5&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT&#039;&#039;&#039;           = 0x8CD6&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT&#039;&#039;&#039;   = 0x8CD7&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT&#039;&#039;&#039; = 0x8CD8&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT&#039;&#039;&#039;           = 0x8CD9&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT&#039;&#039;&#039;              = 0x8CDA&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT&#039;&#039;&#039;          = 0x8CDB&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT&#039;&#039;&#039;          = 0x8CDC&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_UNSUPPORTED_EXT&#039;&#039;&#039;                     = 0x8CDD&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_STATUS_ERROR_EXT&#039;&#039;&#039;                    = 0x8CDE&lt;br /&gt;
&lt;br /&gt;
===FBO Attachments===&lt;br /&gt;
  &#039;&#039;&#039;GL_COLOR_ATTACHMENT0_EXT&#039;&#039;&#039;  = 0x8CE0&lt;br /&gt;
  ..&lt;br /&gt;
  &#039;&#039;&#039;GL_COLOR_ATTACHMENT15_EXT&#039;&#039;&#039; = 0x8CEF&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_ATTACHMENT_EXT&#039;&#039;&#039;   = 0x8D00&lt;br /&gt;
  &#039;&#039;&#039;GL_STENCIL_ATTACHMENT_EXT&#039;&#039;&#039; = 0x8D20&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_ConstGL&amp;diff=11198</id>
		<title>Lua ConstGL</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_ConstGL&amp;diff=11198"/>
		<updated>2018-08-13T17:51:10Z</updated>

		<summary type="html">&lt;p&gt;Ivand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
== Drawing Primitives ==&lt;br /&gt;
&#039;&#039;&#039;GL.POINTS&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINES&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE_LOOP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE_STRIP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TRIANGLES&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TRIANGLE_STRIP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TRIANGLE_FAN&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.QUADS&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.QUAD_STRIP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POLYGON&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PATCHES&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#0000ee&amp;quot;&amp;gt;Available for spring versions &amp;gt;= 104.0.1-596 (maintenance).&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BlendingFactorDest ==&lt;br /&gt;
&#039;&#039;&#039;GL.ZERO&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_SRC_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_SRC_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DST_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_DST_ALPHA&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== BlendingFactorSrc ==&lt;br /&gt;
&#039;&#039;&#039;GL.ZERO&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_SRC_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_SRC_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DST_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_DST_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DST_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_DST_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_ALPHA_SATURATE&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== AlphaFunction and DepthFunction ==&lt;br /&gt;
&#039;&#039;&#039;GL.NEVER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LESS&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EQUAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LEQUAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.GREATER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NOTEQUAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.GEQUAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ALWAYS&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== LogicOp ==&lt;br /&gt;
&#039;&#039;&#039;GL.CLEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.AND&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.AND_REVERSE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.COPY&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.AND_INVERTED&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NOOP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.XOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EQUIV&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.INVERT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OR_REVERSE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.COPY_INVERTED&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OR_INVERTED&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NAND&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SET&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Culling ==&lt;br /&gt;
&#039;&#039;&#039;GL.BACK&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FRONT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FRONT_AND_BACK&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== PolygonMode ==&lt;br /&gt;
&#039;&#039;&#039;GL.POINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FILL&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Clear Bits ==&lt;br /&gt;
&#039;&#039;&#039;GL.DEPTH_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ACCUM_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.STENCIL_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.COLOR_BUFFER_BIT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== ShadeModel ==&lt;br /&gt;
&#039;&#039;&#039;GL.FLAT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SMOOTH&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== MatrixMode ==&lt;br /&gt;
&#039;&#039;&#039;GL.MODELVIEW&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PROJECTION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Texture Filtering ==&lt;br /&gt;
&#039;&#039;&#039;GL.NEAREST&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NEAREST_MIPMAP_NEAREST&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINEAR_MIPMAP_NEAREST&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NEAREST_MIPMAP_LINEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINEAR_MIPMAP_LINEAR&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Texture Clamping ==&lt;br /&gt;
&#039;&#039;&#039;GL.REPEAT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.MIRRORED_REPEAT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.CLAMP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.CLAMP_TO_EDGE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.CLAMP_TO_BORDER&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Texture Environment ==&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_ENV&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_ENV_MODE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_ENV_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.MODULATE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DECAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.BLEND&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.REPLACE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;GL_TEXTURE_FILTER_CONTROL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL_TEXTURE_LOD_BIAS&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Texture Generation ==&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_GEN_MODE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EYE_PLANE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OBJECT_PLANE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EYE_LINEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OBJECT_LINEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPHERE_MAP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NORMAL_MAP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.REFLECTION_MAP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.S&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.T&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.R&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.Q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== glPushAttrib() bits ==&lt;br /&gt;
&#039;&#039;&#039;GL.CURRENT_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POINT_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POLYGON_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POLYGON_STIPPLE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PIXEL_MODE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LIGHTING_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FOG_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DEPTH_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ACCUM_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.STENCIL_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.VIEWPORT_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TRANSFORM_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ENABLE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.COLOR_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.HINT_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EVAL_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LIST_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SCISSOR_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ALL_ATTRIB_BITS&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== glHint() targets ==&lt;br /&gt;
&#039;&#039;&#039;GL.FOG_HINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE_SMOOTH_HINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POINT_SMOOTH_HINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POLYGON_SMOOTH_HINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PERSPECTIVE_CORRECTION_HINT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== glHint() modes ==&lt;br /&gt;
&#039;&#039;&#039;GL.DONT_CARE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FASTEST&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NICEST&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Light Specification ==&lt;br /&gt;
&#039;&#039;&#039;GL.AMBIENT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DIFFUSE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPECULAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POSITION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPOT_DIRECTION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPOT_EXPONENT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPOT_CUTOFF&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.CONSTANT_ATTENUATION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINEAR_ATTENUATION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.QUADRATIC_ATTENUATION&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Shader types ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;#0000ee&amp;quot;&amp;gt;Available for spring versions &amp;gt;= 104.0.1-596 (maintenance).&amp;lt;/font&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.VERTEX_SHADER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TESS_CONTROL_SHADER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TESS_EVALUATION_SHADER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.GEOMETRY_SHADER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FRAGMENT_SHADER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Usefull, but not included constants==&lt;br /&gt;
===Texture Formats===&lt;br /&gt;
  &#039;&#039;&#039;GL_RGBA16F_ARB&#039;&#039;&#039; = 0x881A&lt;br /&gt;
  &#039;&#039;&#039;GL_RGBA32F_ARB&#039;&#039;&#039; = 0x8814&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT&#039;&#039;&#039;   = 0x1902&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT16&#039;&#039;&#039; = 0x81A5&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT24&#039;&#039;&#039; = 0x81A6&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT32&#039;&#039;&#039; = 0x81A7&lt;br /&gt;
&lt;br /&gt;
===RBO Formats===&lt;br /&gt;
  &#039;&#039;&#039;GL_RGB&#039;&#039;&#039;             = 0x1907&lt;br /&gt;
  &#039;&#039;&#039;GL_RGBA&#039;&#039;&#039;            = 0x1908&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT&#039;&#039;&#039; = 0x1902&lt;br /&gt;
  &#039;&#039;&#039;GL_STENCIL_INDEX&#039;&#039;&#039;   = 0x1901&lt;br /&gt;
&lt;br /&gt;
===FBO Targets===&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_EXT&#039;&#039;&#039;      = 0x8D40&lt;br /&gt;
  &#039;&#039;&#039;GL_READ_FRAMEBUFFER_EXT&#039;&#039;&#039; = 0x8CA8&lt;br /&gt;
  &#039;&#039;&#039;GL_DRAW_FRAMEBUFFER_EXT&#039;&#039;&#039; = 0x8CA9&lt;br /&gt;
&lt;br /&gt;
===FBO Status===&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_COMPLETE_EXT&#039;&#039;&#039;                        = 0x8CD5&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT&#039;&#039;&#039;           = 0x8CD6&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT&#039;&#039;&#039;   = 0x8CD7&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT&#039;&#039;&#039; = 0x8CD8&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT&#039;&#039;&#039;           = 0x8CD9&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT&#039;&#039;&#039;              = 0x8CDA&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT&#039;&#039;&#039;          = 0x8CDB&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT&#039;&#039;&#039;          = 0x8CDC&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_UNSUPPORTED_EXT&#039;&#039;&#039;                     = 0x8CDD&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_STATUS_ERROR_EXT&#039;&#039;&#039;                    = 0x8CDE&lt;br /&gt;
&lt;br /&gt;
===FBO Attachments===&lt;br /&gt;
  &#039;&#039;&#039;GL_COLOR_ATTACHMENT0_EXT&#039;&#039;&#039;  = 0x8CE0&lt;br /&gt;
  ..&lt;br /&gt;
  &#039;&#039;&#039;GL_COLOR_ATTACHMENT15_EXT&#039;&#039;&#039; = 0x8CEF&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_ATTACHMENT_EXT&#039;&#039;&#039;   = 0x8D00&lt;br /&gt;
  &#039;&#039;&#039;GL_STENCIL_ATTACHMENT_EXT&#039;&#039;&#039; = 0x8D20&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_ConstGL&amp;diff=11197</id>
		<title>Lua ConstGL</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_ConstGL&amp;diff=11197"/>
		<updated>2018-08-13T17:50:35Z</updated>

		<summary type="html">&lt;p&gt;Ivand: Added shader types&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
== Drawing Primitives ==&lt;br /&gt;
&#039;&#039;&#039;GL.POINTS&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINES&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE_LOOP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE_STRIP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TRIANGLES&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TRIANGLE_STRIP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TRIANGLE_FAN&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.QUADS&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.QUAD_STRIP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POLYGON&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PATCHES&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#0000ee&amp;quot;&amp;gt;Available for spring versions &amp;gt;= 104.0.1-596 (maintenance).&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BlendingFactorDest ==&lt;br /&gt;
&#039;&#039;&#039;GL.ZERO&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_SRC_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_SRC_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DST_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_DST_ALPHA&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== BlendingFactorSrc ==&lt;br /&gt;
&#039;&#039;&#039;GL.ZERO&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_SRC_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_SRC_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DST_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_DST_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DST_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_DST_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_ALPHA_SATURATE&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== AlphaFunction and DepthFunction ==&lt;br /&gt;
&#039;&#039;&#039;GL.NEVER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LESS&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EQUAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LEQUAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.GREATER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NOTEQUAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.GEQUAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ALWAYS&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== LogicOp ==&lt;br /&gt;
&#039;&#039;&#039;GL.CLEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.AND&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.AND_REVERSE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.COPY&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.AND_INVERTED&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NOOP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.XOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EQUIV&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.INVERT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OR_REVERSE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.COPY_INVERTED&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OR_INVERTED&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NAND&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SET&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Culling ==&lt;br /&gt;
&#039;&#039;&#039;GL.BACK&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FRONT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FRONT_AND_BACK&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== PolygonMode ==&lt;br /&gt;
&#039;&#039;&#039;GL.POINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FILL&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Clear Bits ==&lt;br /&gt;
&#039;&#039;&#039;GL.DEPTH_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ACCUM_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.STENCIL_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.COLOR_BUFFER_BIT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== ShadeModel ==&lt;br /&gt;
&#039;&#039;&#039;GL.FLAT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SMOOTH&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== MatrixMode ==&lt;br /&gt;
&#039;&#039;&#039;GL.MODELVIEW&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PROJECTION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Texture Filtering ==&lt;br /&gt;
&#039;&#039;&#039;GL.NEAREST&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NEAREST_MIPMAP_NEAREST&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINEAR_MIPMAP_NEAREST&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NEAREST_MIPMAP_LINEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINEAR_MIPMAP_LINEAR&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Texture Clamping ==&lt;br /&gt;
&#039;&#039;&#039;GL.REPEAT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.MIRRORED_REPEAT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.CLAMP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.CLAMP_TO_EDGE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.CLAMP_TO_BORDER&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Texture Environment ==&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_ENV&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_ENV_MODE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_ENV_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.MODULATE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DECAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.BLEND&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.REPLACE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;GL_TEXTURE_FILTER_CONTROL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL_TEXTURE_LOD_BIAS&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Texture Generation ==&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_GEN_MODE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EYE_PLANE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OBJECT_PLANE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EYE_LINEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OBJECT_LINEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPHERE_MAP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NORMAL_MAP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.REFLECTION_MAP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.S&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.T&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.R&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.Q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== glPushAttrib() bits ==&lt;br /&gt;
&#039;&#039;&#039;GL.CURRENT_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POINT_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POLYGON_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POLYGON_STIPPLE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PIXEL_MODE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LIGHTING_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FOG_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DEPTH_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ACCUM_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.STENCIL_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.VIEWPORT_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TRANSFORM_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ENABLE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.COLOR_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.HINT_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EVAL_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LIST_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SCISSOR_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ALL_ATTRIB_BITS&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== glHint() targets ==&lt;br /&gt;
&#039;&#039;&#039;GL.FOG_HINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE_SMOOTH_HINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POINT_SMOOTH_HINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POLYGON_SMOOTH_HINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PERSPECTIVE_CORRECTION_HINT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== glHint() modes ==&lt;br /&gt;
&#039;&#039;&#039;GL.DONT_CARE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FASTEST&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NICEST&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Light Specification ==&lt;br /&gt;
&#039;&#039;&#039;GL.AMBIENT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DIFFUSE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPECULAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POSITION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPOT_DIRECTION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPOT_EXPONENT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPOT_CUTOFF&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.CONSTANT_ATTENUATION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINEAR_ATTENUATION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.QUADRATIC_ATTENUATION&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Shader types == &amp;lt;font color=&amp;quot;#0000ee&amp;quot;&amp;gt;Available for spring versions &amp;gt;= 104.0.1-596 (maintenance).&amp;lt;/font&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.VERTEX_SHADER&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;GL.TESS_CONTROL_SHADER&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;GL.TESS_EVALUATION_SHADER&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;GL.GEOMETRY_SHADER&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;GL.FRAGMENT_SHADER&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Usefull, but not included constants==&lt;br /&gt;
===Texture Formats===&lt;br /&gt;
  &#039;&#039;&#039;GL_RGBA16F_ARB&#039;&#039;&#039; = 0x881A&lt;br /&gt;
  &#039;&#039;&#039;GL_RGBA32F_ARB&#039;&#039;&#039; = 0x8814&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT&#039;&#039;&#039;   = 0x1902&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT16&#039;&#039;&#039; = 0x81A5&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT24&#039;&#039;&#039; = 0x81A6&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT32&#039;&#039;&#039; = 0x81A7&lt;br /&gt;
&lt;br /&gt;
===RBO Formats===&lt;br /&gt;
  &#039;&#039;&#039;GL_RGB&#039;&#039;&#039;             = 0x1907&lt;br /&gt;
  &#039;&#039;&#039;GL_RGBA&#039;&#039;&#039;            = 0x1908&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT&#039;&#039;&#039; = 0x1902&lt;br /&gt;
  &#039;&#039;&#039;GL_STENCIL_INDEX&#039;&#039;&#039;   = 0x1901&lt;br /&gt;
&lt;br /&gt;
===FBO Targets===&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_EXT&#039;&#039;&#039;      = 0x8D40&lt;br /&gt;
  &#039;&#039;&#039;GL_READ_FRAMEBUFFER_EXT&#039;&#039;&#039; = 0x8CA8&lt;br /&gt;
  &#039;&#039;&#039;GL_DRAW_FRAMEBUFFER_EXT&#039;&#039;&#039; = 0x8CA9&lt;br /&gt;
&lt;br /&gt;
===FBO Status===&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_COMPLETE_EXT&#039;&#039;&#039;                        = 0x8CD5&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT&#039;&#039;&#039;           = 0x8CD6&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT&#039;&#039;&#039;   = 0x8CD7&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT&#039;&#039;&#039; = 0x8CD8&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT&#039;&#039;&#039;           = 0x8CD9&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT&#039;&#039;&#039;              = 0x8CDA&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT&#039;&#039;&#039;          = 0x8CDB&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT&#039;&#039;&#039;          = 0x8CDC&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_UNSUPPORTED_EXT&#039;&#039;&#039;                     = 0x8CDD&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_STATUS_ERROR_EXT&#039;&#039;&#039;                    = 0x8CDE&lt;br /&gt;
&lt;br /&gt;
===FBO Attachments===&lt;br /&gt;
  &#039;&#039;&#039;GL_COLOR_ATTACHMENT0_EXT&#039;&#039;&#039;  = 0x8CE0&lt;br /&gt;
  ..&lt;br /&gt;
  &#039;&#039;&#039;GL_COLOR_ATTACHMENT15_EXT&#039;&#039;&#039; = 0x8CEF&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_ATTACHMENT_EXT&#039;&#039;&#039;   = 0x8D00&lt;br /&gt;
  &#039;&#039;&#039;GL_STENCIL_ATTACHMENT_EXT&#039;&#039;&#039; = 0x8D20&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_ConstGL&amp;diff=11196</id>
		<title>Lua ConstGL</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_ConstGL&amp;diff=11196"/>
		<updated>2018-08-13T17:48:26Z</updated>

		<summary type="html">&lt;p&gt;Ivand: Added GL.PATCHES&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
== Drawing Primitives ==&lt;br /&gt;
&#039;&#039;&#039;GL.POINTS&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINES&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE_LOOP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE_STRIP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TRIANGLES&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TRIANGLE_STRIP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TRIANGLE_FAN&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.QUADS&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.QUAD_STRIP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POLYGON&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PATCHES&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#0000ee&amp;quot;&amp;gt;Available for spring versions &amp;gt;= 104.0.1-596 (maintenance).&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BlendingFactorDest ==&lt;br /&gt;
&#039;&#039;&#039;GL.ZERO&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_SRC_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_SRC_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DST_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_DST_ALPHA&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== BlendingFactorSrc ==&lt;br /&gt;
&#039;&#039;&#039;GL.ZERO&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_SRC_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_SRC_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DST_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_DST_ALPHA&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DST_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ONE_MINUS_DST_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SRC_ALPHA_SATURATE&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== AlphaFunction and DepthFunction ==&lt;br /&gt;
&#039;&#039;&#039;GL.NEVER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LESS&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EQUAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LEQUAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.GREATER&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NOTEQUAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.GEQUAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ALWAYS&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== LogicOp ==&lt;br /&gt;
&#039;&#039;&#039;GL.CLEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.AND&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.AND_REVERSE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.COPY&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.AND_INVERTED&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NOOP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.XOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EQUIV&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.INVERT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OR_REVERSE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.COPY_INVERTED&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OR_INVERTED&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NAND&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SET&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Culling ==&lt;br /&gt;
&#039;&#039;&#039;GL.BACK&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FRONT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FRONT_AND_BACK&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== PolygonMode ==&lt;br /&gt;
&#039;&#039;&#039;GL.POINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FILL&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Clear Bits ==&lt;br /&gt;
&#039;&#039;&#039;GL.DEPTH_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ACCUM_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.STENCIL_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.COLOR_BUFFER_BIT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== ShadeModel ==&lt;br /&gt;
&#039;&#039;&#039;GL.FLAT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SMOOTH&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== MatrixMode ==&lt;br /&gt;
&#039;&#039;&#039;GL.MODELVIEW&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PROJECTION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Texture Filtering ==&lt;br /&gt;
&#039;&#039;&#039;GL.NEAREST&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NEAREST_MIPMAP_NEAREST&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINEAR_MIPMAP_NEAREST&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NEAREST_MIPMAP_LINEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINEAR_MIPMAP_LINEAR&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Texture Clamping ==&lt;br /&gt;
&#039;&#039;&#039;GL.REPEAT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.MIRRORED_REPEAT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.CLAMP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.CLAMP_TO_EDGE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.CLAMP_TO_BORDER&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Texture Environment ==&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_ENV&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_ENV_MODE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_ENV_COLOR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.MODULATE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DECAL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.BLEND&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.REPLACE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;GL_TEXTURE_FILTER_CONTROL&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL_TEXTURE_LOD_BIAS&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Texture Generation ==&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_GEN_MODE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EYE_PLANE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OBJECT_PLANE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EYE_LINEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.OBJECT_LINEAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPHERE_MAP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NORMAL_MAP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.REFLECTION_MAP&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.S&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.T&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.R&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.Q&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== glPushAttrib() bits ==&lt;br /&gt;
&#039;&#039;&#039;GL.CURRENT_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POINT_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POLYGON_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POLYGON_STIPPLE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PIXEL_MODE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LIGHTING_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FOG_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DEPTH_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ACCUM_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.STENCIL_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.VIEWPORT_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TRANSFORM_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ENABLE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.COLOR_BUFFER_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.HINT_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.EVAL_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LIST_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.TEXTURE_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SCISSOR_BIT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.ALL_ATTRIB_BITS&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== glHint() targets ==&lt;br /&gt;
&#039;&#039;&#039;GL.FOG_HINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINE_SMOOTH_HINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POINT_SMOOTH_HINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POLYGON_SMOOTH_HINT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.PERSPECTIVE_CORRECTION_HINT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== glHint() modes ==&lt;br /&gt;
&#039;&#039;&#039;GL.DONT_CARE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.FASTEST&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.NICEST&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Light Specification ==&lt;br /&gt;
&#039;&#039;&#039;GL.AMBIENT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.DIFFUSE&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPECULAR&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.POSITION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPOT_DIRECTION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPOT_EXPONENT&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.SPOT_CUTOFF&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.CONSTANT_ATTENUATION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.LINEAR_ATTENUATION&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;GL.QUADRATIC_ATTENUATION&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Usefull, but not included constants==&lt;br /&gt;
===Texture Formats===&lt;br /&gt;
  &#039;&#039;&#039;GL_RGBA16F_ARB&#039;&#039;&#039; = 0x881A&lt;br /&gt;
  &#039;&#039;&#039;GL_RGBA32F_ARB&#039;&#039;&#039; = 0x8814&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT&#039;&#039;&#039;   = 0x1902&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT16&#039;&#039;&#039; = 0x81A5&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT24&#039;&#039;&#039; = 0x81A6&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT32&#039;&#039;&#039; = 0x81A7&lt;br /&gt;
&lt;br /&gt;
===RBO Formats===&lt;br /&gt;
  &#039;&#039;&#039;GL_RGB&#039;&#039;&#039;             = 0x1907&lt;br /&gt;
  &#039;&#039;&#039;GL_RGBA&#039;&#039;&#039;            = 0x1908&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_COMPONENT&#039;&#039;&#039; = 0x1902&lt;br /&gt;
  &#039;&#039;&#039;GL_STENCIL_INDEX&#039;&#039;&#039;   = 0x1901&lt;br /&gt;
&lt;br /&gt;
===FBO Targets===&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_EXT&#039;&#039;&#039;      = 0x8D40&lt;br /&gt;
  &#039;&#039;&#039;GL_READ_FRAMEBUFFER_EXT&#039;&#039;&#039; = 0x8CA8&lt;br /&gt;
  &#039;&#039;&#039;GL_DRAW_FRAMEBUFFER_EXT&#039;&#039;&#039; = 0x8CA9&lt;br /&gt;
&lt;br /&gt;
===FBO Status===&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_COMPLETE_EXT&#039;&#039;&#039;                        = 0x8CD5&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT&#039;&#039;&#039;           = 0x8CD6&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT&#039;&#039;&#039;   = 0x8CD7&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT&#039;&#039;&#039; = 0x8CD8&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT&#039;&#039;&#039;           = 0x8CD9&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT&#039;&#039;&#039;              = 0x8CDA&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT&#039;&#039;&#039;          = 0x8CDB&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT&#039;&#039;&#039;          = 0x8CDC&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_UNSUPPORTED_EXT&#039;&#039;&#039;                     = 0x8CDD&lt;br /&gt;
  &#039;&#039;&#039;GL_FRAMEBUFFER_STATUS_ERROR_EXT&#039;&#039;&#039;                    = 0x8CDE&lt;br /&gt;
&lt;br /&gt;
===FBO Attachments===&lt;br /&gt;
  &#039;&#039;&#039;GL_COLOR_ATTACHMENT0_EXT&#039;&#039;&#039;  = 0x8CE0&lt;br /&gt;
  ..&lt;br /&gt;
  &#039;&#039;&#039;GL_COLOR_ATTACHMENT15_EXT&#039;&#039;&#039; = 0x8CEF&lt;br /&gt;
  &#039;&#039;&#039;GL_DEPTH_ATTACHMENT_EXT&#039;&#039;&#039;   = 0x8D00&lt;br /&gt;
  &#039;&#039;&#039;GL_STENCIL_ATTACHMENT_EXT&#039;&#039;&#039; = 0x8D20&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_GLSL_Api&amp;diff=11323</id>
		<title>Lua GLSL Api</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_GLSL_Api&amp;diff=11323"/>
		<updated>2018-08-13T17:37:39Z</updated>

		<summary type="html">&lt;p&gt;Ivand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;These functions are ONLY available if the graphic board supports GLSL.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt; Please test in your scripts if one of them exists before you use them!&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateShader&#039;&#039;&#039;&lt;br /&gt;
  ({[ vertex   = &amp;quot;glsl code&amp;quot; ,]&lt;br /&gt;
    [ tcs      = &amp;quot;glsl code&amp;quot; ,]&lt;br /&gt;
    [ tes      = &amp;quot;glsl code&amp;quot; ,]&lt;br /&gt;
    [ geometry = &amp;quot;glsl code&amp;quot; ,]&lt;br /&gt;
    [ fragment = &amp;quot;glsl code&amp;quot; ,]&lt;br /&gt;
    [ uniform       = { uniformName = number value, ...} ,] &amp;lt;span class=note&amp;gt;(specify a Lua array as an argument to uniformName to initialize GLSL arrays)&amp;lt;/span&amp;gt;&lt;br /&gt;
    [ uniformInt    = { uniformName = number value, ...} ,] &amp;lt;span class=note&amp;gt;(specify a Lua array as an argument to uniformName to initialize GLSL arrays)&amp;lt;/span&amp;gt;&lt;br /&gt;
    [ uniformFloat  = { uniformName = number value, ...} ,] &amp;lt;span class=note&amp;gt;(specify a Lua array as an argument to uniformName to initialize GLSL arrays)&amp;lt;/span&amp;gt;&lt;br /&gt;
    [ uniformMatrix = { uniformName = number value, ...} ,]&lt;br /&gt;
    [ geoInputType = number inType,]&lt;br /&gt;
    [ geoOutputType = number outType,]&lt;br /&gt;
    [ geoOutputVerts = number maxVerts,]&lt;br /&gt;
    [ definitions = &amp;quot;string of shader #defines&amp;quot;, ]&lt;br /&gt;
  }) -&amp;gt; number shaderID&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;Vertex&amp;quot; or vertex-shader is your GLSL-Code as string, its written in a C-Dialect. This shader is busy deforming the geometry of a unit but it can not create new polygons. Use it for waves, wobbling surfaces etc.&lt;br /&gt;
 &lt;br /&gt;
* The &amp;quot;Geometry&amp;quot; or Geometry-shader can create new vertices and vertice-stripes from points. &lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;TCS&amp;quot; or Tesselation Control Shader controls how much tessellation a particular patch gets; it also defines the size of a patch, thus allowing it to augment data. It can also filter vertex data taken from the vertex shader. The main purpose of the TCS is to feed the tessellation levels to the Tessellation primitive generator stage, as well as to feed patch data (as its output values) to the Tessellation Evaluation Shader stage. TCS shader can be used with spring version &amp;gt;= 104.0.1-596 (maintenance), it&#039;s also available in develop branch of spring.&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;TES&amp;quot; or Tesselation Evaluation Shader takes the abstract patch generated by the tessellation primitive generation stage, as well as the actual vertex data for the entire patch, and generates a particular vertex from it. Each TES invocation generates a single vertex. It can also take per-patch data provided by the Tessellation Control Shader. TES shader can be used with spring version &amp;gt;= 104.0.1-596 (maintenance), it&#039;s also available in develop branch of spring.&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;Fragment&amp;quot; or Fragment-shader (sometimes called pixel-Shader) is post processing the allready rendered picture (for example drawing stars on the sky)- remember textures are not always 2 dimensional pictures. They can contain information about the depth, or the third value marks areas and the strength at which these are processed.&lt;br /&gt;
&lt;br /&gt;
* The Uniforms are the values, you send along with the shader-program. To use them in the shader-program declare them like this: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;uniform float frame;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From 101.0 onwards, the engine will automatically fill in an appropriately named uniform for team colour if it is declared;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;uniform vec4 teamColor;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteShader&#039;&#039;&#039;&lt;br /&gt;
  ( number shaderID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveShader&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;can be used in none drawing events (to update uniforms etc.)!&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number shaderID, function [, arg1 [, arg2, ..]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UseShader&#039;&#039;&#039;&lt;br /&gt;
  ( number shaderID ) -&amp;gt; boolean linked&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetShaderLog&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; string &amp;quot;infoLog&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SetShaderParameter&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;font color=&amp;quot;#ff0000&amp;quot;&amp;gt;Renamed to SetGeometryShaderParameter in spring version &amp;gt;= 104.0.1-596 (maintenance).&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;needed by geometry shader programs (check the opengl GL_ARB_geometry_shader4 extension for glProgramParameteri)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number shaderID, number param, number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SetTesselationShaderParameter&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;font color=&amp;quot;#0000ee&amp;quot;&amp;gt;Available for spring versions &amp;gt;= 104.0.1-596 (maintenance).&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;needed by tesselation shader programs (check the opengl GL_ARB_tessellation_shader extension for glProgramParameteri)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number param, number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetActiveUniforms&#039;&#039;&#039;&lt;br /&gt;
  ( number shaderID ) -&amp;gt; { &lt;br /&gt;
      [1] = { name = &amp;quot;name&amp;quot;, type = &amp;quot;type&amp;quot;, length = number length, size = number size },&lt;br /&gt;
      ...&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetUniformLocation&#039;&#039;&#039;&lt;br /&gt;
  ( number shaderID, name uniformName ) -&amp;gt; number locationID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Uniform&#039;&#039;&#039;&lt;br /&gt;
  ( number locationID, number f1 [,number f2 [,number f3 [,number f4]]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UniformInt&#039;&#039;&#039;&lt;br /&gt;
  ( number locationID, number int1 [,number int2 [,number int3 [,number int4]]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UniformArray&#039;&#039;&#039; {{new|95.0}}&lt;br /&gt;
  ( number locationID, number type, table uniforms ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;type can be one of {1 = int, 2 = float, 3 = float matrix}. In 104.0 the maximum length of the uniforms table increased from 32 entries to 1024.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UniformMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( number locationID, &lt;br /&gt;
    &amp;quot;shadow&amp;quot; |&lt;br /&gt;
    &amp;quot;camera&amp;quot; |&lt;br /&gt;
    &amp;quot;caminv&amp;quot; |&lt;br /&gt;
    &amp;quot;camprj&amp;quot; |&lt;br /&gt;
    number m1, number m2, number m3, number m4 |&lt;br /&gt;
    number m1, ... , number m9 |&lt;br /&gt;
    number m1, ... , number m16&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_GLSL_Api&amp;diff=11322</id>
		<title>Lua GLSL Api</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_GLSL_Api&amp;diff=11322"/>
		<updated>2018-08-13T17:36:50Z</updated>

		<summary type="html">&lt;p&gt;Ivand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;These functions are ONLY available if the graphic board supports GLSL.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt; Please test in your scripts if one of them exists before you use them!&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateShader&#039;&#039;&#039;&lt;br /&gt;
  ({[ vertex   = &amp;quot;glsl code&amp;quot; ,]&lt;br /&gt;
    [ tcs      = &amp;quot;glsl code&amp;quot; ,]&lt;br /&gt;
    [ tes      = &amp;quot;glsl code&amp;quot; ,]&lt;br /&gt;
    [ geometry = &amp;quot;glsl code&amp;quot; ,]&lt;br /&gt;
    [ fragment = &amp;quot;glsl code&amp;quot; ,]&lt;br /&gt;
    [ uniform       = { uniformName = number value, ...} ,] &amp;lt;span class=note&amp;gt;(specify a Lua array as an argument to uniformName to initialize GLSL arrays)&amp;lt;/span&amp;gt;&lt;br /&gt;
    [ uniformInt    = { uniformName = number value, ...} ,] &amp;lt;span class=note&amp;gt;(specify a Lua array as an argument to uniformName to initialize GLSL arrays)&amp;lt;/span&amp;gt;&lt;br /&gt;
    [ uniformFloat  = { uniformName = number value, ...} ,] &amp;lt;span class=note&amp;gt;(specify a Lua array as an argument to uniformName to initialize GLSL arrays)&amp;lt;/span&amp;gt;&lt;br /&gt;
    [ uniformMatrix = { uniformName = number value, ...} ,]&lt;br /&gt;
    [ geoInputType = number inType,]&lt;br /&gt;
    [ geoOutputType = number outType,]&lt;br /&gt;
    [ geoOutputVerts = number maxVerts,]&lt;br /&gt;
    [ definitions = &amp;quot;string of shader #defines&amp;quot;, ]&lt;br /&gt;
  }) -&amp;gt; number shaderID&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;Vertex&amp;quot; or vertex-shader is your GLSL-Code as string, its written in a C-Dialect. This shader is busy deforming the geometry of a unit but it can not create new polygons. Use it for waves, wobbling surfaces etc.&lt;br /&gt;
 &lt;br /&gt;
* The &amp;quot;Geometry&amp;quot; or Geometry-shader can create new vertices and vertice-stripes from points. &lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;TCS&amp;quot; or Tesselation Control Shader controls how much tessellation a particular patch gets; it also defines the size of a patch, thus allowing it to augment data. It can also filter vertex data taken from the vertex shader. The main purpose of the TCS is to feed the tessellation levels to the Tessellation primitive generator stage, as well as to feed patch data (as its output values) to the Tessellation Evaluation Shader stage. TCS shader can be used with spring version &amp;gt;= 104.0.1-596 (maintenance), it&#039;s also available in develop branch of spring.&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;TES&amp;quot; or Tesselation Evaluation Shader takes the abstract patch generated by the tessellation primitive generation stage, as well as the actual vertex data for the entire patch, and generates a particular vertex from it. Each TES invocation generates a single vertex. It can also take per-patch data provided by the Tessellation Control Shader. TES shader can be used with spring version &amp;gt;= 104.0.1-596 (maintenance), it&#039;s also available in develop branch of spring.&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;Fragment&amp;quot; or Fragment-shader (sometimes called pixel-Shader) is post processing the allready rendered picture (for example drawing stars on the sky)- remember textures are not always 2 dimensional pictures. They can contain information about the depth, or the third value marks areas and the strength at which these are processed.&lt;br /&gt;
&lt;br /&gt;
* The Uniforms are the values, you send along with the shader-program. To use them in the shader-program declare them like this: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;uniform float frame;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From 101.0 onwards, the engine will automatically fill in an appropriately named uniform for team colour if it is declared;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;uniform vec4 teamColor;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteShader&#039;&#039;&#039;&lt;br /&gt;
  ( number shaderID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveShader&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;can be used in none drawing events (to update uniforms etc.)!&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number shaderID, function [, arg1 [, arg2, ..]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UseShader&#039;&#039;&#039;&lt;br /&gt;
  ( number shaderID ) -&amp;gt; boolean linked&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetShaderLog&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; string &amp;quot;infoLog&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SetShaderParameter&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;font color=&amp;quot;#ff0000&amp;quot;&amp;gt;Renamed to SetGeometryShaderParameter in spring version &amp;gt;= 104.0.1-596 (maintenance).&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;needed by geometry shader programs (check the opengl GL_ARB_geometry_shader4 extension for glProgramParameteri)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number shaderID, number param, number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SetTesselationShaderParameter&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;font color=&amp;quot;#0000ee&amp;quot;&amp;gt;Available for spring versions &amp;gt;= 104.0.1-596 (maintenance).&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;needed by tesselation shader programs (check the opengl GL_ARB_tessellation_shader extension for glProgramParameteri)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number param, number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetActiveUniforms&#039;&#039;&#039;&lt;br /&gt;
  ( number shaderID ) -&amp;gt; { &lt;br /&gt;
      [1] = { name = &amp;quot;name&amp;quot;, type = &amp;quot;type&amp;quot;, length = number length, size = number size },&lt;br /&gt;
      ...&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetUniformLocation&#039;&#039;&#039;&lt;br /&gt;
  ( number shaderID, name uniformName ) -&amp;gt; number locationID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Uniform&#039;&#039;&#039;&lt;br /&gt;
  ( number locationID, number f1 [,number f2 [,number f3 [,number f4]]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UniformInt&#039;&#039;&#039;&lt;br /&gt;
  ( number locationID, number int1 [,number int2 [,number int3 [,number int4]]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UniformArray&#039;&#039;&#039; {{new|95.0}}&lt;br /&gt;
  ( number locationID, number type, table uniforms ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;type can be one of {1 = int, 2 = float}. In 104.0 the maximum length of the uniforms table increased from 32 entries to 1024.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UniformMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( number locationID, &lt;br /&gt;
    &amp;quot;shadow&amp;quot; |&lt;br /&gt;
    &amp;quot;camera&amp;quot; |&lt;br /&gt;
    &amp;quot;caminv&amp;quot; |&lt;br /&gt;
    &amp;quot;camprj&amp;quot; |&lt;br /&gt;
    number m1, number m2, number m3, number m4 |&lt;br /&gt;
    number m1, ... , number m9 |&lt;br /&gt;
    number m1, ... , number m16&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_GLSL_Api&amp;diff=11321</id>
		<title>Lua GLSL Api</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_GLSL_Api&amp;diff=11321"/>
		<updated>2018-08-12T14:23:07Z</updated>

		<summary type="html">&lt;p&gt;Ivand: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;These functions are ONLY available if the graphic board supports GLSL.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt; Please test in your scripts if one of them exists before you use them!&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.CreateShader&#039;&#039;&#039;&lt;br /&gt;
  ({[ vertex   = &amp;quot;glsl code&amp;quot; ,]&lt;br /&gt;
    [ tcs      = &amp;quot;glsl code&amp;quot; ,]&lt;br /&gt;
    [ tes      = &amp;quot;glsl code&amp;quot; ,]&lt;br /&gt;
    [ geometry = &amp;quot;glsl code&amp;quot; ,]&lt;br /&gt;
    [ fragment = &amp;quot;glsl code&amp;quot; ,]&lt;br /&gt;
    [ uniform       = { uniformName = number value, ...} ,] &amp;lt;span class=note&amp;gt;(specify a Lua array as an argument to uniformName to initialize GLSL arrays)&amp;lt;/span&amp;gt;&lt;br /&gt;
    [ uniformInt    = { uniformName = number value, ...} ,] &amp;lt;span class=note&amp;gt;(specify a Lua array as an argument to uniformName to initialize GLSL arrays)&amp;lt;/span&amp;gt;&lt;br /&gt;
    [ uniformFloat  = { uniformName = number value, ...} ,] &amp;lt;span class=note&amp;gt;(specify a Lua array as an argument to uniformName to initialize GLSL arrays)&amp;lt;/span&amp;gt;&lt;br /&gt;
    [ uniformMatrix = { uniformName = number value, ...} ,]&lt;br /&gt;
    [ geoInputType = number inType,]&lt;br /&gt;
    [ geoOutputType = number outType,]&lt;br /&gt;
    [ geoOutputVerts = number maxVerts,]&lt;br /&gt;
    [ definitions = &amp;quot;string of shader #defines&amp;quot;, ]&lt;br /&gt;
  }) -&amp;gt; number shaderID&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;Vertex&amp;quot; or vertex-shader is your GLSL-Code as string, its written in a C-Dialect. This shader is busy deforming the geometry of a unit but it can not create new polygons. Use it for waves, wobbling surfaces etc.&lt;br /&gt;
 &lt;br /&gt;
* The &amp;quot;Geometry&amp;quot; or Geometry-shader can create new vertices and vertice-stripes from points. &lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;TCS&amp;quot; or Tesselation Control Shader controls how much tessellation a particular patch gets; it also defines the size of a patch, thus allowing it to augment data. It can also filter vertex data taken from the vertex shader. The main purpose of the TCS is to feed the tessellation levels to the Tessellation primitive generator stage, as well as to feed patch data (as its output values) to the Tessellation Evaluation Shader stage. TCS shader can be used with spring version &amp;gt;= 104.0.1-596 (maintenance), it&#039;s also available in develop branch of spring.&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;TES&amp;quot; or Tesselation Evaluation Shader takes the abstract patch generated by the tessellation primitive generation stage, as well as the actual vertex data for the entire patch, and generates a particular vertex from it. Each TES invocation generates a single vertex. It can also take per-patch data provided by the Tessellation Control Shader. TES shader can be used with spring version &amp;gt;= 104.0.1-596 (maintenance), it&#039;s also available in develop branch of spring.&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;Fragment&amp;quot; or Fragment-shader (sometimes called pixel-Shader) is post processing the allready rendered picture (for example drawing stars on the sky)- remember textures are not always 2 dimensional pictures. They can contain information about the depth, or the third value marks areas and the strength at which these are processed.&lt;br /&gt;
&lt;br /&gt;
* The Uniforms are the values, you send along with the shader-program. To use them in the shader-program declare them like this: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;uniform float frame;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From 101.0 onwards, the engine will automatically fill in an appropriately named uniform for team colour if it is declared;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;uniform vec4 teamColor;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.DeleteShader&#039;&#039;&#039;&lt;br /&gt;
  ( number shaderID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.ActiveShader&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;can be used in none drawing events (to update uniforms etc.)!&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number shaderID, function [, arg1 [, arg2, ..]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UseShader&#039;&#039;&#039;&lt;br /&gt;
  ( number shaderID ) -&amp;gt; boolean linked&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetShaderLog&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; string &amp;quot;infoLog&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SetShaderParameter&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;font color=&amp;quot;#ff0000&amp;quot;&amp;gt;Renamed to SetGeometryShaderParameter in spring version &amp;gt;= 104.0.1-596 (maintenance).&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;needed by geometry shader programs (check the opengl GL_ARB_geometry_shader4 extension for glProgramParameteri)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number shaderID, number param, number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.SetTesselationShaderParameter&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;font color=&amp;quot;#0000ee&amp;quot;&amp;gt;Available for spring versions &amp;gt;= 104.0.1-596 (maintenance).&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;needed by tesselation shader programs (check the opengl GL_ARB_tessellation_shader extension for glProgramParameteri)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number param, number value ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetActiveUniforms&#039;&#039;&#039;&lt;br /&gt;
  ( number shaderID ) -&amp;gt; { &lt;br /&gt;
      [1] = { name = &amp;quot;name&amp;quot;, type = &amp;quot;type&amp;quot;, length = number length, size = number size },&lt;br /&gt;
      ...&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.GetUniformLocation&#039;&#039;&#039;&lt;br /&gt;
  ( number shaderID, name uniformName ) -&amp;gt; number locationID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.Uniform&#039;&#039;&#039;&lt;br /&gt;
  ( number locationID, number f1 [,number f2 [,number f3 [,number f4]]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UniformInt&#039;&#039;&#039;&lt;br /&gt;
  ( number locationID, number int1 [,number int2 [,number int3 [,number int4]]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UniformArray&#039;&#039;&#039; {{new|95.0}}&lt;br /&gt;
  ( number locationID, number type, table uniforms ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;type can be one of {0 = int, 1 = float}. In 104.0 the maximum length of the uniforms table increased from 32 entries to 1024.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gl.UniformMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( number locationID, &lt;br /&gt;
    &amp;quot;shadow&amp;quot; |&lt;br /&gt;
    &amp;quot;camera&amp;quot; |&lt;br /&gt;
    &amp;quot;caminv&amp;quot; |&lt;br /&gt;
    &amp;quot;camprj&amp;quot; |&lt;br /&gt;
    number m1, number m2, number m3, number m4 |&lt;br /&gt;
    number m1, ... , number m9 |&lt;br /&gt;
    number m1, ... , number m16&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Ivand</name></author>
	</entry>
</feed>