Software renderer's lighting in GZDoom (and Zandronum)

Discuss anything ZDoom-related that doesn't fall into one of the other categories.

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

Postby Hellser » Thu Dec 27, 2012 2:13 pm

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 allExpand view
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
Hellser
Remember Citadel
Global Moderator
 
Joined: 25 Jun 2006
Location: Citadel Station
Discord: Hellser#8156
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD with Vulkan Support

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

Postby BlueFireZ88 » Thu Dec 27, 2012 2:48 pm

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
BlueFireZ88
Fight fire with BlueFire.
 
Joined: 19 Jan 2011
Location: Argent Tower

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

Postby Enjay » Thu Dec 27, 2012 2:50 pm

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/
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

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

Postby Korshun » Fri Dec 28, 2012 9:06 am

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)
Korshun
 
Joined: 13 Dec 2012

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

Postby Nash » Sat Dec 29, 2012 9:45 am

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"?
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

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

Postby Gez » Sat Dec 29, 2012 9:55 am

"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.
Gez
 
 
 
Joined: 06 Jul 2007

Re: Software renderer's lighting in GZDoom

Postby Mr. Tee » Sat Dec 29, 2012 10:30 am

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
Mr. Tee
Waiting for ZDoom Editing Demo 2.6.1? Wait longer! Life is very chaotic now.
 
Joined: 09 Feb 2004

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

Postby Enjay » Sat Dec 29, 2012 10:36 am

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
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

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

Postby Nash » Sat Dec 29, 2012 10:49 am

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
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

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

Postby Graf Zahl » Sat Dec 29, 2012 3:31 pm

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

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

Postby Korshun » Sun Dec 30, 2012 3:03 am

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.
Korshun
 
Joined: 13 Dec 2012

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

Postby Graf Zahl » Sun Dec 30, 2012 4:07 am

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

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

Postby Gez » Sun Dec 30, 2012 4:09 am

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.
Gez
 
 
 
Joined: 06 Jul 2007

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

Postby Nash » Sun Dec 30, 2012 5:53 am

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
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

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

Postby drfrag » Sun Dec 30, 2012 6:27 am

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.
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

PreviousNext

Return to General

Who is online

Users browsing this forum: No registered users and 3 guests