adding shadow encoding