Making the lite amp not suck

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
User avatar
Jimmy
 
 
Posts: 4720
Joined: Mon Apr 10, 2006 1:49 pm
Preferred Pronouns: He/Him
Contact:

Making the lite amp not suck

Post by Jimmy »

Part of me is curious as to how one might change the light-amplification goggles to enable one to see areas and monsters clearly - without sacrificing the good looks of a well-designed level. Lighting can be just about everything in how a map looks, so picking up the goggles and removing that aspect entirely invariably makes the visual aspect of a map worse - imho.

I wonder if there's a way with shaders or ZScript to drum up some new application for the goggles.

Some ideas:

- A powerup that simply boosts the light level of sectors by 32 or 64 units temporarily - enough of a boost to make things clearer, but not enough to totally sacrifice light level differentiation and keep the map looking good.
- A powerup that renders an outline around enemies in a certain range.
- A "thermal visor" shader that colors the enemies (and possibly hazards) in red/yellow and the rest of the terrain in blue/purple.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Making the lite amp not suck

Post by Rachael »

The best way to do it is a post-processing shader that multiplies the screen intensity, adds a bit of a fuzz effect, tints the screen, and then adding a dynamic light to the player him/herself that brightens the areas immediately around them.
Kotti
Posts: 86
Joined: Tue Dec 27, 2016 4:08 am

Re: Making the lite amp not suck

Post by Kotti »

Jimmy wrote: - A "thermal visor" shader that colors the enemies (and possibly hazards) in red/yellow and the rest of the terrain in blue/purple.
Isn't that just a different color scheme for the existing 'enhanced Nightvision' mode?
User avatar
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Making the lite amp not suck

Post by Caligari87 »

Here's a "nightvision" shader that looks like a good place to start for Rachael's suggestion. : https://www.shadertoy.com/view/Xsl3zf

The multiplication coefficients on line 21 would need to be bumped to actually brighten the input though. As is they just recolor it a bit.

8-)
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Making the lite amp not suck

Post by Pixel Eater »

I've asked about it before, but having a Lite-Amp'ed scene as a sample texture would be perfect for this :geek:
Last edited by Pixel Eater on Fri Apr 27, 2018 6:18 am, edited 1 time in total.
User avatar
Tormentor667
Posts: 13530
Joined: Wed Jul 16, 2003 3:52 am
Contact:

Re: Making the lite amp not suck

Post by Tormentor667 »

Rachael wrote:The best way to do it is a post-processing shader that multiplies the screen intensity, adds a bit of a fuzz effect, tints the screen, and then adding a dynamic light to the player him/herself that brightens the areas immediately around them.
That sounds like a good solution to me
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Making the lite amp not suck

Post by Pixel Eater »

Caligari87 wrote:Here's a "nightvision" shader that looks like a good place to start for Rachael's suggestion. : https://www.shadertoy.com/view/Xsl3zf
I wonder how that noise would look if replaced by the "random" number series the fuzz uses :idea:
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Making the lite amp not suck

Post by Pixel Eater »

L.Amp.pk3
(3.33 KiB) Downloaded 42 times
Managed to port the software fuzz into a custom shader and I think it looks pretty cool as background noise. It's homogeneous with the DooM universe at the least :)
L.Amp.jpg
Edit: Think it might be better with the fuzz added instead of subtracted:
L.Amp2.pk3
(3.33 KiB) Downloaded 48 times
User avatar
Tormentor667
Posts: 13530
Joined: Wed Jul 16, 2003 3:52 am
Contact:

Re: Making the lite amp not suck

Post by Tormentor667 »

Maybe some more work could be done to make it look like this:
https://i.ytimg.com/vi/Ec0J6zau7jY/maxresdefault.jpg
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Making the lite amp not suck

Post by Pixel Eater »

That's surprisingly clear, no grain at all. And also pretty saturated until it suddenly goes full white. Cool picture.
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Making the lite amp not suck

Post by Nash »

If the project is single player-only, you *could* just bump every sectors' light levels a certain relative amount (be sure to save the existing values before-hand so that it can be restored later). Not sure how practical of a solution that would be though.

(ZScript obviously; requires sector array iteration)

EDIT: would [wiki]A_Light[/wiki] do the trick? This one is multiplayer friendly. So boost the player's local illumination with A_Light, then add a post processing shader on top if needed.

A_Light might not work when viewing through another camera except your own... which may or may not be what you want.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Making the lite amp not suck

Post by Rachael »

A minor instance of A_Light might work but I think a local dynamic light will really make the effect pop, if you know what I mean.
User avatar
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Making the lite amp not suck

Post by Caligari87 »

Light amp tubes work by amplifying available light. As I understand, for science reasons the green wavelengths get amplified the most. After playing in GIMP I think I managed to build a rather convincing effect that could be applied in (almost) pure post-processing:

Original:


Filtered:


First, I reduced the saturation of the red and blue channels, green, so there's no fully-saturated reds or blues. Then, compress the strength of the green channel by a factor of 4 (pulling the highlight down on the levels dialog on just green). Then, add (or screen-multiply) that result to itself 8 times or so.

Of course, this won't work with completely black pixels or light level 0 sectors. You'd probably want some kind of pre-processing to make sure all the lightlevels on the map are at least 1. The benefit of this approach is that it preserves the existing contrasts and amplifies the "light" in a somewhat realistic manner instead of just putting a green filter over the scene. Of course, some blurring and grain wouldn't be out of place either.

8-)
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Making the lite amp not suck

Post by Pixel Eater »

Caligari, if you want I can drum up a Tone-mapping shader so we can see your filtering in action?
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: Making the lite amp not suck

Post by Matt »

I can't speak for him but I certainly want to see that!
Post Reply

Return to “Scripting”