Daemon
Daemon copied to clipboard
WIP: computeLight: rewriting diffuse alpha channel looks suspicious
Light accumulation was done on all color components including alpha channel, that can't be good.
Does this fix anything?
No, I haven't seen something being broken because of that (or I was not aware of), but that bug may be uncovered later when adding features or reorganizing code.
This is just debugging code, right?
Hmmm, I feel stupid, the alpha channel is not rewritten with light computation but with 1.0, which does not seems legit by the way, since 1.0 alpha channel is fully transparent.
And yes, it's debug code, I don't know how I managed to miss that. But anyway, setting a texture to be fully transparent to show the rgb channels seems wrong. For some reason, I'm not able to see the bug I expect.
This is the code before, this is not what I expect the code to render (and the glass displaying light color on borders if alpha channel is fully transparent?):
This is the code after, which is what the code claims to do when there is no alpha channel rewrite:
We may want to not blend the debug light color by setting it fully opaque (0 alpha channel)
This is the code when there is alpha channel rewrite to 0.0 (fully opaque), so at least we know the alpha channel is read:
So, what to do, keep the legacy behavior (set alpha channel to 1), keep the alpha channel unmodified?, set the alpha channel to 0 (fully opaque)?
Note that in later case, the light color is not displayed the same, maybe it's not what we want.
In all case I plan to merge the very first commit that reword stuff to make it more readable.
@cmf028 this code was introduced by you in bc079b95ef0342b159a1d00378d49a556416eec0, I would like to get your opinion on that.


