<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.fightorder.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Lua_GLSL_Api</id>
	<title>Lua GLSL Api - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.fightorder.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Lua_GLSL_Api"/>
	<link rel="alternate" type="text/html" href="https://www.fightorder.net/wiki/index.php?title=Lua_GLSL_Api&amp;action=history"/>
	<updated>2026-04-21T04:34:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://www.fightorder.net/wiki/index.php?title=Lua_GLSL_Api&amp;diff=1134&amp;oldid=prev</id>
		<title>Qrow: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://www.fightorder.net/wiki/index.php?title=Lua_GLSL_Api&amp;diff=1134&amp;oldid=prev"/>
		<updated>2026-02-24T05:52:50Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:52, 23 February 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Qrow</name></author>
	</entry>
	<entry>
		<id>https://www.fightorder.net/wiki/index.php?title=Lua_GLSL_Api&amp;diff=1133&amp;oldid=prev</id>
		<title>luainter&gt;Beherith at 11:15, 3 June 2022</title>
		<link rel="alternate" type="text/html" href="https://www.fightorder.net/wiki/index.php?title=Lua_GLSL_Api&amp;diff=1133&amp;oldid=prev"/>
		<updated>2022-06-03T11:15:24Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
These functions are ONLY available if the graphics adapter 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. In headless mode, the gl. callouts are nil.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = gl.&lt;br /&gt;
|name = CreateShader&lt;br /&gt;
|arg1 = {{type|table}} shaderParams&lt;br /&gt;
|arg2 =&lt;br /&gt;
|arg3 =&lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|number}} shaderID &lt;br /&gt;
|info = Create a shader from shaderParams table:&lt;br /&gt;
&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;
  })&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&amp;#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&amp;#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;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = gl.&lt;br /&gt;
|name = DeleteShader&lt;br /&gt;
|arg1 = {{type|number}} shaderID&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 =&lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&lt;br /&gt;
|info = Deletes a shader identified by shaderID&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = gl.&lt;br /&gt;
|name = ActiveShader&lt;br /&gt;
|arg1 = {{type|number}} shaderID&lt;br /&gt;
|arg2 = {{type|function}} func {{bracket}}&lt;br /&gt;
|arg3 = {{type|arg1}} {{bracket}}&lt;br /&gt;
|arg4 = {{type|arg2}} ... {{rbracket}}  {{rbracket}}&lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&lt;br /&gt;
|info = Binds a shader program identified by shaderID, and calls the Lua func with the specified arguments. Can be used in NON-drawing events (to update uniforms etc.)!&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = gl.&lt;br /&gt;
|name = UseShader&lt;br /&gt;
|arg1 = {{type|number}} shaderID&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|bool}} linked&lt;br /&gt;
|info = Binds a shader program identified by shaderID. Pass 0 to disable the shader. Returns wether the shader was successfully bound. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = gl.&lt;br /&gt;
|name = GetShaderLog&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|string}} infoLog&lt;br /&gt;
|info = Returns the shader compilation error log. This is empty if the shader linking failed, in that case, check your in/out blocks and ensure they match. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = gl.&lt;br /&gt;
|name = SetGeometryShaderParameter &lt;br /&gt;
|arg1 = {{type|number}} shaderID&lt;br /&gt;
|arg2 = {{type|number}} param&lt;br /&gt;
|arg3 = {{type|number}} number&lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&lt;br /&gt;
|info = Sets the Geometry shader parameters for shaderID. Needed by geometry shader programs (check the opengl GL_ARB_geometry_shader4 extension for glProgramParameteri) &amp;lt;br&amp;gt; Was called SetShaderParameter before  104.0.1-596 (maintenance)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = gl.&lt;br /&gt;
|name = SetTesselationShaderParameter&lt;br /&gt;
|arg1 = {{type|number}} param&lt;br /&gt;
|arg2 = {{type|number}} number&lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&lt;br /&gt;
|info = Sets the tesselation shader parameters for shaderID. Needed by tesselation shader programs (check the opengl GL_ARB_tessellation_shader extension for glProgramParameteri) &amp;lt;br&amp;gt; Introduced in 104.0.1-596 (maintenance)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = gl.&lt;br /&gt;
|name = GetActiveUniforms&lt;br /&gt;
|arg1 = {{type|number}} shaderID&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|table}} ActiveUniforms = { { name = &amp;quot;name&amp;quot;, type = &amp;quot;type&amp;quot;, length = number length, size = number size }, ...}&lt;br /&gt;
|info = Query the active (actually used) uniforms of a shader and identify their names, types (float, int, uint) and sizes (float, vec4, ...). &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = gl.&lt;br /&gt;
|name = GetUniformLocation&lt;br /&gt;
|arg1 = {{type|number}} shaderID&lt;br /&gt;
|arg2 = {{type|string}} &amp;quot;name&amp;quot;&lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|number}} locationID&lt;br /&gt;
|info = Returns the locationID of a shaders uniform. Needed for changing uniform values with gl.Uniform.  &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = gl.&lt;br /&gt;
|name = Uniform&lt;br /&gt;
|arg1 = {{type|number}} locationID &lt;br /&gt;
|arg2 = {{type|number }} f1 {{bracket}}&lt;br /&gt;
|arg3 = {{type|number }} f2 {{bracket}}&lt;br /&gt;
|arg4 = {{type|number }} f3 {{bracket}}&lt;br /&gt;
|arg5 = {{type|number }} f4 {{rbracket}} {{rbracket}} {{rbracket}}&lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}} &lt;br /&gt;
|info = Sets the uniform float value at the locationID for the currently active shader. Shader must be activated before setting uniforms.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = gl.&lt;br /&gt;
|name = UniformInt&lt;br /&gt;
|arg1 = {{type|number}} locationID &lt;br /&gt;
|arg2 = {{type|number }} int1 {{bracket}}&lt;br /&gt;
|arg3 = {{type|number }} int2 {{bracket}}&lt;br /&gt;
|arg4 = {{type|number }} int3 {{bracket}}&lt;br /&gt;
|arg5 = {{type|number }} int4 {{rbracket}} {{rbracket}} {{rbracket}}&lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}} &lt;br /&gt;
|info = Sets the uniform int value at the locationID for the currently active shader. Shader must be activated before setting uniforms.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = gl.&lt;br /&gt;
|name = UniformArray&lt;br /&gt;
|arg1 = {{type|number}} locationID &lt;br /&gt;
|arg2 = {{type|number }} type&lt;br /&gt;
|arg3 = {{type|table }} uniforms &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}} &lt;br /&gt;
|info = Sets the an array of uniform values at the locationID for the currently active shader. Shader must be activated before setting uniforms. 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.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = gl.&lt;br /&gt;
|name = UniformMatrix&lt;br /&gt;
|arg1 = {{type|number}} locationID &lt;br /&gt;
|arg2 = {{type|string}} &amp;quot;shadows&amp;quot; {{pipe}} &amp;quot;camera&amp;quot; {{pipe}} &amp;quot;caminv&amp;quot; {{pipe}} &amp;quot;camprj&amp;quot; {{pipe}} {{type|number}} m1&lt;br /&gt;
|arg3 = {{type|number}} m2&lt;br /&gt;
|arg4 = {{type|number}} m3&lt;br /&gt;
|arg5 = {{type|number}} m4&lt;br /&gt;
|arg6 = {{type|number}} m5&lt;br /&gt;
|arg7 = {{type|number}} m6&lt;br /&gt;
|arg8 = {{type|number}} m7&lt;br /&gt;
|arg9 = {{type|number}} m8 ... , m16&lt;br /&gt;
|return = {{type|nil}} &lt;br /&gt;
|info = Sets the a uniform mat4 locationID for the currently active shader. Shader must be activated before setting uniforms. Can set one one common matrix like shadow, or by passing 16 additional numbers for the matrix.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>luainter&gt;Beherith</name></author>
	</entry>
</feed>