Review cubemap generation
This commit is contained in:
parent
a28dfd4a7b
commit
01367fcb1e
@ -2027,10 +2027,10 @@ unsigned int rlLoadTextureCubemap(void *data, int size, int format)
|
|||||||
unsigned int glInternalFormat, glFormat, glType;
|
unsigned int glInternalFormat, glFormat, glType;
|
||||||
rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType);
|
rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType);
|
||||||
|
|
||||||
|
if (glInternalFormat != -1)
|
||||||
|
{
|
||||||
// Load cubemap faces
|
// Load cubemap faces
|
||||||
for (unsigned int i = 0; i < 6; i++)
|
for (unsigned int i = 0; i < 6; i++)
|
||||||
{
|
|
||||||
if (glInternalFormat != -1)
|
|
||||||
{
|
{
|
||||||
if (format < COMPRESSED_DXT1_RGB) glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, size, size, 0, glFormat, glType, (unsigned char *)data + i*dataSize);
|
if (format < COMPRESSED_DXT1_RGB) glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, size, size, 0, glFormat, glType, (unsigned char *)data + i*dataSize);
|
||||||
#if !defined(GRAPHICS_API_OPENGL_11)
|
#if !defined(GRAPHICS_API_OPENGL_11)
|
||||||
|
@ -1206,12 +1206,9 @@ TextureCubemap LoadTextureCubemap(Image image, int layoutType)
|
|||||||
cubemap.height = cubemap.width;
|
cubemap.height = cubemap.width;
|
||||||
}
|
}
|
||||||
|
|
||||||
int size = cubemap.width;
|
|
||||||
|
|
||||||
if (layoutType != CUBEMAP_AUTO_DETECT)
|
if (layoutType != CUBEMAP_AUTO_DETECT)
|
||||||
{
|
{
|
||||||
//unsigned int dataSize = GetPixelDataSize(size, size, format);
|
int size = cubemap.width;
|
||||||
//void *facesData = malloc(size*size*dataSize*6); // Get memory for 6 faces in a column
|
|
||||||
|
|
||||||
Image faces = { 0 }; // Vertical column image
|
Image faces = { 0 }; // Vertical column image
|
||||||
Rectangle faceRecs[6] = { 0 }; // Face source rectangles
|
Rectangle faceRecs[6] = { 0 }; // Face source rectangles
|
||||||
@ -1225,6 +1222,7 @@ TextureCubemap LoadTextureCubemap(Image image, int layoutType)
|
|||||||
else if (layoutType == CUBEMAP_PANORAMA)
|
else if (layoutType == CUBEMAP_PANORAMA)
|
||||||
{
|
{
|
||||||
// TODO: Convert panorama image to square faces...
|
// TODO: Convert panorama image to square faces...
|
||||||
|
// Ref: https://github.com/denivip/panorama/blob/master/panorama.cpp
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user