Jump to content

Recommended Posts

Posted

Some code I used to resize a cubemap. I think the mipmaps might not be correct, but that's okay: Pasting here in case I need it again

    auto plug = LoadPlugin("Plugins/ISPCTexComp.dll");

    auto tex = LoadTexture(GetPath(PATH_DESKTOP) + "/diffuse.dds", LOAD_MIPCHAIN);
    auto mipchain = tex->mipchain;
    std::vector<shared_ptr<Pixmap> > chain2;
    for (auto p : mipchain)
    {
        
        {
            p = p->Convert(TEXTURE_RGBA16);
            p = p->Resize(256, 256);
            p = p->Convert(TEXTURE_BC6H);
            chain2.push_back(p);
        }
    }
    SaveTexture(GetPath(PATH_DESKTOP) + "/thumbnail_diffuse.dds", TEXTURE_CUBE, chain2, 6);
    return 0;

 

Let's build cool stuff and have fun. :)

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.

×
×
  • Create New...