render: skip textures the classic renderer can't upload - #3354
Merged
copybara-service[bot] merged 1 commit intoJul 21, 2026
Merged
Conversation
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
force-pushed
the
fix/ktx-classic-renderer-skip
branch
from
June 21, 2026 05:49
616d727 to
ce025f0
Compare
haroonq
approved these changes
Jun 22, 2026
Collaborator
|
Thanks! |
haroonq
approved these changes
Jul 13, 2026
copybara-service
Bot
merged commit Jul 21, 2026
7bfa10e
into
google-deepmind:main
21 of 22 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
KTX textures crash the classic OpenGL renderer and the Python viewer with
Number of channels not supported: 1:mjCTexture::LoadKTXstores the file as an opaque single-channel blob for the Filament renderer, andmjr_uploadTextureaborts viamju_errorbecause the classic path only handles 3- or 4-channel textures.Fix
Skip textures the classic renderer can't upload (
nchannelnot 3 or 4) with a warning instead of aborting, so the model still loads and the other textures render.LoadKTXand 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.pyregression test that builds a model with a KTX texture and constructs anMjrContext; it aborts before this change and passes after.Proof
Rendered with the fix applied — the scene renders instead of crashing:
Addresses #3343.