source-sdk-2013 icon indicating copy to clipboard operation
source-sdk-2013 copied to clipboard

Fix VRAD prop indirect lighting regression

Open ficool2 opened this issue 7 months ago • 4 comments

VRAD's prop lighting has been noted to regress since Orangebox particularly in TF2. Specifically, prop lighting appears to be darker and more harsh overall. After some digging, this is caused by a faulty calculation for how indirect (bounced) lighting is sampled on props.

Orangebox VRAD did not take into account any falloff or dot from a lighting sample. However because of this, it lead to an unnaturally bright result, although some users opinionated this is an improvement over current VRAD.

Current (TF2) VRAD accounts falloff from the sample, using an inverse square law, presumably to fix the bright results of the Orangebox's method. Unfortunately, this falloff is quite harsh and therefore creates an unnaturally dark result.

This PR implements a middleground of those both in VRAD. It only takes into account the dot of a sample, which leads to a decent spot in-between where it's not too dark or not bright. In-fact, this is the same change that CS:GO VRAD implemented to have more natural prop lighting. A bonus is this also more closely matches the indirect lighting calculation for brushes.

However, for the sake of compatibility with maps that might depend on the previous algorithms' results, a new VRAD option named -StaticPropIndirectMode is added to allow users to switch to the old TF2 or Orangebox algorithm.

Comparison: 2fort

ficool2 avatar Jun 10 '25 10:06 ficool2

oh, hi! Ficool!

This solution Looks amazing! ❤️ i suppose adding AO too as #1343 mentioned is a optional enhancement better left to be done separately someday.

now i just really hope this gets in!!!!

hourai-branch avatar Jun 10 '25 14:06 hourai-branch

This is a huge improvement; I had assumed static props weren't taking indirect lighting into account at all, as I was getting some parts of props as pitch black when recompiling DoDS maps. I'm definitely going to be adding this to my personal VRAD fork, but I do hope that if this PR is approved, the other first party SDK2013 games besides TF2 get the update as well, so everyone can benefit.

For clarification, does the lighting issue also affect the singleplayer SDK? The comments mention TF2 specifically, but it sounds like the change was a 2013 thing (so it'd also affect HL2).

SirYodaJedi avatar Jun 11 '25 02:06 SirYodaJedi

This is a huge improvement; I had assumed static props weren't taking indirect lighting into account at all, as I was getting some parts of props as pitch black when recompiling DoDS maps. I'm definitely going to be adding this to my personal VRAD fork, but I do hope that if this PR is approved, the other first party SDK2013 games besides TF2 get the update as well, so everyone can benefit.

For clarification, does the lighting issue also affect the singleplayer SDK? The comments mention TF2 specifically, but it sounds like the change was a 2013 thing (so it'd also affect HL2).

this also effects the SP sdk as well i think.

Bitl avatar Jun 11 '25 03:06 Bitl

For clarification, does the lighting issue also affect the singleplayer SDK? The comments mention TF2 specifically, but it sounds like the change was a 2013 thing (so it'd also affect HL2).

Games not derived from SDK 2013 MP have the orangebox algorithm (and so suffer from being too bright)

ficool2 avatar Jun 11 '25 08:06 ficool2

I think its kind of sad to see valve has done nothing with this yet...

hourai-branch avatar Nov 06 '25 20:11 hourai-branch