Blending on Dynamic Light Shading for Map Geometry

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

User avatar
RockstarRaccoon
Posts: 598
Joined: Sun Jul 31, 2016 2:43 pm

Blending on Dynamic Light Shading for Map Geometry

Post by RockstarRaccoon »

Odd thing that I came across in some experimentation with maps lit entirely with Dynamic Lights. When you have a dynamic light shining on geometry that was made to look rounded in some way, the effect is broken by the way dynamic lights are applied across the surface. This ends up looking even worse if you're using PBR materials.

Basically, this means you can't effectively use things like triangular sectors or rounded walls too close to a stark light source, as the light source will create sharp shadows which ruin the rounding effect.



I have no idea how to go about implementing this, but if someone wanted to take a whack at it, here's a (Doom2) WAD I made which would make it all stick out.
https://drive.google.com/file/d/1P_3K8q ... sp=sharing

Edit:
Phantombeta suggested "add a way for modders to specify smoothing groups and such" which would be a good fix for anyone making maps right now. It might be the best thing to do. (in fact, if I had a choice, it'd be my preference)

Another one would be some way to detect when two connected surfaces have the same texture and somehow specify a "max delta" under which they end up blended. This would work for maps which didn't/don't implement it, but wouldn't have the same level of control for mappers who are building around dynamically-lit areas.

Edit:
Stumbled upon requests from a couple years ago: viewtopic.php?f=15&t=64163
viewtopic.php?f=15&t=61259
Last edited by RockstarRaccoon on Tue Feb 01, 2022 12:26 pm, edited 4 times in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48043
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Blanding on Light Shading for Map Geometry

Post by Graf Zahl »

It's not really that easy. Map geometry in Doom does not have any normals whatsoever so they'd have to be added to all data in the game.
Besides, creating surfaces like this test map with lots of tiny triangular sectors is not a good idea due to the limitations of the physics code. Moving around in this map feels really awkward.
User avatar
RockstarRaccoon
Posts: 598
Joined: Sun Jul 31, 2016 2:43 pm

Re: Blanding on Light Shading for Map Geometry

Post by RockstarRaccoon »

Graf Zahl wrote:It's not really that easy.
Hence why I have no idea how to improve this myself: I'm not even entirely sure how you guys programmed the lighting system to work, aside from how pretty much all lighting systems work...
creating surfaces like this test map with lots of tiny triangular sectors is not a good idea due to the limitations of the physics code. Moving around in this map feels really awkward.
The map that I encountered it in had larger triangles than this, but this does raise the idea that perhaps I could make an MD3 model with rounded edges and proper shading applied and stick it over a low-poly version of the ground... Or maybe I should see if getting down the number of triangles, using larger ones, will help...

Either way, if something could be done, engine side, to smooth lighting on triangles and/or walls, I think it'd really help people who want to make realistic looking natural areas and light them like this. I'm interested at the moment because I've been toying with the idea of what I'm describing as "a world lit only by fire.", and this stuff just doesn't look as good in torchlight...
User avatar
Apeirogon
Posts: 1603
Joined: Mon Jun 12, 2017 12:57 am

Re: Blanding on Light Shading for Map Geometry

Post by Apeirogon »

Graf Zahl wrote:Map geometry in Doom does not have any normals whatsoever so they'd have to be added to all data in the game.
Hmmm?
Sectors already have normal, in secplane floorplane/ceilingplane structs, and for walls/lines it just (-line.delta.y, line.delta.x), which will always pointed in the direction of the line front.

Unless we talking about something that called "normal" not in mathematical meaning.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48043
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Blending on Dynamic Light Shading for Map Geometry

Post by Graf Zahl »

Yes, that's just the default normal, but the engine has no facilities for per-vertex normals and which edges should be smoothed.
User avatar
Apeirogon
Posts: 1603
Joined: Mon Jun 12, 2017 12:57 am

Re: Blending on Dynamic Light Shading for Map Geometry

Post by Apeirogon »

Ohh, it lack any code which can be used as a base for implementation, okay.

Return to “Feature Suggestions”