klepto2 Posted July 26 Share Posted July 26 Hi, while normally working with the cpp version, i was often using lua lately to try things out. Unfortunatly i have found out, that some essential stuff is missing from lua: PostEffect: only LoadPostEffect is available no other class member except Asset and Object ones are available Material: Some Set and get Values are missing like: SetBackfaceculling SetDepthTest SetDepthMask and maybe some other tableplusplus Can't create a table without loading a dummy one Entity properties is available, but always nil in the lua context in the editor trying to save a gameobject in map which has properties set like: entity.properties = {}; entity.properties["table"] = a leads to an error that userdata needs to be a cpp table. some more might be missing Camera SetRefraction is missing Getters for each settting should be available (same for cpp) only 2 are available Quote Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
Josh Posted July 29 Share Posted July 29 On 7/26/2024 at 4:10 AM, klepto2 said: PostEffect: only LoadPostEffect is available no other class member except Asset and Object ones are available Posteffect class has no other methods? On 7/26/2024 at 4:10 AM, klepto2 said: Material: Some Set and get Values are missing like: SetBackfaceculling SetDepthTest SetDepthMask and maybe some other Added Get/SetBackFaceCullMode, Get/SetBackFaceLighting, I am not completely sure that Get/SetDepthMask and Get/SetDepthTest should be exposed, or how they should work. I would consider the commands not official currently. On 7/26/2024 at 4:10 AM, klepto2 said: Camera SetRefraction is missing Getters for each settting should be available (same for cpp) only 2 are available Added a lot of missing camera methods. The editor is updated now. Have not updated the Lua interpreter yet. 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...
klepto2 Posted July 29 Author Share Posted July 29 5 hours ago, Josh said: Posteffect class has no other methods? Yeah, noticed it as well after posting it I somehow mixed up camera:SetUniform with posteffect:SetUniform. and the camera:SetUniform is there. 1 Quote Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
klepto2 Posted July 29 Author Share Posted July 29 While camera:SetUniform is exposed, it doesn't work correctly. for textures i get no matching overload found and the other SetUniforms throw some index out of range errors (in cpp it both works) fft.showTexturePFX = LoadPostEffect("Shaders/Ocean/effect/display.fx") fft.testTexture = LoadTexture("Materials/water_foam.dds") for k,v in pairs(program.world:GetEntities()) do local c = Camera(v) if c ~= nil then local index = c:AddPostEffect(fft.showTexturePFX) c:SetUniform(index,"display_texture", fft.testTexture) c:SetUniform(index,"color_mask", Vec4(1.0,0.0,1.0,1.0)) end end Quote Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
Josh Posted July 29 Share Posted July 29 I added the material, entity, and texture overloads for Camera:SetUniform. 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...
klepto2 Posted July 30 Author Share Posted July 30 They are there, but using the new SetUniform leads to crash to desktop (tested only within the editor). using SetUniform for eg: Vec4 types leads to index out of range errors. Quote Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
Josh Posted July 30 Share Posted July 30 The index needs to be one-based in Lua. 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...
klepto2 Posted July 30 Author Share Posted July 30 Of course, but what does the call of an ultraengine method have to do with the lua index? if i get the index 0 from the posteffect, then i should use that as a parameter in the SetUniform. This isn't a lua table, shouldn't it work the same way as in cpp? Quote Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
Josh Posted July 30 Share Posted July 30 In Lua, I have made anything that is an array index one-based, since that is how Lua is designed. When you add a post-effect, one will be added to the index before it is returned. "AddPostEffect", [](Camera& c, shared_ptr<PostEffect> f) { return c.AddPostEffect(f) + 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...
Dexter Posted August 9 Share Posted August 9 one related thing I ran across, lua math's Random() is missing the bindings with params, and further 'Random()' only returns 1 or 0 atm which seems off? Quote Link to comment Share on other sites More sharing options...
Solution Josh Posted October 28 Solution Share Posted October 28 On 8/9/2024 at 2:26 PM, Dexter said: one related thing I ran across, lua math's Random() is missing the bindings with params, and further 'Random()' only returns 1 or 0 atm which seems off? Run this one-liner in the editor console: n = Random(0, 10) Print(n) I believe everything listed in this thread is now fixed. 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.