#Rendering on parts of a mesh that aren't hit by light.

6 messages · Page 1 of 1 (latest)

void imp
#

I want to do as the title says, with some added caveats where ideally I'd be able to access the original/unlit texture and also the frag's distance from the camera. I've been able to get Something sorta working by computing camera distance in a fragment shader and passing it to the light shader, then just setting diffuse if the normal light calculation is low. Couple fundamental problems with it though. Firstly, light's only called at all if there's, you know, light that's maybe hitting it. So if the object isn't nearby a light's area it doesn't work. A fix to that could be to add a directional light that's black. But then that "illuminates" the second problem. The normal light calculation should add lights together, and light() is called once per light, so my implementation will process the first black light, recognize it's an unlit frag, and apply it's stuff. Then the bright light will hit, and add to my already rendered stuff, which is exactly what I'm trying to avoid. Any advice on how to achieve something like this would be greatly appreciated.

#

the problem of light not getting called at all:

#

solved with black light:

#

but not really

void imp
#

sorta maybe something with next-pass?

#

there's clearly still problems though