[rtextures/rlgl] Load mipmaps for cubemaps (#4429)

* [rlgl] Load cubemap mipmaps

* [rtextures] Only generate mipmaps that don't already exist

* [rtextures] ImageDraw(): Implement drawing to mipmaps

* [rtextures] Load cubemap mipmaps
This commit is contained in:
Nikolas 2024-10-26 12:09:38 +02:00 committed by GitHub
parent 91a4f04794
commit 7fedf9e0b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 78 additions and 20 deletions

View file

@ -191,7 +191,7 @@ static TextureCubemap GenTextureCubemap(Shader shader, Texture2D panorama, int s
// STEP 1: Setup framebuffer
//------------------------------------------------------------------------------------------
unsigned int rbo = rlLoadTextureDepth(size, size, true);
cubemap.id = rlLoadTextureCubemap(0, size, format);
cubemap.id = rlLoadTextureCubemap(0, size, format, 1);
unsigned int fbo = rlLoadFramebuffer();
rlFramebufferAttach(fbo, rbo, RL_ATTACHMENT_DEPTH, RL_ATTACHMENT_RENDERBUFFER, 0);