TTimo / GtkRadiant

The open source, cross platform level editor for idtech games
http://icculus.org/gtkradiant/
Other
581 stars 152 forks source link

lightmap floodlight and exposure [netradiant's q3map2 pivot commit] #605

Closed illwieckz closed 6 years ago

illwieckz commented 6 years ago

TL;DR: this is the diff between the very old commit merging gtkradiant 1.5's q3map2 in zeroradiant tree and the initial commit of netradiant being synced to the rambetter change applied in both tree. If I had not missed something, once this is merged every q3map2 commit from netradiant side will apply to some existing history in gtkradiant side


That is probably the hardest commit and hardest git job I did in my life.

I wanted to backport the sRGB lightmap stuff from netradiant tree until I discovered the patches were expecting some very older code (especially the one related to lightmap exposure) to be already there. So I looked for the commit adding this… and I discovered the horror thing.

The very initial gtkradiant commit seems to clone some unknown repo whithout some history (svn mess & all), the very initial commit in netradiant's tree looks to have cloned a fork of that unknown repository (svn mess & all) without history neither. The gtkradiant commit cherry-picked some stuff from that third-party repository or another one (there is many references to both zeroradiant and gtkradiant 1.5 in both trees). So basically, on the q3map2 side, initial netradiant commit were 88cea02 plus undocumented additions. I say were because that PR is basically the documentation of those additions. :-)

The a16ee23 commit (rambetter-math-fix-experiments branch merge) was then merged on both gtkradiant and netradiant but on netradiant side it was modified to fit the additions…

So I basically diffed the very initial commit of netradiant with the commit merging some gtkradiant 1.5 q3map2 stuff on gtkradiant tree (which is older) and rebased that diff on master. Then I rebased the modification to the netradiant commit merging rambetter-math-fix-experiments with adjustments.

Of course the per-change commits between the 1.5 branch merged to gtkradiant and the first netradiant commit are probably lost. For what I see this code is adding floodlight support (cheap and quick lighting), exposure support, and some debug behavior:

This is the netradiant's q3map2 help for these changes:

  -debugnormals     Color the lightmaps according to the direction of the surface normal
  -floodlight       Enable floodlight
  -lowquality       Low quality floodlight
  -exposure <F>     Lightmap exposure to better support overbright spots

If I'm right, once this code is merged all other q3map2 changes from netradiant can be cherry-picked from the current netradiant git history (I'm not saying it's easy though). This is the q3map2 pivot commit: once this code is merged there would be no netradiant commit that would try to modify non-existent code when applied on gtkradiant side.

TTimo commented 6 years ago

Thanks @illwieckz - I can appreciate the amount of work that has gone into this. Ready over the changes doesn't raise any flags for me, I guess we'll just have to see if some stuff suddenly starts breaking once we start using this new build..

Aciz commented 6 years ago

I'd like to point out here that if this is ported over from netradiant without any modifications to floodlight functionality, it does not work well with styled lightmaps. It tends to fully illuminate them, which in a way is understandable, but not really practical in terms of visuals. I suggest adding a way to disable floodlighting on styled lightmaps.

TTimo commented 6 years ago

@Aciz please open an issue for this, now that this PR has been merged it's unlikely to be looked at for further work again.

Aciz commented 6 years ago

@TTimo will do tomorrow once I'm home and can provide more details and explanation about the issue.