I don't see how the material effect would harm anything - that's the
point of light prepass, allowing each mesh to interpret the light data
as it sees fit. The effect itself doesn't use any light data, but it
would look funny if every kart glowed in the dark, yes.

I was afraid we needed some light-specific information during the material pass; like whether or not the light was set to trigger backlighting or the light's color.
But actually I think you're right, we could just apply the effect during the material pass, for objects that are marked as such, and it would modulate the lighting we fetch from the light buffer :
light *= max(0, 1-dot(n, view));
(probably better than doing "if(light > 0.2)").

That would avoid glowing karts in the dark.

We couldn't mark a specific light as "backlight trigger" but I think that's alright.


2013/4/30 Lauri Kasanen <cand@gmx.com>
On Tue, 30 Apr 2013 13:55:54 +0200
Lionel Fuentes <funto66@gmail.com> wrote:

> 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?

I don't see how the material effect would harm anything - that's the
point of light prepass, allowing each mesh to interpret the light data
as it sees fit. The effect itself doesn't use any light data, but it
would look funny if every kart glowed in the dark, yes.

(Or perhaps it would look good. Needs testing ;))

I believe the trigger for rim lighting can use the aggregated light
data just fine, without need to special case any light.

Ie,
if (light > 0.2) show_rim_lighting(); // Say ambient is 0.1, so some
light is shining here.

- Lauri