Skip to content

Commit 78a6147

Browse files
siegelnalimuldal
authored andcommitted
Improve lighting in soccer pitch.
Plane geoms in mujoco don't actually have a height, they extend infinitely downward. Instead, the third number in the size argument represents the size of the grid which is used for rendering lighting. Lighting values for the plane are calculated at each grid vertex and interpolated in between. The current large grid size is what's causing the lighting artifacts we've been seeing in soccer videos. This CL reduces the grid size, which makes lighting on the ground look much more realistic. It also renames the grid size variable to reflect its true purpose.] PiperOrigin-RevId: 300565743 Change-Id: I9c5810cbaec576eeb012f584ad7c1dc659faa4cd
1 parent 29e8d14 commit 78a6147

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎dm_control/locomotion/soccer/pitch.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
_WALL_HEIGHT = 10.
3333
_WALL_THICKNESS = .5
3434
_SIDE_WIDTH = 32. / 6.
35-
_GROUND_GEOM_HEIGHT = 0.5
35+
_GROUND_GEOM_GRID_RATIO = 1. / 100 # Grid size for lighting.
3636
_FIELD_BOX_CONTACT_BIT = 1 << 7 # Use a higher bit to prevent potential clash.
3737

3838
_DEFAULT_PITCH_SIZE = (12, 9)
@@ -131,7 +131,7 @@ def _build(self,
131131
'geom',
132132
type='plane',
133133
material=self._ground_material,
134-
size=list(self._size) + [_GROUND_GEOM_HEIGHT])
134+
size=list(self._size) + [max(self._size) * _GROUND_GEOM_GRID_RATIO])
135135

136136
# Build walls.
137137
self._walls = []
@@ -323,7 +323,8 @@ def initialize_episode_mjcf(self, random_state):
323323
self._top_camera_distance)
324324

325325
# Resize ground geom size.
326-
self._ground_geom.size = list(self._size) + [_GROUND_GEOM_HEIGHT]
326+
self._ground_geom.size = list(
327+
self._size) + [max(self._size) * _GROUND_GEOM_GRID_RATIO]
327328

328329
# Resize and reposition walls and roof geoms.
329330
for i, (wall_pos, _) in enumerate(_wall_pos_xyaxes(self._size)):

‎setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def find_data_files(package_dir, patterns):
166166

167167
setup(
168168
name='dm_control',
169-
version='0.0.300079494',
169+
version='0.0.300565743',
170170
description='Continuous control environments and MuJoCo Python bindings.',
171171
author='DeepMind',
172172
license='Apache License, Version 2.0',

0 commit comments

Comments
 (0)