Lua unit rendering

Lua unit rendering

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
Maelstrom
Posts: 1950
Joined: 23 Jul 2005, 14:52

Lua unit rendering

Post by Maelstrom »

Ive heard alot about rendering units through Lua, and it just so happens that SWS has a need for it. Ive got the script mostly working, with just a few things to finish up.

Firstly, I can draw the unit model, but it doesn't look like an actual unit. It has not got the proper shading, lighting and reflections that other, 'real' units have. It has incorrect (or a complete lack of) z-order sorting. It stands out like a sore thumb and looks kinda horrible. How would I get the unit looking like an actual real unit?

Secondly, is there a way to just draw a model loaded from the VFS, instead of using gl.UnitShape() to draw a unit from a unitDefID? The units needing to be drawn do not need to be actual valid units, all I need is the model, but with gl.UnitShape they need to be valid models :(

The script that I have so far can be found here: http://pastebin.com/m4b6c871d
Ignore the debugging cruft in there, its not the final version :P

Thanks :-)
User avatar
Maelstrom
Posts: 1950
Joined: 23 Jul 2005, 14:52

Post by Maelstrom »

Bump?
Anyone got an idea? :(
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Post by lurker »

:cry: If you bump it then I can't bump it with my picture.


Or can I?
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Post by lurker »

Image
Post Reply

Return to “Lua Scripts”