tipforeveryone Posted August 22, 2018 Share Posted August 22, 2018 After reading document page here (https://www.leadwerks.com/learn?page=Tutorials_Lua-Scripting_Introduction-to-Lua) I still can't figure out those functions usage. Can anyone explain more clear ? 1 Quote Link to comment Share on other sites More sharing options...
tipforeveryone Posted August 22, 2018 Author Share Posted August 22, 2018 Draw() and UpdateWorld() behaviors are the same when I put some code inside them. "Script:Draw(): This is called the first time an object is rendered during a scene render." It sounds the same as UpdateWorld() to me. Is scene rendered each frame ? Quote Link to comment Share on other sites More sharing options...
Solution SpiderPig Posted August 22, 2018 Solution Share Posted August 22, 2018 They're not quite the same, I think the major difference is Draw() isn't called when the object is invisible (off screen). Pretty sure the scene is rendered each frame. Per loop there is one call to UpdateWorld () and then a call to RenderWorld (). Quote Link to comment Share on other sites More sharing options...
Josh Posted August 30, 2018 Share Posted August 30, 2018 Draw() is called once per call to World:Render(), DrawEach() is called for each camera rendered (including shadow renders) during a call to World:Render(). Functionality that is dependent on the camera, such as rotating an object to face the camera, should be done in DrawEach(). Other functionality that does not depend on anything special about the camera should be done in Draw(). This was originally implemented for animation, which is rather expensive and we did not want animation to be updated more times than was needed. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.