Skip to content

Commit 42d8454

Browse files
Google DeepMindcopybara-github
authored andcommitted
Internal change.
PiperOrigin-RevId: 798190254 Change-Id: Ie3a3b6e074511991cc6ccb35f2c26c6d9ae7ccd8
1 parent debbd7c commit 42d8454

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

python/mujoco/renderer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,10 @@ def render(self, *, out: Optional[np.ndarray] = None) -> np.ndarray:
242242
else:
243243
_render.mjr_readPixels(out, None, self._rect, self._mjr_context)
244244

245-
out[:] = np.flipud(out)
245+
if self._gl_context:
246+
# If using EGL, OSMesa, or GLFW, the output image is flipped vertically.
247+
# No flip is needed for Filament.
248+
out[:] = np.flipud(out)
246249

247250
return out
248251

0 commit comments

Comments
 (0)