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 » 28 Nov 2007, 03:14

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 :-)
0 x

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

Post by Maelstrom » 03 Dec 2007, 11:38

Bump?
Anyone got an idea? :(
0 x

User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Post by lurker » 03 Dec 2007, 12:30

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


Or can I?
0 x

User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Post by lurker » 03 Dec 2007, 12:32

Image
0 x

Post Reply

Return to “Lua Scripts”