User:Master-athmos: Difference between revisions

From Spring
Jump to navigationJump to search
No edit summary
Replaced content with "Development < Lua Scripting < {{FULLPAGENAME}} <span class="warning">These functions are ONLY available if the graphic board supp..."
 
(53 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Engine_Development|Development]] < [[Lua_Scripting|Lua Scripting]] < {{FULLPAGENAME}}
[[Engine_Development|Development]] < [[Lua_Scripting|Lua Scripting]] < {{FULLPAGENAME}}


<span class="warning">These functions are ONLY available if the graphic board supports GLSL.<br><br> Please test in your scripts if one of them exists before you use them!</span>


{{LuaCallout
|prefix = Spring.
|name = SetUnitBlocking
|arg1 = {{type|number}} unitID
|arg2 = {{type|boolean}} isBlocking
|arg3 = {{type|boolean}} isSolidObjectCollidable
|arg4 = {{type|boolean}} isProjectileCollidable
|arg5 = {{type|boolean}} isRaySegmentCollidable
|arg6 = {{type|boolean}} crushable
|arg7 = {{type|boolean}} blockEnemyPushing
|arg8 = {{type|boolean}} blockHeightChanges
|arg9 =
|return = {{type|nil}}
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}


'''gl.CreateShader'''
  ({[ vertex  = "glsl code" ,]
    [ tcs      = "glsl code" ,]
    [ tes      = "glsl code" ,]
    [ geometry = "glsl code" ,]
    [ fragment = "glsl code" ,]
    [ uniform      = { uniformName = number value, ...} ,] <span class=note>(specify a Lua array as an argument to uniformName to initialize GLSL arrays)</span>
    [ uniformInt    = { uniformName = number value, ...} ,] <span class=note>(specify a Lua array as an argument to uniformName to initialize GLSL arrays)</span>
    [ uniformFloat  = { uniformName = number value, ...} ,] <span class=note>(specify a Lua array as an argument to uniformName to initialize GLSL arrays)</span>
    [ uniformMatrix = { uniformName = number value, ...} ,]
    [ geoInputType = number inType,]
    [ geoOutputType = number outType,]
    [ geoOutputVerts = number maxVerts,]
    [ definitions = "string of shader #defines", ]
  }) -> number shaderID


{{LuaCallout
* The "Vertex" 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.
|prefix = Spring.
|name = SetUnitBuildSpeed
* The "Geometry" or Geometry-shader can create new vertices and vertice-stripes from points.
|arg1 = {{type|number}} builderID
|arg2 = {{type|number}} buildSpeed
|arg3 = {{bracket|{{type|number}} repairSpeed}}
|arg4 = {{bracket|{{type|number}} reclaimSpeed}}
|arg5 = {{bracket|{{type|number}} resurrectSpeed}}
|arg6 = {{bracket|{{type|number}} captureSpeed}}
|arg7 = {{bracket|{{type|number}} terraformSpeed}}
|arg8 =
|arg9 =
|return = {{type|nil}}
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}


* The "TCS" 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 >= 104.0.1-596 (maintenance), it's also available in develop branch of spring.


{{LuaCallout
* The "TES" 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 >= 104.0.1-596 (maintenance), it's also available in develop branch of spring.
|prefix = Spring.
|name = SetUnitBuildSpeed
|arg1 = {{type|number}} builderID
|arg2 = {{type|number}} buildSpeed
|arg3 = {{bracket}}{{type|number}} repairSpeed
|arg4 = {{bracket}}{{type|number}} reclaimSpeed
|arg5 = {{bracket}}{{type|number}} resurrectSpeed
|arg6 = {{bracket}}{{type|number}} captureSpeed
|arg7 = {{bracket}}{{type|number}} terraformSpeed {{rbracket}}{{rbracket}}{{rbracket}}{{rbracket}}{{rbracket}}
|arg8 =
|arg9 =
|return = {{type|nil}}
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}


* The "Fragment" 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.


=All Lua Contexts=
* The Uniforms are the values, you send along with the shader-program. To use them in the shader-program declare them like this:
{{LuaCallout
<syntaxhighlight lang="c">uniform float frame;</syntaxhighlight>
|prefix = Script.
|name = Kill
|arg1 =
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}}
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}


* From 101.0 onwards, the engine will automatically fill in an appropriately named uniform for team colour if it is declared;
<syntaxhighlight lang="c">uniform vec4 teamColor;</syntaxhighlight>


{{LuaCallout
'''gl.DeleteShader'''
|prefix = Script.
  ( number shaderID ) -> nil
|name = GetName
|arg1 =
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|string}} luaInstanceName
|info = Returns the luaInstanceName (e.g. "LuaUI", "LuaRules", "LuaGaia", ...).
}}


'''gl.ActiveShader''' <font color="#55ee99">can be used in NON-drawing events (to update uniforms etc.)!</font>
  ( number shaderID, function [, arg1 [, arg2, ..]] ) -> nil


{{LuaCallout
'''gl.UseShader'''
|prefix = Script.
  ( number shaderID ) -> boolean linked
|name = GetSynced
|arg1 =
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|bool}} is_synced
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}


'''gl.GetShaderLog'''
  ( ) -> string "infoLog"


{{LuaCallout
'''gl.SetShaderParameter'''
|prefix = Script.
<font color="#ff0000">Renamed to SetGeometryShaderParameter in spring version >= 104.0.1-596 (maintenance).</font>
|name = GetFullCtrl
<font color="#55ee99">needed by geometry shader programs (check the opengl GL_ARB_geometry_shader4 extension for glProgramParameteri)</font>
|arg1 =  
  ( number shaderID, number param, number value ) -> nil
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|bool}} has_fullctrl
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}


'''gl.SetTesselationShaderParameter'''
<font color="#0000ee">Available for spring versions >= 104.0.1-596 (maintenance).</font>
<font color="#55ee99">needed by tesselation shader programs (check the opengl GL_ARB_tessellation_shader extension for glProgramParameteri)</font>
  ( number param, number value ) -> nil


{{LuaCallout
'''gl.GetActiveUniforms'''
|prefix = Script.
  ( number shaderID ) -> {
|name = GetFullRead
      [1] = { name = "name", type = "type", length = number length, size = number size },
|arg1 =
      ...
|arg2 =
    }
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|bool}} has_fullread
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}


'''gl.GetUniformLocation'''
  ( number shaderID, name uniformName ) -> number locationID


{{LuaCallout
'''gl.Uniform'''
|prefix = Script.
  ( number locationID, number f1 [,number f2 [,number f3 [,number f4]]] ) -> nil
|name = GetCtrlTeam
|arg1 =
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|number}} ctrl_teamID
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}


'''gl.UniformInt'''
  ( number locationID, number int1 [,number int2 [,number int3 [,number int4]]] ) -> nil


{{LuaCallout
'''gl.UniformArray''' {{new|95.0}}
|prefix = Script.
   ( number locationID, number type, table uniforms ) -> nil
|name = GetReadTeam
<span class="note">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.</span>
|arg1 =
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|number}} read_teamID
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
 
 
{{LuaCallout
|prefix = Script.
|name = GetReadAllyTeam
|arg1 =
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|number}} read_allyTeamID
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
 
 
{{LuaCallout
|prefix = Script.
|name = GetSelectTeam
|arg1 =
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|number}} select_teamID
|info = Defines which teamunits can be selected via Spring.SelectUnitMap/Spring.SelectUnitArray.
}}
 
 
{{LuaCallout
|prefix = Script.
|name = GetGlobal
|arg1 =
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}} {{pipe}} {{type|table}} globalEnv
|info = Returns nil if not in dev-mode.
}}
 
 
{{LuaCallout
|prefix = Script.
|name = GetRegistry
|arg1 =
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}} {{pipe}} {{type|table}} registryEnv
|info = Returns nil if not in dev-mode.
}}
 
 
{{LuaCallout
|prefix = Script.
|name = GetCallInList
|arg1 =
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|table}} known_callins
|info = Known CallIns are:
}}
   <span class=note>known_callins = {
    ["CallInName"] = { unsynced = boolean, controller = boolean }, (`controller` is true for<br>      all CallIns which's return values are used by the engine for synced code,<br>      e.g. "AllowUnitCreation" is a controller)
    ...
  }
 
 
{{LuaCallout
|prefix = Script.
|name = IsEngineMinVersion
|arg1 = major {{bracket}}, minor {{bracket}}, commits {{rbracket}}{{rbracket}}
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}} {{pipe}} {{type|boolean}} isMinVersion
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
 
==Special team constants==
 
{{LuaCallout
|prefix = Script.
|name = NO_ACCESS_TEAM
|arg1 =
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|number}} ???
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
 
 
{{LuaCallout
|prefix = Script.
|name = ALL_ACCESS_TEAM
|arg1 =
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|number}} ???
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
 
=LuaUI only=
 
{{LuaCallout
|prefix = Spring.
|name = SetShockFrontFactors
|arg1 = {{type|number}} minArea
|arg2 = {{type|number}} minPower
|arg3 = {{type|number}} distAdj
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}}
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
 
 
{{LuaCallout
|prefix = Spring.
|name = UpdateCallIn
|arg1 = {{type|string}} callin_name
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}}
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
 
=LuaGadgets only=
==Synced==
 
{{type|number}} COBSCALE
: Number containing the cobscale factor, which is applied to transform the variables assigned via unit cob animation scripts for use inside the engine (default: 65536).
 
 
{{LuaCallout
|prefix = Script.
|name = AddActionFallback
|arg1 = {{type|string}} command
|arg2 = {{type|string}} help
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}} {{pipe}} {{type|boolean}} ???
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
 
 
{{LuaCallout
|prefix = Script.
|name = RemoveActionFallback
|arg1 = {{type|string}} command
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}} {{pipe}} {{type|boolean}} ???
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
 
 
{{LuaCallout
|prefix = Script.
|name = UpdateCallIn
|arg1 = {{type|string}} callin_name
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}}
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
 
 
{{LuaCallout
|prefix = Script.
|name = SetWatchFeature
|arg1 = {{type|number}} featureDefID
|arg2 = {{type|boolean}} enable
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}}
|info = Enables the `UnitFeatureCollision` callin for a specific [[Gamedev:FeatureDefs|FeatureDef]].
}}
 
 
{{LuaCallout
|prefix = Script.
|name = GetWatchFeature
|arg1 = {{type|number}} featureDefID
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}} {{pipe}} {{type|boolean}} enabled
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
 
 
{{LuaCallout
|prefix = Script.
|name = SetWatchUnit
|arg1 = {{type|number}} unitDefID
|arg2 = {{type|boolean}} enable
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}}
|info = Enables the `UnitUnitCollision`, `UnitFeatureCollision` and `UnitMoveFailed` callins for a specific [[Gamedev:UnitDefs|UnitDef]].
}}
 
 
{{LuaCallout
|prefix = Script.
|name = GetWatchUnit
|arg1 = {{type|number}} unitDefID
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}} {{pipe}} {{type|boolean}} enabled
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
 
 
{{LuaCallout
|prefix = Script.
|name = SetWatchWeapon
|arg1 = {{type|number}} weaponDefID
|arg2 = {{type|boolean}} enable
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}}
|info = Enables the `Explosion` and (as of 0.83+) `ProjectileCreated` and `ProjectileDestroyed` callins for a specific WeaponDef.
}}
 
 
{{LuaCallout
|prefix = Script.
|name = GetWatchWeapon
|arg1 = {{type|number}} weaponDefID
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}} {{pipe}} {{type|boolean}} enabled
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
 
 
{{LuaCallout
|prefix = Script.
|name = GetWatchWeapon
|arg1 = {{type|number}} weaponDefID
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}} {{pipe}} {{type|boolean}} enabled
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
 
 
{{LuaCallout
|prefix =
|name = SendToUnsynced
|arg1 = arg1
|arg2 = arg2
|arg3 = ...
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}}
|info = Just nil, number, string and boolean datatypes are allowed as arguments! NO tables, userdatas, ...
}}
 
 
{{LuaCallout
|prefix =
|name = CallAsTeam
|arg1 = {{type|number}} teamID
|arg2 = lua_function f
|arg3 = arg1
|arg4 = arg2
|arg5 = ...
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}}
|info =
}}
or <br>
{{LuaCallout
|prefix =
|name = CallAsTeam
|arg1 = {{type|table}} access
|arg2 = lua_function f
|arg3 = arg1
|arg4 = arg2
|arg5 = ...
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}}
|info = LOS checking depends on the `selected` team, this functions allows to select another one.
}}
  <span class=note>access = {
    [ctrl = number teamID,]
    [read = number teamID,]
    [select = number teamID,]
  }</span>
 
==Unsynced==
 
{{LuaCallout
|prefix = Script.
|name = UpdateCallIn
|arg1 = {{type|string}} callin_name
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}}
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
 
 
{{LuaCallout
|prefix =
|name = CallAsTeam
|arg1 = {{type|number}} teamID
|arg2 = lua_function f
|arg3 = arg1
|arg4 = arg2
|arg5 = ...
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}}
|info =
}}
or <br>
{{LuaCallout
|prefix =
|name = CallAsTeam
|arg1 = {{type|table}} access
|arg2 = lua_function f
|arg3 = arg1
|arg4 = arg2
|arg5 = ...
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}}
|info = LOS checking depends on the `selected` team, this functions allows to select another one.
}}
 
  <span class=note>access = {
    [ctrl = number teamID,]    (limits Spring.GiveOrderXYZ)
    [read = number teamID,]    (limits reading of unit params, e.g. Spring.GetUnitLosState)
    [select = number teamID,]    (limits Spring.SelectUnitXYZ)
  }</span>
 
=LuaRules only=
==Synced==
 
{{LuaCallout
|prefix = Script.
|name = PermitHelperAIs
|arg1 = {{type|boolean}} permit
|arg2 =
|arg3 =
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}}
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}


'''gl.UniformMatrix'''
  ( number locationID,
    "shadow" |
    "camera" |
    "caminv" |
    "camprj" |
    number m1, number m2, number m3, number m4 |
    number m1, ... , number m9 |
    number m1, ... , number m16
  ) -> nil


[[category: Lua]]
[[category: Lua]]

Latest revision as of 21:51, 21 April 2021

Development < Lua Scripting < User:Master-athmos

These functions are ONLY available if the graphic board supports GLSL.

Please test in your scripts if one of them exists before you use them!


gl.CreateShader

 ({[ vertex   = "glsl code" ,]
   [ tcs      = "glsl code" ,]
   [ tes      = "glsl code" ,]
   [ geometry = "glsl code" ,]
   [ fragment = "glsl code" ,]
   [ uniform       = { uniformName = number value, ...} ,] (specify a Lua array as an argument to uniformName to initialize GLSL arrays)
   [ uniformInt    = { uniformName = number value, ...} ,] (specify a Lua array as an argument to uniformName to initialize GLSL arrays)
   [ uniformFloat  = { uniformName = number value, ...} ,] (specify a Lua array as an argument to uniformName to initialize GLSL arrays)
   [ uniformMatrix = { uniformName = number value, ...} ,]
   [ geoInputType = number inType,]
   [ geoOutputType = number outType,]
   [ geoOutputVerts = number maxVerts,]
   [ definitions = "string of shader #defines", ]
 }) -> number shaderID
  • The "Vertex" 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.
  • The "Geometry" or Geometry-shader can create new vertices and vertice-stripes from points.
  • The "TCS" 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 >= 104.0.1-596 (maintenance), it's also available in develop branch of spring.
  • The "TES" 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 >= 104.0.1-596 (maintenance), it's also available in develop branch of spring.
  • The "Fragment" 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.
  • The Uniforms are the values, you send along with the shader-program. To use them in the shader-program declare them like this:

<syntaxhighlight lang="c">uniform float frame;</syntaxhighlight>

  • From 101.0 onwards, the engine will automatically fill in an appropriately named uniform for team colour if it is declared;

<syntaxhighlight lang="c">uniform vec4 teamColor;</syntaxhighlight>

gl.DeleteShader

 ( number shaderID ) -> nil

gl.ActiveShader can be used in NON-drawing events (to update uniforms etc.)!

 ( number shaderID, function [, arg1 [, arg2, ..]] ) -> nil

gl.UseShader

 ( number shaderID ) -> boolean linked

gl.GetShaderLog

 ( ) -> string "infoLog"

gl.SetShaderParameter Renamed to SetGeometryShaderParameter in spring version >= 104.0.1-596 (maintenance). needed by geometry shader programs (check the opengl GL_ARB_geometry_shader4 extension for glProgramParameteri)

 ( number shaderID, number param, number value ) -> nil

gl.SetTesselationShaderParameter Available for spring versions >= 104.0.1-596 (maintenance). needed by tesselation shader programs (check the opengl GL_ARB_tessellation_shader extension for glProgramParameteri)

 ( number param, number value ) -> nil

gl.GetActiveUniforms

 ( number shaderID ) -> { 
     [1] = { name = "name", type = "type", length = number length, size = number size },
     ...
   }

gl.GetUniformLocation

 ( number shaderID, name uniformName ) -> number locationID

gl.Uniform

 ( number locationID, number f1 [,number f2 [,number f3 [,number f4]]] ) -> nil

gl.UniformInt

 ( number locationID, number int1 [,number int2 [,number int3 [,number int4]]] ) -> nil

gl.UniformArray New in version 95.0

 ( number locationID, number type, table uniforms ) -> nil

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.

gl.UniformMatrix

 ( number locationID, 
   "shadow" |
   "camera" |
   "caminv" |
   "camprj" |
   number m1, number m2, number m3, number m4 |
   number m1, ... , number m9 |
   number m1, ... , number m16
 ) -> nil