Closed smilediver closed 5 months ago
@smilediver I found only 3 times like you means:
Our ... code is full of hacks like these:
auto pixelFormat = AX_GLES_PROFILE == 200 ? PixelFormat::A8 : PixelFormat::R8;
@smilediver May a "global pixelFormat" member is the solution on your code, defined only one times? Can you close this issue?
I would prefer for this to be handled on the engine side, since the engine's whole purpose is to abstract out such minor platform differences. But if people don't see this as something useful, then I'll close the issue.
@halx99 @rh101 What are you meaning?
Can by done #1839 and GLES2 will emulate R8 RG8 via:
GLES 2.0 for single channel textures used PixelFormat::A8, but in GLES 3.0 it was removed in favor of PixelFormat::R8. It seems like all other graphics APIs also use PixelFormat::R8. Our and Axmol code is full of hacks like these:
auto pixelFormat = AX_GLES_PROFILE == 200 ? PixelFormat::A8 : PixelFormat::R8;
Maybe it's worth to make
PixelFormat::A8 = PixelFormat::R8
and deal with the difference on the backend side when calling GLES api, so all code could usePixelFormat::R8
everywhere? I'm not aware of unintended consequences, but at first sight it seems it would work. There could also be a macro to help on the shader code side, something like:What do you think?