mgerhardy / caveexpress

CaveExpress is a classic 2D platformer with physics-based gameplay and dozens of levels. CavePacker is a Sokoban game.
http://www.caveproductions.org/
Other
144 stars 20 forks source link

GFX: opengl renderer can't handle 8-bit/color RGBA #61

Closed mgerhardy closed 8 years ago

mgerhardy commented 8 years ago

... but works fine for loading 8-bit colormap

in caveexpress, the problem is with e.g. caveexpress-entity-small.png (PNG image data, 512 x 512, 8-bit/color RGBA, non-interlaced), but not with caveexpress-environment-small.png (PNG image data, 512 x 1024 8-bit colormap, non-interlaced). (see https://github.com/mgerhardy/caveexpress/tree/master/base/caveexpress/pics )

It also works for the opengl3 renderer. So it might be blending related (they share the same image loading and color array handling - the opengl3 renderer just does it in the shader).

https://github.com/mgerhardy/caveexpress/blob/master/src/modules/gfx/AbstractGLFrontend.cpp#L393

as reference the gl3 renderer: https://github.com/mgerhardy/caveexpress/blob/master/src/modules/gfx/GL3Frontend.cpp and the gl1 renderer: https://github.com/mgerhardy/caveexpress/blob/master/src/modules/gfx/GL1Frontend.cpp

mgerhardy commented 8 years ago

bildschirmfoto von 2015-11-26 08 55 05

mgerhardy commented 8 years ago

The error is normal map related - only happens in GL1 - because the GL3 shaders currently don't use the normal maps ;)