Software renderer's lighting in GZDoom (and Zandronum)

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
User avatar
Hellser
Global Moderator
Posts: 2646
Joined: Sun Jun 25, 2006 4:43 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Citadel Station

Re: Software renderer's lighting in GZDoom (and Zandronum)

Post by Hellser »

Love the shader and the fact that it is in GZDooM, however. I notice a bug that's in GZDooM r1496 (not sure if this has been fixed yet). Anything with a black stencil and a renderstyle of translucent (with an alpha) causes the actor to appear white, as seen below (the shadow is merely a stencil, translucent actor of the rifle).

This is using the Software Renderer's Lighting in the Tower of Babel Port (which uses GZDooM r1496). If this has been fixed, say so.. and I'll bitch at Ryan to update. :P
Spoiler: The Bug
Spoiler: How it's suppose to look
An example code of the shadow:

Code: Select all

ACTOR RC_GS_Shadow
{
    XScale  1.3
    YScale  0.3
    Renderstyle Stencil
    StencilColor Black
    Alpha   0.5
      +ISMONSTER
      +FLOORHUGGER
      - COUNTKILL
}

ACTOR AssaultRifleShadow : RC_GS_Shadow
{
   States
   {
   Spawn:
	TNT1 A 0
      RIFL A 1 A_FaceTarget
      Stop
   }
}
User avatar
BlueFireZ88
Posts: 1086
Joined: Tue Jan 18, 2011 9:04 pm
Location: Argent Tower

Re: Software renderer's lighting in GZDoom (and Zandronum)

Post by BlueFireZ88 »

I know this has been integrated into GZDoom 1.7.0, but how far along in development was it when it got officially add? Honestly, I'm just not sure.
User avatar
Enjay
 
 
Posts: 26430
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Software renderer's lighting in GZDoom (and Zandronum)

Post by Enjay »

The current revision is 1498 and the software emulation renderer has been tweaked with since 1.7.0 but I have no idea if anything that might address this was part of the changes.

There's a build over at DRD if anyone wants to check.

http://svn.drdteam.org/gzdoom/
Korshun
Posts: 52
Joined: Thu Dec 13, 2012 1:32 pm

Re: Software renderer's lighting in GZDoom (and Zandronum)

Post by Korshun »

I tried out the latest SVN and there is a "fog forces fullbright" option in preferences menu. It doesn't affect anything. Why? (also "software" lightmode still forces fullbright fog)
User avatar
Nash
 
 
Posts: 17322
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Software renderer's lighting in GZDoom (and Zandronum)

Post by Nash »

I just played the latest SVN version on DRD.

1) Can we please have the "blocky" lighting mode too?
2) What's the difference between "fog forces fullbright" and "force brightness in fog"?
Gez
 
 
Posts: 17688
Joined: Fri Jul 06, 2007 3:22 pm

Re: Software renderer's lighting in GZDoom (and Zandronum)

Post by Gez »

"Fog forces fullbright" makes everything fullbright when in fog.

"Force brightness in fog" makes fullbright things still fullbright even in fog.


Okay, so to understand that clusterfuck, you have to understand how fog is treated by Doom. (Or rather, Hexen.) Fog replaces darkness. If something is far away, it is foggier, instead of darker. Look at the fog colormap in Hexen. Fullbrightness is ignored, bright lights don't pierce the fog.

Now come special effects like fade colors in a level. Technically, it is treated as fog, and therefore disable full brightness. You want to make your level get a subtle, moody blue tint, and all of a sudden all the lamps and fireballs get dark with the distance. This can look very bad when the fade color is used to tint the colors of a level and not to create a fog. So there is an option to force fullbright to stay fullbright in fog. If you ever play a level created by CodeniumRed/Shades, you'll be glad to have that option.

The other option is specific to the software shader. In the actual software renderer, things are fullbright and the light level is used instead as fog density. (Since Hexen's fog map does that, basically.) This option replicates the effect.
User avatar
Mr. Tee
Posts: 1111
Joined: Sun Feb 08, 2004 7:49 pm

Re: Software renderer's lighting in GZDoom

Post by Mr. Tee »

esselfortium wrote:
Mr. Tee wrote:Converting textures and sprites to paletted images and doing touch-ups is very time consuming.
Do you mean to tell me that your rainbow gradient sky that was obviously designed for a high color display mode.... doesn't translate properly into a palette that you did not take into consideration at all while creating it?
Nope, I mean exactly what I said: Converting textures and sprites to paletted images and doing touch-ups is very time consuming.

Additionally, you cannot make a beautiful looking sun-filled sky filled with blue, orange and purple (as the finished GZDoom mod looks, see spoiler) with ZDoom's software renderer, no matter if the palette is taken into consideration.
Spoiler:
That scrolling cloud sky box looks fantastic, exactly as I wanted. Even if I spent a number of hours I could not get the same effect in ZDoom, which is unfortunate.


All this to say that if GZDoom had the "blocky sector lighting" of ZDoom, I would prefer it simply for the lack of palette restriction.
You do not have the required permissions to view the files attached to this post.
User avatar
Enjay
 
 
Posts: 26430
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Software renderer's lighting in GZDoom (and Zandronum)

Post by Enjay »

Nash wrote:1) Can we please have the "blocky" lighting mode too?
A few days ago I did a quick trial just to see if it would work: you can extract the shaders from the modified blocky version of gzdoom.pk3 and load them in a pk3. I didn't know which shaders did what so I just loaded the whole lot. It worked (ie I got the blocky effect) but the sky looked a bit messed up. I don't know if that was something to do with the blocky shader or a complication from me loading all the shaders.
User avatar
Nash
 
 
Posts: 17322
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Software renderer's lighting in GZDoom (and Zandronum)

Post by Nash »

Thanks Enjay but I'm aware of that. :) What I meant was if we could have it supported officially as a separate lighting mode (perhaps called "software (blocky)" or banded or whatever) and switchable in the OpenGL menu...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48358
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Software renderer's lighting in GZDoom (and Zandronum)

Post by Graf Zahl »

Why do you want that? It's nothing but an artifact of the available technology from 20 years back.

GZDoom's purpose is to use modern hardware's features not to intentionally degrade its visuals so that it matches a limited software renderer.
Sorry, no interest on my side to add it. It would necessitate yet another distinct render path in the shader which complicates shader maintenance.
Korshun
Posts: 52
Joined: Thu Dec 13, 2012 1:32 pm

Re: Software renderer's lighting in GZDoom (and Zandronum)

Post by Korshun »

Gez wrote:"Force brightness in fog" makes fullbright things still fullbright even in fog.
Offtopic question: I heard that this option is impossible to implement in software renderer. Why?
Gez wrote:Okay, so to understand that clusterfuck, you have to understand how fog is treated by Doom. (Or rather, Hexen.) Fog replaces darkness. If something is far away, it is foggier, instead of darker. Look at the fog colormap in Hexen. Fullbrightness is ignored, bright lights don't pierce the fog.
I just want to note that a true software renderer's lighting implementation should replace GZDoom's fog with software renderer's fog too but I didn't do that because 95% of fog looks good anyway (if I enable fullbright fog).
Gez wrote:The other option is specific to the software shader. In the actual software renderer, things are fullbright and the light level is used instead as fog density. (Since Hexen's fog map does that, basically.) This option replicates the effect.
Actually no. Fullbright fog is not specific to any shader. It is just a hack to make fog look more like in software renderer and it works in any lightmode (in my GZDoom, but not yet in SVN).
Enjay wrote:A few days ago I did a quick trial just to see if it would work: you can extract the shaders from the modified blocky version of gzdoom.pk3 and load them in a pk3. I didn't know which shaders did what so I just loaded the whole lot. It worked (ie I got the blocky effect) but the sky looked a bit messed up. I don't know if that was something to do with the blocky shader or a complication from me loading all the shaders.
The only shader you need to copy from gzdoom-blocky.pk3 to gzdoom.pk3 is shaders/glsl/main.fp. Also this shader in gzdoom-blocky.pk3 contains both versions. To toggle them find the line #if 1 and change it to #if 0 or vice versa.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48358
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Software renderer's lighting in GZDoom (and Zandronum)

Post by Graf Zahl »

Korshun wrote:
Gez wrote:"Force brightness in fog" makes fullbright things still fullbright even in fog.
Offtopic question: I heard that this option is impossible to implement in software renderer. Why?
Because for the software renderer fog and light are the same thing. If you draw a sprite fullbright you'd draw it without any fog.
Gez
 
 
Posts: 17688
Joined: Fri Jul 06, 2007 3:22 pm

Re: Software renderer's lighting in GZDoom (and Zandronum)

Post by Gez »

I could make the banded/smooth softlight togglable by CVAR, but you still have to quit and restart GZDoom because there doesn't seem to be a simple way to recompile the shaders from a CUSTOM_CVAR.
User avatar
Nash
 
 
Posts: 17322
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Software renderer's lighting in GZDoom (and Zandronum)

Post by Nash »

Gez wrote:I could make the banded/smooth softlight togglable by CVAR, but you still have to quit and restart GZDoom because there doesn't seem to be a simple way to recompile the shaders from a CUSTOM_CVAR.
YES PLEASE!!! :D
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3111
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain

Re: Software renderer's lighting in GZDoom (and Zandronum)

Post by drfrag »

Hi, i like the new lightning a lot but i just wanted to mention that the official gzdoom 1.7.0 is broken, crashes on exit on my machine, release 1496 runs fine. I'm on win xp, my specs are athlon 64 3500+ and radeon 4650.

Return to “General”