Interesting tidbit about Build lighting

Interesting tidbit about Build lighting

Postby Graf Zahl » Mon Jun 08, 2020 12:58 am

I just tried to add the Build lighting equation to GZDoom's shader to prepare the transition. Here's something interesting:

After setting up the basics, the Doom software lighting shader runs through several function levels, which make up between 20 and 30 lines of code depending on which lighting equation - vanilla or ZDoom - gets used.
From the same point onward in the code, the Build lighting equation has 5(!) lines of code. No wonder that the lighting looks so poor - the distance math is that much more primitive. Adding support for this was just a single 7 line 'if' block to the shader - I was somehow expecting more work...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Interesting tidbit about Build lighting

Postby Gez » Mon Jun 08, 2020 1:23 am

Does that mean we'll be able to use Build lighting in Doom and Doom lighting in Build?
Gez
 
 
 
Joined: 06 Jul 2007

Re: Interesting tidbit about Build lighting

Postby mjr4077au » Mon Jun 08, 2020 1:23 am

Graf Zahl wrote:I just tried to add the Build lighting equation to GZDoom's shader to prepare the transition. Here's something interesting:

After setting up the basics, the Doom software lighting shader runs through several function levels, which make up between 20 and 30 lines of code depending on which lighting equation - vanilla or ZDoom - gets used.
From the same point onward in the code, the Build lighting equation has 5(!) lines of code. No wonder that the lighting looks so poor - the distance math is that much more primitive. Adding support for this was just a single 7 line 'if' block to the shader - I was somehow expecting more work...

Finally, something that didn't take re-inventing the wheel to fix ;)
User avatar
mjr4077au
 
Joined: 17 Jun 2019
Location: Gosford NSW, Australia
Discord: mjr4077au#1027
Github ID: mjr4077au
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Interesting tidbit about Build lighting

Postby Graf Zahl » Mon Jun 08, 2020 1:30 am

Gez wrote:Does that mean we'll be able to use Build lighting in Doom and Doom lighting in Build?



To make the Build lighting work in the shader I'll have to get it working in GZDoom first, before switching Raze over to the backend's render state. I cannot test such things on a non-functional setup that has no working backing implementation for it.
There's one thing, though: Doom lacks the 'visibility' property of the Build engine so while I can get the light mode to work it will be a bit incomplete and not really that useful.

When all is said and done, all light modes should work in Raze as well, but I doubt that they'll all be useful due to how the lighting was set up in the levels.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Interesting tidbit about Build lighting

Postby sinisterseed » Mon Jun 08, 2020 1:44 am

mjr4077au wrote:
Graf Zahl wrote:I just tried to add the Build lighting equation to GZDoom's shader to prepare the transition. Here's something interesting:

After setting up the basics, the Doom software lighting shader runs through several function levels, which make up between 20 and 30 lines of code depending on which lighting equation - vanilla or ZDoom - gets used.
From the same point onward in the code, the Build lighting equation has 5(!) lines of code. No wonder that the lighting looks so poor - the distance math is that much more primitive. Adding support for this was just a single 7 line 'if' block to the shader - I was somehow expecting more work...

Finally, something that didn't take re-inventing the wheel to fix ;)

Somehow this actually, I figured this would be yet another one of those instances where it's gonna take yet another deep rewrite to get the feature working, but apparently not. Would be sick if getting the sky dome working won't be another insurmountable task either.

I wonder how many sector lights will be useful in Build from Doom out of the box. I'm hoping for Software and Doom personally. Vanilla will probably be too dark, Standard too flat, and the rest... does anyone even use the rest?
User avatar
sinisterseed
GZDoom RO Translator & Raze Tester
 
Joined: 05 Nov 2019
Twitch ID: sixhundredsixteen
Github ID: sinisterseed
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Interesting tidbit about Build lighting

Postby Graf Zahl » Mon Jun 08, 2020 1:50 am

You'll probably have to settle for "Bright". The basic lighting model is very different and using Doom's light modes unaltered will most likely make things too dark. Unlike Doom, Build doesn't have this steep falloff of the light level where 100 is almost zero visibility, so it is very likely I'll have to tweak the other modes a bit to make them work. We'll see.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to General

Who is online

Users browsing this forum: No registered users and 0 guests