Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
exl

Color grading in GZDoom

Recommended Posts

this is fantastic, thanks so much for sharing exl :D

Share this post


Link to post

Fantastic stuff, would love to incorporate that into my map. The instructions sound awfully complicated, though. xd

Share this post


Link to post

It's been tested with 3.7.2 and the recent 4.0, but it should work with some earlier versions too, or whenever postprocessing shader support was introduced. I can't find the exact version version number from when that was.

Share this post


Link to post
Posted (edited)

Absolutely brilliant indeed. Though, is there an explanation somewhere how the pplut.png texture works? I have absolutely no idea how the mechanique behind the texture works.

 

*EDIT*

Maybe even a photoshop tutorial might be of good use :)

 

*EDIT2*

After fiddling around for a while I got it working now. This is pretty awesome indeed, I just need to learn now how to implement that properly. For some reason I have the feeling that it somehow makes fog and light colors a bit redundant if you used them before in larger scale areas. Are there any subtle examples in other games?

Edited by Tormentor667

Share this post


Link to post

The color grading section of http://www.adriancourreges.com/blog/2017/12/15/mgs-v-graphics-study/ has a good visual explanation of how it works, and shows an example of it. This Gamasutra article is an excellent deep dive into colors used in games. A few other examples and explanations:

 

https://www.gamedev.net/articles/visual-arts/unity-lut-color-correction-in-our-game-immortal-redneck-r4389/

https://www.youtube.com/watch?time_continue=84&v=xkAzeukUzlQ

https://imgur.com/gallery/Lt4YH

 

Share this post


Link to post

It's mostly just a GZDoom post processing shader. It'll work on top of any PLAYPAL changes and can be toggled on, off, and crossfade between or set a LUT. But for hardware rendering only.

Share this post


Link to post
On mardi 9 avril 2019 at 8:05 AM, exl said:

It's been tested with 3.7.2 and the recent 4.0, but it should work with some earlier versions too, or whenever postprocessing shader support was introduced. I can't find the exact version version number from when that was.

The ZScript requires version 3.7.2 minimum, if you try to load with an older version you'll get an error message during startup. It might work if you edit the ZScript code to put in a lower version, I dunno, but as-is it's 3.7.2 minimum.

Share this post


Link to post
On 4/9/2019 at 9:05 AM, exl said:

It's been tested with 3.7.2 and the recent 4.0, but it should work with some earlier versions too, or whenever postprocessing shader support was introduced. I can't find the exact version version number from when that was.

 

Trying to launch this in GZDoom 3.7.2 gives me the following error message:

Script error, "colorgrd.pk3:menudef.txt" line 1:
PostProcessMenu is not an option menu that can be extended

 

Share this post


Link to post

Oh right, it does reference a menu new to 4.0. You can remove menudef.txt if you don't care about the menu option, or change the menu that it appends the option to.

Share this post


Link to post
Posted (edited)

I noticed that the game crashes if you put the grading script into an OPEN Script. Can this be fixed?

Share this post


Link to post

Since the color grading is applied on a per-player basis, and the ColorGrade* functions operate on the current player (through PlayerGet) it doesn't make much sense to call it from an OPEN script. It will however work from an ENTER script where it will run for each player individually.

Share this post


Link to post

Hi exl, and wow quite 6 years I think that I didn't post anything on Doomworld... Any hope to include somewhere the non-compiled library for this awesome thing? Since as Torm I am involved in Blade of Agony development, it is important for us to have such source code in order to embed the whole thing in our particular ACS setup, so we can track exactly what it is happening and merge the whole code without compiling the library, instead using it open like we did with all other scripts present on the project (the boalib.acs once compiled has #include references which points up on a folder, so we can work easily this way via github, slade and gzdbuilder to optimize also the load order of each library due to the complexity of BoA whole code "tree"). Any chance? Thanks in advance.

Share this post


Link to post
53 minutes ago, Ozymandias81 said:

Any hope to include somewhere the non-compiled library for this awesome thing?

 

Quoting because I'd like that as well, if for other reasons.

Share this post


Link to post

Thanks kindly for sharing that and thanks for the information. Calling it on an OPEN script makes sense in terms of a global change of a map or for a cutscene sequence for example that can't be launched on a ENTER basis but only on an OPEN basis.

Share this post


Link to post
Posted (edited)

Ok, I've updated the zip file in the first post so that any call done without a player as a trigger will instead affect all players present in the map. Additionally _metal_ from the ZDoom forums found a compatibility bug in the fragment shader so it should now also work on macOS. The entire source is included in the zip this time.

 

Edit: BTW, will 16 LUTs be enough for your uses? Blady of Agony seems like a large project that might need more than 16. The fragment shader would have to be adjusted so that it can work with 64 LUTs in a 512x512 texture.

Share this post


Link to post
6 hours ago, exl said:

Ok, I've updated the zip file in the first post so that any call done without a player as a trigger will instead affect all players present in the map. Additionally _metal_ from the ZDoom forums found a compatibility bug in the fragment shader so it should now also work on macOS. The entire source is included in the zip this time.

 

Edit: BTW, will 16 LUTs be enough for your uses? Blady of Agony seems like a large project that might need more than 16. The fragment shader would have to be adjusted so that it can work with 64 LUTs in a 512x512 texture.

Atm I think we are fine as is, BoA is already complex okay but 16 LUTs are enough ime... In case you wanna improve it for us and if you are familiar with Github, you can send us a pull request if you notice something that may need adjustments with actual state of the project, like playtesting it and giving us some clues about where you would suggest to implement colorgrading.
I have suggested for now to use it even for poisonus effects, so with mutants and zombies related attacks.
Today I have committed and implemented the source code, if you wanna give a look check the repository then and thank you in advance in any case :)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×