Multiple layers with different shader sets?

So, I like the cartoon shader for the look of the game I’m working on, but it does have some problems. It didn’t play well with text billboards used to label things on my star map. I solved this by moving labels to a separate buffer/layer that’s rendered on top of the main layer.

It also does ugly things to the background stars in the sky box. I’d like to do a similar thing with the skybox, rendering it behind everything but not shaded. It’s not proven hard to move the skybox to its own layer as well, but getting it behind the cartoon shaded models has proved beyond me.

In theory I could render them to another buffer/layer, but everything I attempt towards that leaves them operating on the main render. What am I missing here?

Link to the code in question on github

Ah, solved it myself. Rather than mess around with trying to composite layers on render2d, overlapping DisplayRegions were the answer.

  dr1 = base.win.makeDisplayRegion(0, 1, 0, 1)
  dr1.setCamera(self.starcamera)
  dr1.setSort(-1)
  
  dr2 = base.win.makeDisplayRegion(0, 1, 0, 1)
  dr2.setCamera(self.labelscamera)
  dr2.setSort(10)

This gets them in front of, and behind the main render as i need them, provides the main render is using a clear backdrop.

I will push the fixed code to github shortly.