How to turn on ground shadows?

all the examples online seem to show images of humanoid, cartpole, and ant with shadows underneath them, but i’m not seeing any. i’ve tried updating the <light> elements in nv_ant.xml to no avail


<light directional="false" diffuse=".2 .2 .2" specular="0 0 0" pos="0 0 5" dir="0 0 -1" castshadow="false"/>
<light mode="targetbodycom" target="torso" directional="false" diffuse=".8 .8 .8" specular="0.3 0.3 0.3" pos="0 0 4.0" dir="0 0 -1"/>

i tried:

<light directional="true" diffuse=".2 .2 .2" specular="0 0 0" pos="0 0 5" dir="0 0 -1" castshadow="true"/>
<light mode="targetbodycom" target="torso" directional="true" diffuse=".8 .8 .8" specular="0.3 0.3 0.3" pos="0 0 4.0" dir="0 0 -1"/>

still no shadows:

Screenshot from 2022-04-28 12-18-59

Screenshot from 2022-04-28 12-30-33

vs shadows:

Screenshot from 2022-04-28 12-45-21

anything i can do to activate shadows on the ground?

Actually I always have shadow in my environments, and never noticed a line of code related to it, have you tried this function:


  • param1 ( Sim ) – Simulation Handle.
  • param2 ( int ) – index to the light to be changed.
  • param3 ( isaacgym.gymapi.Vec3 ) – intensity intensity of the light focus in the range [0,1] per channel, in RGB.
  • param4 ( isaacgym.gymapi.Vec3 ) – ambient intensity of the ambient light in the range [0,1] per channel, in RGB.
  • param5 ( isaacgym.gymapi.Vec3 ) – direction direction of the light focus

I just read this part:
The lighting model is the only part of Isaac Gym’s graphics system which is shared globally. Calling set_light_parameters affects the RGB images of all camera sensors in all environments and the viewer universally.

I think it means if you set it once it’s going to change the lighting parameters somewhere in a config file and keep it like that until you change it again.
I’m not feeling like turning on my other computer otherwise I would test it for you :))

hey thanks for the suggestion! it didn’t succeed at rendering shadows but it did actually change the lighting on the environments. neat

i tried:

self.gym.set_light_parameters(self.sim, 0, gymapi.Vec3(0.8, 0.8, 0.8), gymapi.Vec3(0.8, 0.8, 0.8), gymapi.Vec3(1, 2, 3))

Nice! any change by changing the light direction?, (1,2,3) is upward I think, the light should be downward maybe?

oo good point/idea but still no shadows.

    # 1 2 3

Screenshot from 2022-04-28 15-49-00

    # -1 -2 -3

Screenshot from 2022-04-28 15-49-33

    # 1 2 -3

Screenshot from 2022-04-28 15-50-06

I did a test, by playing with the light direction I got two shadows!

It means probably this function wont change the default lighting parameters of the environment.
It’s very strange that you don’t have shadows in your environments, I have shadows in all the environments I have tested. It might be a bug!

that’s cool! and thanks for trying that out abi64! yeah it’s smelling like a bug i’ll just update things in a while

what version are you using? i’m on preview 3 (1.0rc3)

My guess is, that whether you have shadows or not depends on your graphics card, i.e. if it is a RTX or not. I don’t think you will be able to find a setting to turn on shadows, unfortunately

it’s a geforce rtx 3070

NVIDIA-SMI 510.47.03 Driver Version: 510.47.03 CUDA Version: 11.6

love to know if anyone else is/n’t seeing shadows with this setup

The reason i think it’s the graphics card is that i have multiple systems available. On my laptop (quadro t500) isaac gym wont render any shadows. On workstations and server (RTX 3090 and a6000) there will be shadows. But interesting to know, that your 3070 also doesn’t render shadows. I actually would like to turn them off, i think they are detrimental to bridging the reality gap and force me to use depth information.

interesting. how are you getting graphics from the server? using vnc / remote desktop? i tried using isaac gym on aws and eventually gave up, unable to get graphics to render

Currently i am doing vision-based grasping and for testing purposes saved some images during training (e.g. with opencv). Otherwise i don’t see the point in using the viewer during training as it just costs compute. I would recommend using tensorboard to verify and observe the training process.

well specifically i wanted to play back a saved checkpoint in test mode. is that something you’re able to do from your server?

Sorry, i didn’t really try to do stuff like that. But from the forum posts related to that, it looks like it isnt really possible. However, there was a framework based on isaac gym, with which you can access the viewer via websocket, so maybe that works: