by Dylan16807 · 9y ago · 0 comments
I don't think associated alpha helps much here. You can special case pixels that are doing pure emission, but when a pixel is doing both you need the lighting to affect the color of the occlusion but not affect the color of the emission.
But that means you need to dedicate specific objects to being purely emissive, to avoid blurring at the boundaries.
And once you've separated the objects, you don't really need to have purely-emissive textures and non-emissive textures in the same file, with the same exact format. You might as well store emissive textures as RGB and save on memory.
Using a different format can even benefit you. You're less likely to accidentally blend emissive and non-emissive pixels, and you're less likely to accidentally apply lighting calculations to emissions.
No hacking needed.
Let's have blue-tinted pane of glass, (0, 0, .5, .5). And a red tinted pane, (.5, 0, 0, .5).
Then a blue glow, (0, 0, .5, 0). And a red glow, (.5, 0, 0, 0).
If you have your blue glass glow red, and your red glass glow blue, both combinations come out as (.5, 0, .5, .5).
Under 99% of lighting conditions, it will look wrong. If you put it in darkness, it will look overwhelmingly wrong.
Even if occlusion and emission are the same color it doesn't work. A dark blue object that glows brightly, and a bright blue object that glows dimly, both will have the same RGBA.
Anyways, read the links I provided above.