// - better support texture edge_clamp: explicitly mod texcoords by 1, use textureGrad to avoid
// mipmap articats. Need to do compute texcoords in vertex shader, offset towards
...
...
@@ -373,6 +376,8 @@ enum
STBVOX_FACE_south,
STBVOX_FACE_up,
STBVOX_FACE_down,
STBVOX_FACE__count,
};
...
...
@@ -540,7 +545,58 @@ struct stbvox_mesh_maker
// color:8
// Default uniform values
// Faces:
//
// Faces use the bottom bits to choose the texgen
// mode, and all the bits to choose the normal.
// Thus the bottom 3 bits have to be:
// e, n, w, s, u, d, u, d
enum
{
STBVOX_EFACE_east,
STBVOX_EFACE_north,
STBVOX_EFACE_west,
STBVOX_EFACE_south,
STBVOX_EFACE_up,
STBVOX_EFACE_down,
STBVOX_EFACE_east_up,
STBVOX_EFACE_east_down,
STBVOX_EFACE_east_up_wall,
STBVOX_EFACE_north_up_wall,
STBVOX_EFACE_west_up_wall,
STBVOX_EFACE_south_up_wall,
STBVOX_EFACE_dummy_up_2,
STBVOX_EFACE_dummy_down_2,
STBVOX_EFACE_north_up,
STBVOX_EFACE_north_down,
STBVOX_EFACE_ne_up,
STBVOX_EFACE_nw_up,
STBVOX_EFACE_sw_up,
STBVOX_EFACE_se_up,
STBVOX_EFACE_dummy_up_3,
STBVOX_EFACE_dummy_down_3,
STBVOX_EFACE_west_up,
STBVOX_EFACE_west_down,
STBVOX_EFACE_ne_down,
STBVOX_EFACE_nw_down,
STBVOX_EFACE_sw_down,
STBVOX_EFACE_se_down,
STBVOX_EFACE_dummy_up_4,
STBVOX_EFACE_dummy_down_4,
STBVOX_EFACE_south_up,
STBVOX_EFACE_south_down,
// @TODO either we need more than 5 bits to encode the normal to fit these, or we can replace 'dummy' above with them but need to use full-size texgen table
// so for now we just texture them with the wrong projection