Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
z34chris

Differential shading

Recommended Posts

Do any of the doom sourceports offer differential shading? That is, is lighting entirely sector based or does a source port exist where each wall, floor and ceiling face can have their own lighting level? If this lighting does exist, it would make many of the doom maps look so much better instead of having that seemingly flat look.

Chris

Share this post


Link to post

Boom supports lighting per floor and ceiling but AFAIK there's no port that supports lighting per wall. Although this shouldn't be too hard to implement in ZDoom. The data structures are already there for other things and all that is missing is a 'transfer light to wall' line type.

Share this post


Link to post

Well the upcoming release of Doomsday will have (optional) full vertex lighting. Doomsday uses the sector light levels as a guide and then uses that info to light each surface uniquely depending on the other surfaces aound it. So for example if you create a wall light and use many sectors to create diminishing beams of light, Doomsday will translate that to a smooth beam of ambient light (no more hard lighting changes where sectors meet).

Naturally because this is per vertex lighting each surface in a sector can have a different light level at each corner which is smoothed across the surface (walls, floors and ceilings).

However atm there is no way to simply set a (lower/middle/upper) part of a particular sidedef with a different light level directly but the effect can be obtained by creating a thin sector with a different light value attached to your wall (this works in all ports of course). If the sector's (and it's neighbours) floor and ceiling are sky you can also hide the additional sector completely.

Share this post


Link to post
DaniJ said:

If the sector's (and it's neighbours) floor and ceiling are sky you can also hide the additional sector completely.



Or use Boom's transfer floor/ceiling light types. But this technique can become quite tedious if it is required in larger parts of the map.

Share this post


Link to post

I just looked through the doom2 levels and realized how terrible the lighting really was. I also was in disbelief at how many 90 degree angles there were. This is doom2 not wolf3d ;) Im sure some sectors could have been spared for decoration and differential shading, but Id opted not to do this.

Share this post


Link to post

You're right, Doom 2 has lots of 90 degree angled walls.

In Ultimate Doom, 0.23457% of all linedefs and 0.29163% of all linedef distance are at other angles, for Doom 2 the corresponding numbers are 0.21278% and 0.26485%.

Share this post


Link to post

Doom 2 is better than Doom at lighting, though.

In Ultimate Doom, the average difference between adjacent, differently lit sectors is 48.909, for Doom 2 that's 43.879.

Edit: the numbers were slightly off due to a bug in the program.

Share this post


Link to post

Yes.

from math import hypot
from omg import *

def linestat(wad):
    orthog, angled, orthog_dist, angled_dist = 0., 0., 0., 0.
    for t in wad.maps:
        m = MapEditor(wad.maps[t])
        for line in m.linedefs:
            a, b = m.vertexes[line.vx_a], m.vertexes[line.vx_b]
            length = hypot(a.x-b.x, a.y-b.y)
            if a.x == b.x or a.y == b.y:
                orthog += 1
                orthog_dist += length
            else:
                angled += 1
                angled_dist += length
    print "non-orthogonal linedefs:", angled / (orthog + angled)
    print "non-orthogonal linedef distance:", angled_dist / \
        (orthog_dist + angled_dist)

def lightstat(wad):
    dmap = {}
    for t in wad.maps:
        m = MapEditor(wad.maps[t])
        for line in m.linedefs:
            if line.back == -1:
                continue
            a = line.front
            b = line.back
            a, b = min(a, b), max(a, b)
            sa = m.sidedefs[a].sector
            sb = m.sidedefs[b].sector
            if m.sectors[sa].light != m.sectors[sb].light:
                dmap[t, sa, sb] = abs(m.sectors[sa].light - m.sectors[sb].light)
    print "avg light difference:", sum([dmap[x] for x in dmap]) / float(len(dmap))

linestat(WAD("doom.wad"))
linestat(WAD("doom2.wad"))
lightstat(WAD("doom.wad"))
lightstat(WAD("doom2.wad"))

Share this post


Link to post

another good idea on lighting would be having a light object (just like quake handles it's lights). You make a light object (just like you would put weapons, ammo, enemies etc.) and around that there's light. Or you could make if rotate, change color etc.

Share this post


Link to post

Yeah, Vavoom has that. Other ports with dynamic lights can do that, but they're much slower than precompiled lightmaps.

Share this post


Link to post

ZDoomGL also now has light objects among other things light related. It's buggy in some areas but overall a nice gl injected zdoom port (at the time of this writing it's currently compatible with .63a).

Share this post


Link to post

I built a setup using differential shading that uses thin sectors and it doesnt look half bad. Its a little bit of a pain to create but well worth it. The differential shading effect imho works great with curved walls and the lighting comes from a single source. This is similar to a light source but light sources tend to be on the spotty side, whereas the effect I am describing is for broader coverage of light when vertical light light levels are negligible such as in outdoor areas.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×