Author Topic: What happened to diffuse/albedo lighting from non-sun sources?  (Read 369 times)

0 Members and 1 Guest are viewing this topic.

Offline Kolgena

  • 211
What happened to diffuse/albedo lighting from non-sun sources?
I've been doing some testing of lighting settings since Swifty's last patch that fixed albedo and specular handling, and set both spec_tube and spec_point to zero. The effect is that there's exactly no lighting contribution from any tube or point sources.

My understanding is that point and tube lights should have a diffuse/albedo component that should still be visible if the specular component is set to zero. To test this, I turned spec_static to zero as well, but ships are still lit (dully) by sun lights. Clearly, the way the engine handles static lighting is different from how it handles point and tube lighting. This is strange for an engine attempting to do PBR.

If I toggle deferred rendering on and off in launcher, I can see that the old rendering gave diffuse contributions as well as specular contributions from point and tube lights. This is lost in deferred rendering. The easiest way to demonstrate this is with Damage Lightning in the ship lab. Dark areas of the model should light up quite a bit with damage lightning (diffuse component + specular component) and do in the old renderer. In the new renderer, the light component only exists as specular. If you turn spec_point to zero, the damage lightning has no lighting effect on the model whatsoever.

Is this behavior intended? I feel like there's a lot of dynamic lighting behavior that is getting lost with the current deferred renderer.

(as a side nitpick, is it possible for the deferred renderer to always render sun lights, regardless of intensity? It's odd when during beam spam or mass explosions the sun suddenly turns off and the *only* diffuse lighting source in the scene disappears)

 

Offline Swifty

  • 210
  • I reject your fantasy & substitute my own
Re: What happened to diffuse/albedo lighting from non-sun sources?
Deferred lighting looks different because I fixed a bug where we were using specular light color for the Fresnel reflectance term. That's an incorrect use of Fresnel reflectance and did not match what was in the forward lighting model shader. That's been fixed to use the actual specular material color in the g-buffer.

The reason why your experiments didn't work is because I discovered a bug where spec_tube and spec_point also affect diffuse deferred light. So trying to infer if diffuse light was working independent of specular light via spec_tube and spec_point would not have worked.

And no, deferred lighting doesn't work with directional lights. Directional lights are still applied via the forward lighting model shader.

 

Offline Swifty

  • 210
  • I reject your fantasy & substitute my own
Re: What happened to diffuse/albedo lighting from non-sun sources?
It looks like the behavior of light attenuation is incorrect which is why deferred lighting looks less intense following the Fresnel reflectivity fix in the deferred lighting shader. I've fixed it in this pull request: https://github.com/scp-fs2open/fs2open.github.com/pull/1284

 

Offline Kolgena

  • 211
Re: What happened to diffuse/albedo lighting from non-sun sources?
Wow, you're on a roll with the bug fixes. Thanks!