Blender 2.8 ID mask not working

Following this:

tutorial (at ~43:00) an ID Mask is used to select a single object (in this case the “sun”). In my case I tried
adding a custom index to the sun but always get a dark background (which is partially correct since I don’t have a skybox (the “Earth” is not shown but neither is the sun). These are my settings:

Why isn’t the sun object selected by the ID mask?

Fixed it. Look for “Pass index” in material properties; also check that “Index” is enabled. Don’t forget to rerender afterwards. This is insanely hard to figure out alone.