I made a custom vertex declaration by copy-pasting the VertexPositionNormalTexture code from the monogame source and changing the position type from Vector3 to Byte4.
When I debug the vertex shader, the texture coordinates and normals have the expected output.However, the position output outputs weird numbers. For example, the position (94, 1, 128) becomes the position (1,32E-43, 1.4E-45, 1.79E-43).
Here are the results I get when I use a Byte4 to hold the position data. Notice that the BLOCKPOS should be equal to the position input but it isn’t for some reason.
HLSL doesn’t have byte types. You can pack the bytes if you want, but it’ll be more expensive. It doesn’t matter for sending the data, because the conversion to bytes happens on the GPU.
I’ve used bytes for position before in a voxel engine that had chunks of 256x256x256 (or smaller) voxels. By setting uniforms with the starting position of the chunk and the voxel size you can make do with bytes.