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.
[quote="Xaser"]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.[/quote]
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]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>[/code]
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.