Smoothlighting

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Smoothlighting

Re: Smoothlighting

by Graf Zahl » Thu Aug 21, 2008 12:56 am

Please do me a favor in the future and keep such patches separate. It would make it much easier to undo them if one doesn't work well.

And you are correct: The formula was wrong. The '2*' has become obsolete in the mean time.

Re: Smoothlighting

by Blzut3 » Wed Aug 20, 2008 7:17 pm

I took a shot at doing it, but I don't know if any thing has changed since the result doesn't look that great (at least I think the screen shots looked better). I also took care of my feature request while I was at it.

Code: Select all

- Added: doom2day's smoothlighting
- Added: dontincrement argument to A_CheckForReload.

Re: Smoothlighting

by Graf Zahl » Wed Aug 20, 2008 12:47 pm

Integrating it properly. The code just hacks the feature in and disables what was there before.

Re: Smoothlighting

by Gez » Wed Aug 20, 2008 12:11 pm

What is the remaining work, exactly? Just making it into an option, or something else as well? (And if so, what?)

Re: Smoothlighting

by Graf Zahl » Wed Aug 20, 2008 11:50 am

So?

Is someone willing to do the remaining work here?

Re: Smoothlighting

by Gez » Wed Jul 16, 2008 4:51 am

Cutmanmike wrote:Call me blind/dumb but I can't tell what's so different about the two screens.
The Heretic ones? Look at the brightness of the cliff walls on that curved part.
Doom fakes contrast by changing wall brightness. With flat lightning, all walls are at sector brightness. With normal lightning, that's still true except for walls that are perfectly aligned on the X or Y axis: ones are a bit brighter than sector, the other are a bit darker. This increases the contrast and helps them look more 3D and less flat picture. With smoothlightning, the brightness depends on the angle, it's not a ternary "angle 0 -> brighter, angle 90 -> darker, anything else: same" behavior. So it allows to have non-orthogonal walls that contrast with each others.

Re: Smoothlighting

by Cutmanmike » Wed Jul 16, 2008 4:43 am

I see what you mean but the one in shot 2 just looks like there's no lightning difference full stop. I guess this is one thing better to see in game rather than in screenshots.

Re: Smoothlighting

by Enjay » Wed Jul 16, 2008 4:40 am

Look at how the curved wall behind the crosshair is lit. The two pics are quite different.

Re: Smoothlighting

by Cutmanmike » Wed Jul 16, 2008 4:31 am

Ditto.

*strains eyes* Nope I just can't see it :|

Re: Smoothlighting

by CaptainToenail » Wed Jul 16, 2008 4:29 am

To be honest either can I, when I heard smooth lighting I thought it would be a smooth gradient between different light levels so that there arn't any sharp bright area/dark area lines, this is something I would like

Re: Smoothlighting

by Cutmanmike » Wed Jul 16, 2008 3:35 am

Call me blind/dumb but I can't tell what's so different about the two screens.

Re: Smoothlighting

by Graf Zahl » Wed Jul 16, 2008 1:43 am

You just mentioned the one issue why it hasn't been included yet. It still needs some work and can't just be copied in.

And I really don't have the time to clean it up so as long as it stays in its current state I'm afraid not much will happen.

Re: Smoothlighting

by Coon » Tue Jul 15, 2008 5:36 pm

Is the code even remotely close to being ready? has someone touched it ever since? this would be a killer feature :thumb:

Re: Smoothlighting

by Graf Zahl » Mon Jun 30, 2008 4:46 pm

The only reason this hasn't been included yet is that all code snippets were quickly thrown together and need considerable cleaning up. As such I can't just add them without having some time to invest here.

Re: Smoothlighting

by Gez » Mon Jun 30, 2008 3:47 pm

Xaser wrote:Hmm, if my opinion matters against all this heavy code-talk, I'd like to add that I will undoubtedly use this heavily if implemented!

That's always been one of my main bothers with fake contrast. I don't like how the maps look with evenlighting but on the other hand the normal method *did* look strange on curves and the like. IMO, this makes things simply better-looking across the board.
I don't know what are the chances of this getting into an official build.

In the meantime, I've tried putting it in the GL renderer as well, because I personally prefer GZDoom in hardware mode to ZDoom. Oddly, it didn't seem to have any noticeable effect. I've found out that I had to multiply the value by four instead of two to get something discernable in-game. Anyway, here's what I did to the gl_walls.cpp file:

Code: Select all

void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector, subsector_t * polysub)
<snip a lot of stuff which I won't quote entirely because it's long and unchanged>


	lightlevel = seg->sidedef->GetLightLevel(true, frontsector->lightlevel);
	if (lightlevel<255 && gl_fakecontrast && !(flags&GLWF_FOGGY))
	{
		/* if (seg->sidedef->Flags & WALLF_AUTOCONTRAST) // commenting out to quickly test smoothlighting
		{
			rellight = (seg->linedef->dx==0? level.WallVertLight : seg->linedef->dy==0 ? level.WallHorizLight : 0);
		}
		else if (!(seg->sidedef->Flags & WALLF_ABSLIGHTING))
		{
			rellight = seg->sidedef->Light<<1;
		}
		else rellight = 0; */

		if (true) // (Flags & WALLF_SMOOTHLIGHTING)
		{
			rellight = int		// OMG LEE KILLOUGH LIVES! :/
				(4*
					(float(level.WallHorizLight)
					+abs(atan(float(seg->linedef->dy)/float(seg->linedef->dx))/float(1.57079))
					*float(level.WallVertLight - level.WallHorizLight))
				);
		}

	}
	else rellight=0;
<snip more stuff that is of no concern for this modification>
Then I settled on looking how to make a new flag or stuff in MAPINFO to select smoothlighting... And the mapinfo code (in g_level.h and g_level.cpp) is a mess. There's a lot of enums, one of the things I like the less in C/C++. I'm not sure whether it should be a flag, a FOptionalMapinfoData, or something else.

Top