Arf, that's what I thought...
And adding this effect in the material pass re-couples materials and lighting, which kind of kills the purpose of light prepass ^^.
Hmm actually, now that I'm thinking of it, we could use the light prepass for the many small spot/omnidirectional lights, and add the one and only directional light (the sun) at the same time as the materials pass.
That would be the only light that would trigger he backlight/rim lighting effect.

What do you think?

PS: I'm adding the mailing list as a copy for making the discussion public. We try to make it known when students got feedback from us to make it fair ^^.

2013/4/30 Lauri Kasanen <>
On Mon, 29 Apr 2013 21:00:42 +0200
Lionel Fuentes <> wrote:

> Actually I was thinking of something simpler: a backlighting term in
> the lighting equation that would look like:
> color += max(0, 1-dot(n, view))*materialColor*lightColor;
> Would that fit with the separate light buffer?

If it was put in the light buffer, then everything would have the
effect, not just karts. It could be done that way too, but to have it
only on karts, it'd be better to do it in the kart's material shader
(assuming the light prepass system).

Splitting the depth/normal shader at the start, for karts and
non-karts, is possible, but it would be both extra work and less

- Lauri