Lua UnitRendering: Difference between revisions
From Spring
Jump to navigationJump to search
No edit summary |
|||
| Line 46: | Line 46: | ||
["enable" = boolean true ] }, ] | ["enable" = boolean true ] }, ] | ||
[ [3] = <font color=darkgreen>[[Lua_OpenGL_Api#Textures|see gl.Texture]]</font>, ] | [ [3] = <font color=darkgreen>[[Lua_OpenGL_Api#Textures|see gl.Texture]]</font>, ] | ||
<font color=darkgreen>(upto [15] and supports holes in it)</font> | |||
} ,] | } ,] | ||
Revision as of 04:05, 15 June 2008
Unit Rendering
Spring.UnitRendering.SetLODCount
( int lodCount ) -> nil
Spring.UnitRendering.SetLODLength (`lod` is 1-indexed)
( int lod, number lodLength ) -> nil
Spring.UnitRendering.SetLODDistance (same as SetLODLength(), but adjusted for 45deg FOV + 1024x768)
( int lod, number lodDistance ) -> nil
Spring.UnitRendering.SetPieceList (displayList=nil reset to default)
( number unitID, int lod, int piece [, number displayList = nil ] ) -> nil
Spring.UnitRendering.GetMaterial (creates a material userdata)
( string MaterialName, table Material ) -> ??
Spring.UnitRendering.SetMaterial
( number unitID, int lod, string MaterialName, userdata Material | table Material ) -> nil
Spring.UnitRendering.SetMaterialLastLOD
( number unitID, string MaterialName, int lastLOD ) -> nil
Spring.UnitRendering.SetMaterialDisplayLists
( number unitID, string MaterialName, preDisplayList, postDisplayList ) -> nil
Spring.UnitRendering.SetUnitUniform (unfinished)
( number unitID, string MaterialName, int lod, arg1, arg2, ... ) -> nil
Spring.UnitRendering.SetUnitLuaDraw (enables the DrawUnit callin)
( number unitID, boolean enabled ) -> nil
Spring.UnitRendering.Debug (prints some usefull debug informations)
( [ number unitID ] ) -> nil
Material UserData
fill me
Material Table
material = {
["order" = number ,]
["shader" = lua_shader | string "3do" | string "s3o" ,]
["texunits" = {
[ [0] = { ["tex" = see gl.Texture ,]
["enable" = boolean true ] }, ]
[ [3] = see gl.Texture, ]
(upto [15] and supports holes in it)
} ,]
["texunit0" = see gl.Texture ,] ... ["texunit7" = see gl.Texture ,]
["prelist" = lua_displaylist ,] ["postlist" = lua_displaylist ,] ["usecamera" = boolean ,] ["cameraloc" = number ,] }