Add mjmodel support for textures with different number of channels.

PiperOrigin-RevId: 653974959
Change-Id: Ia280e0bdb21027646249f104f21bedee792ba7e5
This commit is contained in:
Tom Erez
2024-07-19 05:21:16 -07:00
committed by Copybara-Service
parent 70ac76bb4b
commit e92af73cbf
11 changed files with 43 additions and 24 deletions
+3 -2
View File
@@ -924,8 +924,9 @@ struct mjModel_ {
int* tex_type; // texture type (mjtTexture) (ntex x 1)
int* tex_height; // number of rows in texture image (ntex x 1)
int* tex_width; // number of columns in texture image (ntex x 1)
int* tex_adr; // address in rgb (ntex x 1)
mjtByte* tex_rgb; // rgb (alpha = 1) (ntexdata x 1)
int* tex_nchannel; // number of channels in texture image (ntex x 1)
int* tex_adr; // start address in tex_data (ntex x 1)
mjtByte* tex_data; // pixel values (ntexdata x 1)
int* tex_pathadr; // address of texture asset path; -1: none (ntex x 1)
// materials
+2 -1
View File
@@ -410,8 +410,9 @@
X ( int, tex_type, ntex, 1 ) \
X ( int, tex_height, ntex, 1 ) \
X ( int, tex_width, ntex, 1 ) \
X ( int, tex_nchannel, ntex, 1 ) \
X ( int, tex_adr, ntex, 1 ) \
X ( mjtByte, tex_rgb, ntexdata, 1 ) \
X ( mjtByte, tex_data, ntexdata, 1 ) \
XMJV( int, tex_pathadr, ntex, 1 ) \
XMJV( int, mat_texid, nmat, mjNTEXMAT ) \
XMJV( mjtByte, mat_texuniform, nmat, 1 ) \