Product Chat / Look Up Tables ?

Author
Message
rolfy
17
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 30th Sep 2018 23:30
Pretty sure I saw someone mention in a thread that they were using LUT. Can't find the thread now and interested in whether it's native to GG after the DX11 update or using a mod?
Avenging Eagle
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 1st Oct 2018 07:16 Edited at: 1st Oct 2018 07:25
Definitely not native, most likely using ReShade, although I've not toyed around with that feature.

EDIT: Tested. It works! Just place your LUT file in the MasterEffect folder and then specify it in MasterEffect.h (#define iLookupTableMode 2 // [1 or 2] 1: mclut.png | 2: nameofLUT ) . Make sure you tweak the strength on the next line down. Takes a little longer to compile initially I think.

AE
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 1st Oct 2018 08:50
What are they and what do they do?
Been there, done that, got all the T-Shirts!
PM
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 1st Oct 2018 10:26
I've mentioned look up tables in LUA quite a while back for storing data. Not sure if that's what you are referring to. What do you want to do?

Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
Wolf
Forum Support
16
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 1st Oct 2018 11:38 Edited at: 1st Oct 2018 11:40
@BOTR I assume we are talking image post processing.

@rolfyLUT in GG so far has mostly been added via (usually iffy) secondary postprocessing tools.

A user on here that might be able to add it natively is cybernescence and its possible that he did so for his game in the past.
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 1st Oct 2018 16:05
Quote: "I assume we are talking image post processing."


np, I been doing quite a bit of that lately.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, C#, VB, SQL, PL-SQL, JavaScript, HTML, Three.js, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
rolfy
17
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 1st Oct 2018 17:21 Edited at: 1st Oct 2018 17:31
Thanks for the info, in the past I have been faking LUT colour correction in fpsc and GG with a really hack method where I would take a screenshot of a level and bring it into Photoshop, changing contrast,brightness,saturation etc and then saving actions to batch apply to entity textures in scene it's a crazy method which works up to a point and wont affect atmospherics obviously.
Easy way to create your own LUT's is to paste a default LUT image into a captured screenshot and make all the necessary image changes to get the look you want then crop the LUT out of it and apply as full screen effect.
It can be a bit hit and miss even for specifically made LUT's and one can make a scene look awsome and the same one look bad in a different scene so you dont want it to be applied across levels etc, exposure plays a huge part in how it will affect. It isn't a magic button and creating a good table for a scene takes work but when it works its pretty awesome.

Here's a couple examples of it working, I can blend two LUT's using it in 'another' engine.

LUT off

LUT on

LUT off

LUT on


Will need to take a look into that in GG.
Avenging Eagle
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 1st Oct 2018 19:35 Edited at: 1st Oct 2018 21:37
Quote: "What are they and what do they do?"


A LUT or Look-Up Table is a method of image post processing that applies precise mathematics to achieve changes to brightness, colour saturation, hue, and contrast. It comes from my homeland, the film industry, and was developed as a method for standardising the grading and colour correction of multiple shots in a scene, sequence, or entire film. Essentially, a LUT is a table of values that can be read to change one pixel's value to another. For example, if the source image has a pixel that has the RGB value 76,150,218 (pale blueish), the LUT can tell your software, camera, or monitor to change that pixel's value to 76,218,216 (teal). LUTs have been commonplace in the film industry for about 15 years but have, in the last 5 or so, exploded into the prosumer videography market thanks to the advent of free powerful colour correction software like DaVinci Resolve, and the development of prosumer video cameras and DSLRs that shoot flat, Log colour space video. Combined, these tools allow you to shoot an extremely flat image that doesn't over or underexpose the image...



...and transform the output into stylised, colour graded imagery such as this...



The advantage of a LUT file is that it compressed lots of complicated post-processing effects like contrast, brightness, saturation, hue shift, selective colour grading, luminance, gamma, curves into one file. The file format for a LUT is .cube

LUTs have recently begun seeping into the world of gaming as a method of post-processing. I first noticed this a couple of years back with Cities: Skyline, where mods began to appear that applied LUTs to the game to reduce the saturated, cartoony default visuals of the game and turn them into something more natural. The popular post-processing tool ReShade, which many Game Guru developers (including myself) employ, supports LUTs.

Hope that helps!

AE
rolfy
17
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 1st Oct 2018 20:22 Edited at: 1st Oct 2018 21:10
It should be noted though there are two types of LUT, technical and creative, the former being more applied to what is said above about standardised software, cameras, or monitors to change that pixel's value to 76,218,216 (teal). Technical are specific to a manufacturers own equipment and will look bad applied to any other. Creative LUT's are more in the movie/game domain and simply additional effects as extensively used in movies like the Matrix where precise mathematics don't apply though they have probably used both.Technical for the equipment used and creative for effect post processing.
Even a lot of pro's in the industry still can't get their heads around this since they are too tech savvy and locked into that initial purpose. Whatever they sure can add an extra oomph to game graphics whether Art or reality is primary. I can assure folks that the scene you created in any game engine and are thinking 'looks awesome' would be improved immensely using this and creating your own LUT's. Changing levels, curves, hue, saturation, even colour replace will alter your opinion pretty quickly.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 1st Oct 2018 21:04
Sounds like you are talking about a pixel shader.
Been there, done that, got all the T-Shirts!
PM
rolfy
17
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 1st Oct 2018 21:26
Pretty much but has no changeable parameters, all changes are made via an image even then what you see is what you get might not apply every single time. But colour correction is a must have if your creating games. it can be done to a degree using a bunch of different pixel shader effects but this uses one and more often than not your using both those methods this is the final one and the icing on the cake.
Avenging Eagle
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 1st Oct 2018 21:33 Edited at: 1st Oct 2018 21:34
Yes, rolfy, that's correct; conversion LUTs are the other half of the pie and come in equally handy for converting to different colour spaces, or hardware. I also omitted an explanation into the difference between 1D and 3D LUTs, but thankfully there's a very handy little blog here that explains the difference, for those who are interested:

https://affinityspotlight.com/article/1d-vs-3d-luts/

LUTs are great, if used correctly and subtly.

AE
Bugsy
15
Years of Service
User Offline
Joined: 24th Nov 2008
Location: Savannah
Posted: 2nd Oct 2018 05:34 Edited at: 2nd Oct 2018 05:38
I used em via reshade for kshatriya origins and DDA2

LUT is very important for determining the colour grading in a scene, what colours can be clipped, what tones get recoloured to what other tones, etc. It's very important for a level to look cinematically lit.

it works similarly to the ambience and surface RGB values in that it affects the overall colouring of your scene, but instead on a per pixel level, finding a colour, matching it with where that would be on the LUT image, and replacing it with that color.
Blacknyt46
8
Years of Service
User Offline
Joined: 29th Feb 2016
Location:
Posted: 2nd Oct 2018 07:54
Since you guy's mentioned reshade. I heard reshade eat's fps when using G.G.? And is it not only used for Dirx 9? Where can I find the download link? Thank you
Jim C
Bugsy
15
Years of Service
User Offline
Joined: 24th Nov 2008
Location: Savannah
Posted: 2nd Oct 2018 16:08
reshade does eat frames if you use shaders that eat frames like ambient occlusion or fisheye and chromatic abberation. in order to make it take less frames away, i kept all gameguru shaders disabled, (bloom=0) replacing them with their reshade counterparts.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 2nd Oct 2018 18:18
So googled LUT's and apparently they could indicate a dodgy prostate so I'd check with the doctor if I were you.
Been there, done that, got all the T-Shirts!
PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 3rd Oct 2018 21:06
Always think of LUTs as look up textures.

Can be done in GG with a bespoke shader and an engine tweak (to associate the lut to the shader).

Loads of people love this approach - I think these people are much more artistically inclined than me and have a huge command over visuals and art packages. I prefer the color grading approach based on shader formulas and tweaking parameters.

Cheers.
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 4th Oct 2018 00:32 Edited at: 4th Oct 2018 00:33
Before/after example of using LUT natively in GG (using the post process shader snippet below and re-purposing 'waves2.dds' temporarily as the LUT so as not to need engine change to test concept - not a permanent way as needed for water shader). It is a powerful color grading technique used in an artists hands - I just de-saturated as an example



Without LUT:



With LUT:

Attachments

Login to view attachments
Bugsy
15
Years of Service
User Offline
Joined: 24th Nov 2008
Location: Savannah
Posted: 4th Oct 2018 05:15
LUT is not needed really if you're good at colour grading with the sliders, and this gives you the ability to make all the levels coloured differently, however LUT is great for adding a final layer of visual solidarity to an otherwise "all over the place" game (color-wise)
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 4th Oct 2018 06:53
Bugsy I agree totally re visual solidarity but feel the GG sliders only get so far.

There are a lot of tone mapping algorithms that add much more than the sliders can for post processing.

Such as ACES, Reinhard, the ‘Uncharted 2’ approach, lots more. Once start looking at these you kind of get sucked in trying more and more. They are very performance friendly too.

Cheers.
Avenging Eagle
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 4th Oct 2018 09:25
Quote: "LUT is not needed really if you're good at colour grading with the sliders, and this gives you the ability to make all the levels coloured differently "


I disagree. Those sliders control the look of the lighting within a scene, but only the lighting. The only sliders that control the look of the entire image are brightness and contrast, we don't even have a saturation slider. Obviously it's a balancing act between the two that is needed to get a consistent 'look' through a level or game.

cybernescence, I'm confused how you're achieving that look. Are you saying your custom LUT shader is using a texture file rather than an actual .cube or .3DL LUT file?

AE
rolfy
17
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 4th Oct 2018 11:49 Edited at: 4th Oct 2018 12:29
Quote: "cybernescence, I'm confused how you're achieving that look. Are you saying your custom LUT shader is using a texture file rather than an actual .cube or .3DL LUT file?"
I think things are getting really confused here I don't use Technical LUT's at all and these .cube or .3DL LUT are for ....well tech like cameras etc. Creative LUT's are image files and can be .png etc, but not just any old texture file, I checked out waves2 ,dds and this is a normal map so I reckon any normal map de-saturated would return the same result as above.

Below are examples of proper LUT texture images used.
The first is a default LUT which you can paste into a screenshot from your level and make changes to sat,hue,contrast,brightness,curves,levels etc and then crop out to use as your 'proper' LUT image file which most times will apply all those changes full screen and as said for a very low overhead compared to bloated multiple color correction shaders. This is the simplest method I know for creating your own.Color correction using sliders (or multiple shaders) wont get me where I want and LUT's will always improve graphics if applied last in the chain even if you do use them.
As I already said above if your happy with your games appearance that's fine but if you want to take it further and improve your games appearance then this is how, it's up to the individual but there is a reason why AAA companies are adopting the method. Personally I just wanted to know if it was in as part of the DX11 update




This is the screenshot with some minor brightness and contrast tweaks, after cropping out and applying the LUT image I can be sure this is how the game will now look.
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 4th Oct 2018 13:26
Yes I’m replacing the waves.dds file temporarily with a lut texture as per rolfys post. This is just a test mechanism to attach that lut to the GG shader code and prove the concept. If an engine tweak was made to access a separate lut texture to the post process shaders LUTs would be good to go - again the creative lut approach that rolfy explaining.

Its not part of DX11 but could be added easily - that’s all I was highlighting.

Cheers.
GraPhiX
Forum Support
19
Years of Service
User Offline
Joined: 15th Feb 2005
Playing:
Posted: 4th Oct 2018 14:06
so with this I would no longer need to de-saturate my textures?

because GG's colours are too vivid I have to desaturate my colour texture by at least 10%
Welcome to the real world!
Main PC - Windows 10 Pro x64 - Core i7-7700K @4.2GHz - 32GB DDR4 RAM - GeForce GTX 1060-6G 6GB - 1TB NVe SSD
Test PC - Windows 10 Pro x64 - G4400 @3.3GHz - 16GB DDR3 RAM - GeForce GTX 950 2GB - 500GB SSD
Laptop - Helios 300 Predator - i7 7700HQ - 32GB - Nvidia GTX1060 6GB - 525GB M2 - 500 SSD - 17.3" IPS LED Panel - Windows 10 Pro x64
Various Tutorials by me
Avenging Eagle
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 4th Oct 2018 16:40
Ah, I get you now. Never heard of a texture being used as a LUT but I guess it accomplishes basically the same thing. I come from the filmmaking world where we use different types of LUTs, but still for creative purposes. ReShade support the texture method you spoke of, not the .cube / .3dl method I was referring to, and comes with a texture exactly like you presented. As a test, I took that image and added what you termed a 'technical LUT', the type I use for my filmmaking, to that image and got basically the result I was expecting.

Here's an exaggerated, full strength example (obviously you'd probably never want to go this far with your grade!)


You learn something new every day I guess

AE
Bugsy
15
Years of Service
User Offline
Joined: 24th Nov 2008
Location: Savannah
Posted: 4th Oct 2018 18:14
i actually quite like that colour grading there.

its a little OTT but you havent lost any detail, and for a gameguru game which usually never lasts more than 20 minutes it wouldnt probably become too straining on the eyes
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 4th Oct 2018 19:07
GraPhix: it would desaturate in screen space - so all colours that rendered to screen as a last step, so yes would sort out your concern.

If it’s only saturation you are worried about I have a shader update that you could have now that allows you to dial in this through adjusting parameters like a settings.fx approach. This is what I use in Cogwheel as I agree with you that real time colours pop too much out of the box (for me anyway )

Bugsy - I know you won’t believe it until you see it - but I can play Cogwheel for hours and hours (pacing is deliberately slow as not fast and furious shooter -well some parts are) Whether they are fun hours or not is another story though

AE: I’m learning too- up until this thread LUTs we’re always texture based in my head.

Cheers.
rolfy
17
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 4th Oct 2018 23:31 Edited at: 4th Oct 2018 23:54
Input LUTs, Creative LUTs, Display LUTs, Calibration LUTs, it's all pretty confusing.

The method of creating LUT's in film industry is primarily math based and accurate, you can also tweak these to use creatively. The texture based method as I want to use it, is solely creative and not supposed to be accurate in any way at all but Artistic. Though these too can be accurate...I know...lol.
I have tried to present this as simply as possible as a way of color grading your games without any overhead and for me it is a game changer. I have been brute forcing it in the past with limited results.

Login to post a reply

Server time is: 2024-04-19 14:59:29
Your offset time is: 2024-04-19 14:59:29