Jump to content

More realistic lighting in vanilla doom? (Limit-Removing)


Engired

Recommended Posts

You can export the whole level as an obj, but I hate using blender for anything more than removing the roof, and unreal makes it look really weird. Any ideas of any programs to go from here? I thought of hammer, but if you're familiar with it, importing anything takes a while. Or, an easier way to get realistic lighting? Maybe using UDMF, and just copying the lighting UDMF does? Any ideas are welcome.

Edited by Engired
Maybe limit removing would be a good idea to add.

Share this post


Link to post

Not possible in vanilla. The engine doesn't even have a concept of lightmaps, just a flat, sector-wide lighting value.

 

You'd need some sort of source port with dynamic light capabilities to begin even scratching this, and at that point, you're no longer on vanilla.

 

Unless you're talking something like taking a level's geometry, exporting it, and putting it in something to allow for a more realistic lit rendering of it? But at that point you're not really playing the model, just exporting it as a 3D Mesh, as you said.

Share this post


Link to post
2 minutes ago, Dark Pulse said:

Not possible in vanilla. The engine doesn't even have a concept of lightmaps, just a flat, sector-wide lighting value.

 

You'd need some sort of source port with dynamic light capabilities to begin even scratching this, and at that point, you're no longer on vanilla.

 

Unless you're talking something like taking a level's geometry, exporting it, and putting it in something to allow for a more realistic lit rendering of it? But at that point you're not really playing the model, just exporting it as a 3D Mesh, as you said.

Basically, pre-rendering how the light would actually bounce around, then copying that by using sectors on the actual map. Pretty hard to do correctly just by using visuals. Didn't explain that, but that's what I'm trying to do.

Share this post


Link to post
1 hour ago, Engired said:

Basically, pre-rendering how the light would actually bounce around, then copying that by using sectors on the actual map. Pretty hard to do correctly just by using visuals. Didn't explain that, but that's what I'm trying to do.

That would be rather tricky, since in vanilla Doom, lighting is effectively limited to 32 levels. 0-7 is the darkest, 8-15 is the next-darkest, and so on. This is due to how Doom's 256-color palette works - whenever a color is called for, it's mapped to the nearest possible color in the PLAYPAL. And since the PLAYPAL only has 32 entries for light levels, that effectively means 32 light levels.

 

More advanced engines like GZDoom can have a proper 256 levels of light, but again, at that point you're starting to stray from vanilla.

Edited by Dark Pulse

Share this post


Link to post
Just now, Dark Pulse said:

That would be rather tricky, since in vanilla Doom, lighting is effectively limited to 32 levels. 0-7 is the darkest, 8-15 is the next-darkest, and so on.

 

More advanced engines like GZDoom can have a proper 256 levels of light, but again, at that point you're starting to stray from vanilla.

I'm not trying to be strict to the rendered image, more just for an idea of how light is going to bounce around, and roughly how bright it will be. There will be differences, and I can live with that.

Share this post


Link to post

I hope this is useful, it may not be what you're looking for, but it makes the game more atractive, doesn't work in vanilla.

 

Share this post


Link to post

iirc there's a trick you can use to make the ceiling and floor appear to have different light levels 

Edited by roadworx

Share this post


Link to post
22 minutes ago, roadworx said:

iirc there's a trick you can use to make the ceiling and floor appear to have different light levels 

Yeah, I use it quite a lot in my levels

Share this post


Link to post
On 4/23/2021 at 4:57 PM, Engired said:

Basically, pre-rendering how the light would actually bounce around, then copying that by using sectors on the actual map. Pretty hard to do correctly just by using visuals. Didn't explain that, but that's what I'm trying to do.

 

Proper lightmap lighting is always going to be difficult to replicate in vanilla Doom because sector lighting is essentially 2D. There's no way to mimic vertical light bounces. So unless your level is all entirely the same floor and ceiling height, it's always going to look somewhat abstract. So it's probably better to focus on the general idea of lighting rather than trying to replicate genuine defracting and refracting light.

Share this post


Link to post

Everyone before me has already detailed and dissected the reasons actual light-mapping is not really a thing in conventional Doom map formats. I will answer to a slightly broader question, and which is honestly more akin to what the title of this topic would suggest the thread to actually be about. What is a good approach to more realistic lighting in Doom?

 

The guideline is actually not very difficult, even if the fact that Doom mapping is top-down – and, by extension, that the relation of vertical depth not immediately obvious at a glance in your Whathaveyou Builder – might hamper you a little bit in your quest to hone shine and shadow.

 

It's small and brief, broad if you will, but for organization's sake, and thus ease of understanding, I split it into three parts:

 

(A) Contrast

 

At its core, lighting is the difference between light and dark. Dark rooms are moody, but places that have plenty light and also plenty shade are the most convincing and pleasant to the eyes.

 

There are two kinds of contrast. Having some rooms that are bright, and some that are dark, will make a mood contrast between them, emphasizing the mood of the darker rooms, kinda like sewers in an otherwise open-ish level. Do not hesitate to make rooms of varying light levels.

 

The other kind of contrast is within the room itself. Shadows can be noticeable, but shouldn't jump out at the player like a pocket of void. Even still, a proper shadow can add tons to how well a scenery looks, even if subconsciously.

 

Do keep in mind that, the more light sources are in a room (particularly at different angles), the shallower each shadow would be, but also the more shadows there will be per obstacle, on the side opposite each light source.

 

At least that's how it generally is, in an idealized manner -- that is, you don't have to be all that detailed, or have coinciding shadows add up, or even have many shadows at all. But it's good to keep in mind the nature of light, as that is how our eyes like it, attuned to forests and light sources showing the way. And it's good to have your shadows make sense, relating to the light sources in the room

 

That neatly ties in to...

 

(B) Representation

 

Where does all that light come from?

 

In outdoor areas, the answer is easy - it comes from the Sun! Or, perhaps, from the Moon. Or the sky of Hell. Whatever. If there is an angle of incidence, you can try have some sides and corners of walls and obstacles be a tinge dimmer, like a shadow. It's only noon once a day!

 

For indoor areas, it depends. Good indoor rooms have distinct pieces of geometry or actor decoration denoting light sources, and then shape the lighting in the room accordingly. Lighting sector-work can be tedious and involve many details, so it is generally a good idea to do it after detailing and adding light sources, maybe even keep a copy of your map without the lighting sectors so you can easily revert if you screw everything up while adding shadows.

 

Either way, the idea is, that it must be clear this light is coming from somewhere. This can make shadows make sense, or it can just make a room make sense at all. Many beginners' Doom levels have rooms without any sort of light source whatsoever that nonetheless remain at a light level like 192. Even without shading at all, adding a simple lamp can make the room's visuals much more believable. You would be surprised the difference a touch like that can make. After all, what is vision but bouncy light?

 

On the topic of believability,

 

(C) Fitting

 

A room can be dark because it's underground ... or it's full of sneaky enemies wanting to eat your feet away!

 

Now, not only the setting matters, but the mood as well. If lamps and shadows give lighting a reason to be, how a player feels upon encountering it gives it purpose. It's an essential part of scenery.

 

For instance, having a nice, immersive set of lights and shades can make a boss battle feel more exciting and more engaging; it might not be too different, combat-wise, but the difference in the mood will affect players and how they feel about - and during! - the fight. :)

 

So, draw the players to the light, and squash them in a dark, filthy ambush! Or just let them wow at all those funny shapes and shades. For them, it's a duality, but for you, the mapper, they only complement each other; like yin and yang, both are very important, as much as the very distinction between them. So go forth, and cast shine and shadow!

 

Share this post


Link to post

You can always use baked-in lighting on custom textures and flats to help go a bit further beyond what people expect from vanilla. The Doom Cornell Box by Linguica shows it off well:

 

 

Share this post


Link to post
14 minutes ago, Doomkid said:

You can always use baked-in lighting on custom textures and flats to help go a bit further beyond what people expect from vanilla. The Doom Cornell Box by Linguica shows it off well:

 

 

To be fair, this comes with a few caveats, namely:

  • Best played with a floating-point renderer (the text file itself recommends Eternity or 3DGE) or you might get sparkles at texture seams, which would probably happen under Vanilla for example
  • It's essentially faking lighting via baking it into textures, rather than being actual realistic lighting possible under Vanilla

All of which is a fancy way of saying that rather than being actual realistic lighting doable under Vanilla, it's a very clever way of faking it. :P

 

(The fact the player weapon sprite doesn't change in brightness and such as you go behind the boxes where the shadows are is good proof of that. You could fake that via sector lighting too, of course, but that also has its limits.)

Edited by Dark Pulse

Share this post


Link to post
3 hours ago, Doomkid said:

You can always use baked-in lighting on custom textures and flats to help go a bit further beyond what people expect from vanilla. The Doom Cornell Box by Linguica shows it off well:

 

Since you're limited to 64x64 flats in vanilla the visplane number would explode. Standing at the start of that map shows 126 visplanes already.

Share this post


Link to post
1 hour ago, boris said:

 

Since you're limited to 64x64 flats in vanilla the visplane number would explode. Standing at the start of that map shows 126 visplanes already.

The textfile mentions you can hit the 128 visplane limit if you stand in the exact right spot.

Share this post


Link to post

It is all well and good to be mapping for the original Doom format, but as I have mentioned numerous times, sooner or later one wants to add stuff which is just not possible in that format. One way, which has been used in many maps, is to give dark sectors a very tall ceiling so that the ceiling cannot be seen. Of course, one can try to simulate so many things with one hack or another, but it just does not look right. 

 

ZDoom, and now GZDoom, has evolved over the years because mappers needed more and more features, which Randi and others gladly incorporated. 

 

If one wants to have more realistic lighting in ones map, then there are not many options other than GZDoom. Not only are there more graduated sector light levels but also dynamic lights. And not to forget boris's Lighting plugin for GZDB or UDB in DiHF and UDMF. That plugin is not perfect, yet it does the trick when not overdoing the map layout.

 

Edited by Kappes Buur

Share this post


Link to post

One thing I do in vanilla environments is I treat lighting as logically as I can. If I have an outdoor section for instance, there will likely be an implied sun shining down, and that creates what is called a parallel light effect; basically, because the sun is larger than the surface it's illuminating, all shadows will be at the same angle. I usually keep it simple by implying 45-degree positions, such as north-east, south-west, etc., and make sure everything that projects a shadow is consistent with the angle I chose. If the geometry is more complex than a pillar or monolith--such as say, a circular structure--then I copy only the vertices, then paste and drag them at the same angle as other shadows. Then I connect the segments and fill it in with shadow. 

 

However, I also take height into account, so if that structure is really tall, then the shadow needs to be really long. And don't forget the implied distance the sun is from the surface. You could potentially have tall objects with very short shadows, but all shadowed objects from the sun would need to maintain this consistency.

 

For artificial lighting, things can get trickier. Two light sources that are in close proximity, for instance, will cause overlap. So you draw both of the shadows they would generate, then make the cross-section of the two slightly darker. In some cases, such as when a light source is very large and close, shadows are very sharp. If the light is smaller and further away, there will be a visible penumbra (the fuzzy part of a shadow), in which case you'll want to add gradients. You can get away with as few as two gradations and it'll have a really strong impact.

 

Light bounce is another consideration to keep in mind. Even if you have a room lit with a single light, the area outside of that light will not necessarily be pitch-black; light will bounce a bit around the room, so the level should be low, but not 0. For areas that are not lit at all, there will still be a bit of bounce that pools in from nearby lights, but if you're in an area that's really isolated from light, you'll want it to be pretty close to black. For that reason, I strategically place light sources around the map so that there's almost always an implied light source in any given section, because otherwise it'll look weird to see levels like 96 or 128 with no clear light source.

Share this post


Link to post

The question is worded kinda weirdly- if you're trying to do lighting in vanilla Doom format, you're not going to be able to do much because of visplanes and all the issues outlined above. Baked-in lighting on textures would be your need there.

 

GZDoom UDMF is at this point the most accurate for "realistic" lighting- I use attenuated lights while mapping and enable shadowmaps and AO for proper shadow effects. Attenuated lights are "stopped" by void sectors to create shadows, like this gazebo I made.

Share this post


Link to post
27 minutes ago, Major Arlene said:

The question is worded kinda weirdly- if you're trying to do lighting in vanilla Doom format, you're not going to be able to do much because of visplanes and all the issues outlined above. Baked-in lighting on textures would be your need there.

 

GZDoom UDMF is at this point the most accurate for "realistic" lighting- I use attenuated lights while mapping and enable shadowmaps and AO for proper shadow effects. Attenuated lights are "stopped" by void sectors to create shadows, like this gazebo I made.

Gonna stop you right there and link to the correct post ;)

Share this post


Link to post

I have to disagree with the general consensus about lighting detail on vanilla. As long as you keep the player from distant lines of sight (which is the major cause of VPOs) you can do some fairly interesting things, both in terms of scale and lighting. I recommend give it a look at Sinergy. It have some simple but nice use of shadows on outdoor areas. I think you can use that as a base to understand how projected lighting works (it works on chocolate doom as long as you remove the M_DOOM pic).

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...