diff --git a/metadrive/component/sensors/semantic_camera.py b/metadrive/component/sensors/semantic_camera.py index afb56ea80..de4a4f0b7 100644 --- a/metadrive/component/sensors/semantic_camera.py +++ b/metadrive/component/sensors/semantic_camera.py @@ -37,10 +37,25 @@ def _setup_effect(self): label, Terrain.make_render_state(self.engine, "terrain.vert.glsl", "terrain_semantics.frag.glsl") ) else: - cam.setTagState( - label, - RenderState.make( - ShaderAttrib.makeOff(), LightAttrib.makeAllOff(), TextureAttrib.makeOff(), - ColorAttrib.makeFlat((c[0] / 255, c[1] / 255, c[2] / 255, 1)), 1 + + if label == Semantics.PEDESTRIAN.label: + # PZH: This is a workaround fix to make pedestrians animated. + cam.setTagState( + label, + RenderState.make( + # ShaderAttrib.makeOff(), + LightAttrib.makeAllOff(), + TextureAttrib.makeOff(), + ColorAttrib.makeFlat((c[0] / 255, c[1] / 255, c[2] / 255, 1)), + 1 + ) + ) + + else: + cam.setTagState( + label, + RenderState.make( + ShaderAttrib.makeOff(), LightAttrib.makeAllOff(), TextureAttrib.makeOff(), + ColorAttrib.makeFlat((c[0] / 255, c[1] / 255, c[2] / 255, 1)), 1 + ) ) - )