Hello, I have some informations which I pack into a UInt32 in my C++ code.
Here is the fonction :
uint32 UVoxelPaintSubsystem::PackPaintValue(uint32 A, uint32 B, uint32 C, uint32 D)
{
checkf(A <= 0x1FFu, TEXT("PaintSubsystem: erreur 1), %u"), A);
checkf(B <= 0x1FFu, TEXT("PaintSubsystem: erreur 2, %u"), B);
checkf(C <= 0x3FFu, TEXT("PaintSubsystem: erreur 3, %u"), C);
checkf(D <= 0xFu, TEXT("PaintSubsystem: erreur v4, %u"), D);
return (A & 0x1FFu)
| ((B & 0x1FFu) << 9)
| ((C & 0x3FFu) << 18)
| ((D & 0xFu) << 28);
}
We want to send these a lot of these values to a large number of dynamic materials (in a parameter linked to a custom node) in the cleanest possible way.
Every bit economised is important here, because we have to send a lot of information.
We had considered sending this information as a texture, but the issue is that textures have width and length limitations; this requires spreading our lists across many rows, which leads to poor reconstruction.
The ideal approach would be to send a raw list of 32bits elements, thereby avoiding the need to reconstruct the data from a texture.
We know that GPU works mainly with float number.
Anyone know the best way to do that ?