JNNGL / vanilla-shaders

Some of my vanilla shaders that I made for fun
https://discord.gg/5aU2JzXy23
91 stars 9 forks source link

How to use the rgb maps #3

Open ShiftSad opened 1 month ago

ShiftSad commented 1 month ago

Not much of an issue, but more of a cry for help.

I've been starring at the code for ages but couldn't make much sense of it. How to send a map in a way the client can interpret, as Minecraft maps consist of a list of bytes that point to a color. The data is lost, how was the example image generated, then displayed?

JNNGL commented 1 month ago

example.c in the pack directory has an example code for encoding (and decoding as well) some arbitrary data represented in the array of 4096 24-bit unsigned integers (in this case it's a 64x64 R8G8B8 image) to the map data (an array of 16384 bytes) in the format accepted by the shader.

https://github.com/JNNGL/vanilla-shaders/blob/3280e39019633023a1e6204436d6277b24bf0004/rgb_maps/example.c#L84-L99