Page 12 of 18

Re: GZDoom discussion (Version 2.3.1 released 2016/jan/7)

PostPosted: Thu Jan 19, 2017 4:13 am
by Nash
Gez wrote:Set your photoshop light layer to multiply, then try again to see what happens when the light color is whiter.



Well, will the Doom64 lighting shader be set to multiply? If it will, then, problem solved. :P

Re: GZDoom discussion (Version 2.3.1 released 2016/jan/7)

PostPosted: Thu Jan 19, 2017 6:34 am
by Graf Zahl
Gez wrote:Yeah, that's it. Brighter light? Make it a whiter color. Dimmer light? Darker color. That's all there is to it. It's enough for Doom 64; and in GZDoom it would be combined with all the other effects at out disposal (fade, fog, per-surface light level...) so there's no real need for any further control.



Yes, there is. The system cannot replicate light level, it can only replicate color which are two entirely separate properties in GZDoom. The light level logic in GZDoom is a very complex thing that works quite differently. Mixing this so it won't break dynamic lights, depth fading and some other stuff is not going to be easy.

Re: GZDoom discussion (Version 2.3.1 released 2016/jan/7)

PostPosted: Thu Jan 19, 2017 7:52 am
by Nevander
Graf Zahl wrote:depth fading

That reminds me, how does one change the distance before things start fading out? Doom 64 fades things somewhat quickly but most maps are so small you don't notice it. Maps like Blood Keep, The Absolution seem to be the easiest to observe it. I know I could probably set the level fade in MAPINFO to black and lower the fog density but it ends up making the whole level darker which isn't ideal.

Re: GZDoom discussion (Version 2.3.1 released 2016/jan/7)

PostPosted: Thu Jan 19, 2017 10:29 am
by Nash
Question: I want my map-placed dynamic lights to use the new attenuation shader... how?

Re: GZDoom discussion (Version 2.3.1 released 2016/jan/7)

PostPosted: Thu Jan 19, 2017 11:00 am
by dpJudas
you add 'attenuate 1' to the light. See the gldefs.txt files in the lights.pk3 for a few examples.

Re: GZDoom discussion (Version 2.3.1 released 2016/jan/7)

PostPosted: Thu Jan 19, 2017 11:04 am
by Rachael
There's a new set of light things. Here are the editor numbers:
Code: Select allExpand view
  9830 = PointLightAttenuated
  9831 = PointLightPulseAttenuated
  9832 = PointLightFlickerAttenuated
  9833 = SectorPointLightAttenuated
  9834 = PointLightFlickerRandomAttenuated

Re: GZDoom discussion (Version 2.3.1 released 2016/jan/7)

PostPosted: Thu Jan 19, 2017 11:23 am
by Nash
Thanks! Since the editor doesn't support them right now, just typing in the thing numbers, blindly placing them and repeatedly running the executable to check my work will have to do.

Image

Archviz in GZDoom? ;) The attenuated lights makes ALL the difference!

Re: GZDoom discussion (Version 2.3.1 released 2016/jan/7)

PostPosted: Thu Jan 19, 2017 11:24 am
by Rachael
Wow, holy shit that looks awesome Nash!

Re: GZDoom discussion (Version 2.3.1 released 2016/jan/7)

PostPosted: Thu Jan 19, 2017 11:32 am
by Graf Zahl
Nevander wrote:That reminds me, how does one change the distance before things start fading out? Doom 64 fades things somewhat quickly but most maps are so small you don't notice it. Maps like Blood Keep, The Absolution seem to be the easiest to observe it. I know I could probably set the level fade in MAPINFO to black and lower the fog density but it ends up making the whole level darker which isn't ideal.



That is controlled by the light level. Which is precisely the problem with a Doom64 lighting implementation. It will require either some change to the lighting model or some explicit setting of light level and color values.

Re: GZDoom discussion (Version 2.3.1 released 2016/jan/7)

PostPosted: Thu Jan 19, 2017 12:26 pm
by Enjay
Image

Not me, I'll be that guy - what's the difference between the regular lights and attenuated ones? OK, OK, yeah, they're attenuated, but what does that actually mean as far how how they look in a map and what they are better used for versus the older ones?

Re: GZDoom discussion (Version 2.3.1 released 2016/jan/7)

PostPosted: Thu Jan 19, 2017 12:34 pm
by Nash
Technical explanation by dpJudas: viewtopic.php?f=12&t=14126&p=936682&hilit=physically+light#p936682 http://forum.drdteam.org/viewtopic.php? ... lly#p59878

Not so technical explanation: Attenuated lights are more realistic. :mrgreen:

If you've ever played the game "Dark Souls" ... if you walk too close to the wall, the light emitted by the player will have an increasingly smaller radius. The illumination being calculated actually reacts to the angle and distance of the surface it's trying to light. This lighting model can be observed in pretty much any modern game WRT to spherical dynamic lights.

The problem with attenuated lights though is that the amount of surface that gets illuminated is perceived to be "smaller" - this became a problem in the past when attenuated lights replaced non-attenuated lights - mappers that relied on dynamic lights to light their maps are suddenly getting dark maps and they're lighting design broken. So attenuated lights is now opt-in via GLDEFs and new placeable dynamic light things.

Re: GZDoom discussion (Version 2.3.1 released 2016/jan/7)

PostPosted: Thu Jan 19, 2017 12:36 pm
by ZZYZX
What are the arguments to attenuated lights?
And, yes, what's the technical difference compared to the normal lights? (in relation to WYSIWYG presentation in GZDB visual mode)

Edit: saw the above post, so the differences are mostly on the GZDoom side and no argument changes. Ok.

Re: GZDoom discussion (Version 2.3.1 released 2016/jan/7)

PostPosted: Thu Jan 19, 2017 1:21 pm
by Graf Zahl
ZZYZX wrote:What are the arguments to attenuated lights?
And, yes, what's the technical difference compared to the normal lights? (in relation to WYSIWYG presentation in GZDB visual mode)


Arguments are exactly the same, and the technical difference is a different math formula when calculating the brightness of a pixel that's affected by the light in the shader. Attenuation multiplies the light with the affected plane's normal vector.

Re: GZDoom discussion (Version 2.3.1 released 2016/jan/7)

PostPosted: Thu Jan 19, 2017 1:44 pm
by dpJudas
Here's an image demonstrating how the surface angle affects the light strength:

Image

Re: GZDoom discussion (Version 2.3.1 released 2016/jan/7)

PostPosted: Thu Jan 19, 2017 2:03 pm
by ZZYZX
Do I use dot product between surface normal and direction to light normal? (sorry, kinda bad at maths, just remember some basic operations to achieve result X)
If so, do parallel normals mean 0% light or there's some further scaling? (maybe there's some place to look at in the code?)