Lua UnitRendering


Contents

Unit Rendering

Spring.UnitRendering.SetLODCount

 ( number unitID, int lodCount ) -> nil

Spring.UnitRendering.SetLODLength (`lod` is 1-indexed)

 ( number unitID, int lod, number lodLength ) -> nil

Spring.UnitRendering.SetLODDistance (same as SetLODLength(), but adjusted for 45deg FOV + 1024x768)

 (number unitID,  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 MaterialType, table Material ) -> userdata Material

Spring.UnitRendering.SetMaterial

 ( number unitID, int lod, string MaterialType, userdata Material | table Material ) -> nil

Spring.UnitRendering.SetMaterialLastLOD

 ( number unitID, sstring MaterialType, int lastLOD ) -> nil

Spring.UnitRendering.SetMaterialDisplayLists

 ( number unitID, int lod, string MaterialType, preDisplayList, postDisplayList ) -> nil

Spring.UnitRendering.SetUnitUniform (unfinished)

 ( number unitID, string MaterialType, 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

MaterialTypes

"alpha"
"opaque"
"alpha_reflect"
"opaque_reflect"
"shadow"

Material UserData

none user accessible methods (yet)

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 ,]
 }

Retrieved from "http://spring.clan-sy.com/wiki/Lua_UnitRendering"

This page has been accessed 342 times. This page was last modified 19:52, 27 October 2008.




Page editing toolbox

Browse
Main Page
Community portal
Current events
Recent changes
Random page
Help
Donations
Edit
View source
Editing help
This page
Discuss this page
Post a comment
Printable version
Context
Page history
What links here
Related changes
My pages
Log in
Special pages
New pages
File list
Statistics
Bug reports
More...

Site layout created by Roflcopter.