You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PNG/JPG files converted from GIF (from this website) has alignment issues when displayed on screen. However, BMP files converted with the same method doesn't have these issues.
Adding glPixelStorei(GL_UNPACK_ALIGNMENT, 1) before glTexImage2D fixes the issue with PNG/JPG files, but breaks BMP files. Also, glPixelStorei(GL_UNPACK_ALIGNMENT, 1) doesn't seems to have any affect on images that are not converted from GIFs.
Demo
PNG w/o glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
PNG w/ glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
BMP w/o glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
BMP w/ glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
Proposed Workaround
Use BMP when converting from GIFs
The text was updated successfully, but these errors were encountered:
Problem
PNG/JPG files converted from GIF (from this website) has alignment issues when displayed on screen. However, BMP files converted with the same method doesn't have these issues.
Adding
glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
beforeglTexImage2D
fixes the issue with PNG/JPG files, but breaks BMP files. Also,glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
doesn't seems to have any affect on images that are not converted from GIFs.Demo
PNG w/o
glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
PNG w/
glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
BMP w/o
glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
BMP w/
glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
Proposed Workaround
Use BMP when converting from GIFs
The text was updated successfully, but these errors were encountered: