Jump to content

Request for cubemap mipmap building to lua


shadmar
 Share

Recommended Posts

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;
}

  • Upvote 2

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...