SpartanJ / SOIL2

SOIL2 is a tiny C library used primarily for uploading textures into OpenGL.
MIT No Attribution
370 stars 75 forks source link

Cube map dimensions validation #16

Closed SpartanJ closed 7 years ago

SpartanJ commented 7 years ago

Original report by Michael IV (Bitbucket: Krioboss, ).


Hi.Don't you think the following chunk that validates cubemap dimensions is wrong?I mean,what sort of texture size is that where the width must be 6 times bigger than height and height must be 6 times bigger than width?It doesn't make sense.

#!c

if( (width != 6*height) &&
        (6*width != height) )
    {
        SOIL_free_image_data( img );
        result_string_pointer = "Single cubemap image must have a 6:1 ratio";
        return 0;
    }
SpartanJ commented 7 years ago

Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ).


Hi!

That line is OK, i think you misread it, one of its sides must be 6 time bigger than the other, that's what it checks, if that condition is not met, it can't create a cube map from a static image ( you have to have 6 sides with the same size each one ).

Regards