shadmar Posted April 5, 2016 Share Posted April 5, 2016 If we could have added a function like this, it would allow us to build on-the-fly cubemaps from the running scene, allowing reflection setup for substances (if only for a one time render). But I cannot currently build mipmaps for a cubemap texture in lua, only in cpp if I add this: static int BuildCubeMipmaps(lua_State *L){ int argc = Interpreter::GetStackSize(); Texture* t; t = static_cast<Leadwerks::Texture*>(Interpreter::ToObject(1)); //texture sent from lua t->BuildMipmaps(); Leadwerks::OpenGL2Texture* gl2cubeTexture = dynamic_cast<Leadwerks::OpenGL2Texture*>(t); glActiveTexture(gl2cubeTexture->GetGLTarget()); glBindTexture(GL_TEXTURE_CUBE_MAP, gl2cubeTexture->gltexturehandle); glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS); glGenerateMipmap(GL_TEXTURE_CUBE_MAP); return 1; } 2 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB 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.