Skip to content

render: skip textures the classic renderer can't upload - #3354

Merged
copybara-service[bot] merged 1 commit into
google-deepmind:mainfrom
Nas01010101:fix/ktx-classic-renderer-skip
Jul 21, 2026
Merged

render: skip textures the classic renderer can't upload#3354
copybara-service[bot] merged 1 commit into
google-deepmind:mainfrom
Nas01010101:fix/ktx-classic-renderer-skip

Conversation

@Nas01010101

@Nas01010101 Nas01010101 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Summary

KTX textures crash the classic OpenGL renderer and the Python viewer with Number of channels not supported: 1: mjCTexture::LoadKTX stores the file as an opaque single-channel blob for the Filament renderer, and mjr_uploadTexture aborts via mju_error because the classic path only handles 3- or 4-channel textures.

Fix

Skip textures the classic renderer can't upload (nchannel not 3 or 4) with a warning instead of aborting, so the model still loads and the other textures render. LoadKTX and the Filament path are unchanged. The guard also covers the cube/skybox path, which previously over-read a single-channel blob as RGB.

Test

Adds a render_test.py regression test that builds a model with a KTX texture and constructs an MjrContext; it aborts before this change and passes after.

Proof

Rendered with the fix applied — the scene renders instead of crashing:

IMG_8194

Addresses #3343.

KTX textures crash the classic OpenGL renderer and the Python viewer with
"Number of channels not supported: 1": mjCTexture::LoadKTX stores the file as
an opaque single-channel blob for the Filament renderer, and mjr_uploadTexture
aborts via mju_error because the classic path only handles 3- or 4-channel
textures.

Skip textures the classic renderer can't upload (nchannel not 3 or 4) with a
warning instead of aborting, so the model still loads and the other textures
render. LoadKTX and the Filament path are unchanged. The guard also covers the
cube/skybox path, which previously over-read a single-channel blob as RGB.

Add a render_test.py regression test that builds a model with a KTX texture and
constructs an MjrContext; it aborts before this change and passes after.

Addresses google-deepmind#3343.
@Nas01010101
Nas01010101 force-pushed the fix/ktx-classic-renderer-skip branch from 616d727 to ce025f0 Compare June 21, 2026 05:49
@Nas01010101 Nas01010101 changed the title render: skip textures the classic renderer can't upload instead of ab… render: skip textures the classic renderer can't upload Jun 21, 2026
@haroonq

haroonq commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Thanks!

@copybara-service
copybara-service Bot merged commit 7bfa10e into google-deepmind:main Jul 21, 2026
21 of 22 checks passed
@Nas01010101
Nas01010101 deleted the fix/ktx-classic-renderer-skip branch July 21, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants