Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

RGBA vs ARGB #189

Open
numberZero opened this issue Apr 8, 2023 · 1 comment
Open

RGBA vs ARGB #189

numberZero opened this issue Apr 8, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@numberZero
Copy link
Contributor

Irrlicht color formats are similar to OpenGL ones, but don’t match exactly. Here is a comparison (for a little-endian machine):
OpenGL vs Irrlicht color formats-Little Endian
(numbers are bit positions, 0 is the least-significant bit).

This mismatch is annoying and bug-prone. I suggest moving to OpenGL native formats. I have no roadmap, though.

P.S. On a big-endian machine, it looks a bit differently.

@sfan5 sfan5 added the bug Something isn't working label Apr 8, 2023
@numberZero
Copy link
Contributor Author

Note that it does convert colors into format OpenGL expects, or finds a weird OpenGL format (like GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV) that matches its own. The latter is not possible on ES, however, and the former is apparently impossible for vertex buffers... thus this:

#ifdef GL_ES
	vec4 color = inVertexColor.bgra;
#else
	vec4 color = inVertexColor;
#endif

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants