oc2
oc2 copied to clipboard
Projector color format
Describe the bug I've been playing around with the projector and it's awesome but the docs seem to be incorrect about the color format. According to the docs, the color format for the projector should be r5g6b5. I was getting wrong colors though so I switched around the colors and the actual color format seems to be b5r6g5.
To Reproduce Steps to reproduce the behavior:
- Build a simple computer+projector setup (assuming projector is on /dev/fb0)
- Execute
lua -e 'io.open("/dev/fb0","w"):write(("%\0"):rep(640*480))'
(This will fill the entire buffer with 0b1111100000000000, that should be red) - Projector image will be blue instead of red
Expected behavior Either the colors should be according to the docs or the docs need to be updated to the correct color format.
Also is there any reason to this weird color format? I guess colors get translated back into normal rgb anyway so I don't really get the point. Yes, it does safe up some memory but at the cost of the encoding that needs to be done to bring the image into your format.
Screenshots
Versions (please complete the following information):
- Minecraft: 1.18.2
- Forge: 40.1.93
- OC2: 0.1.8
It seems to be rgb565 for me, i wrote an app to display PNG files onto the screen, and my conversion code assums RGB565, and it does produce correct output, perhaps your test is wrong? https://github.com/Beyley/fbz/blob/c1211675f6bec0b99d68cf3dd42c33864aca23e7/src/fmtconv.zig#L16