LUT Shader

  • FierySwordswoman
  • Topic Author
More
7 years 6 months ago - 7 years 6 months ago #1 by FierySwordswoman LUT Shader was created by FierySwordswoman
By default the sizes of the LUT.fx shader are 32 for TileSizeXY and 32 for TileAmount.
I propose having UI options for the two sizes in case someone has a LUT that happens to not be 32^3 dimensions.

"But why don't you change the values in LUT.fx to something other than 32?" You may ask...
That solution only works if all the LUT's loaded by that shader are the same exact size.

I also tried making separate LUT.fx files named LUT64.fx and LUT32.fx with the appropriate values but those had weird side effects.

Extra: If possible, a UI option to change the LUT texture source.


I tried to add the UI options myself, but as I know nothing about HLSL nor ReShade FX I ended up with 'value must be a literal expression' errors.
Last edit: 7 years 6 months ago by FierySwordswoman.
The following user(s) said Thank You: TreppenBananenHutstaender

Please Log in or Create an account to join the conversation.

  • TreppenBananenHutstaender
More
7 years 6 months ago - 7 years 6 months ago #2 by TreppenBananenHutstaender Replied by TreppenBananenHutstaender on topic LUT Shader
Yeah a UI option for the actual Texture would be great too because i cant use 1 Lut.png with many Games and i dont want 10 different textures folder i use one general shader/texture location like the old Reshade 2.0 Framework.
Last edit: 7 years 6 months ago by TreppenBananenHutstaender.

Please Log in or Create an account to join the conversation.

  • Marty McFly
More
7 years 6 months ago - 7 years 6 months ago #3 by Marty McFly Replied by Marty McFly on topic LUT Shader
You can't load more than one lut, wtf do you mean?
You can't edit texture sizes in GUI, you know, it's one of the thing you can't edit with uniforms.
Last edit: 7 years 6 months ago by Marty McFly.

Please Log in or Create an account to join the conversation.

  • FierySwordswoman
  • Topic Author
More
7 years 6 months ago - 7 years 6 months ago #4 by FierySwordswoman Replied by FierySwordswoman on topic LUT Shader
What I mean is I share Textures/Shaders across all of my games.
I've already fixed the issue of having multiple 'lut.png' files by having sub-directories dedicated to individual games.

So, the primary issue is I don't want to edit the main LUT.fx shader every time I need a different LUT size for something.
I tried copying the file, renaming it from LUT.fx to LUT64.fx and changing the variables from
#define fLUT_TextureName "lut.png"
#define fLUT_TileSizeXY  	32
#define fLUT_TileAmount  	32
to
#define fLUT_TextureName "lut64.png"
#define fLUT_TileSizeXY  	64
#define fLUT_TileAmount  	64
But that resulted in artifacts for some reason.
Last edit: 7 years 6 months ago by FierySwordswoman.

Please Log in or Create an account to join the conversation.

  • TreppenBananenHutstaender
More
7 years 6 months ago - 7 years 6 months ago #5 by TreppenBananenHutstaender Replied by TreppenBananenHutstaender on topic LUT Shader
I mean just like in ReShade 2.0:

so you can have many lut textures in the reshade texture folder and choose one of them for the preset and the size like 4096x64
Last edit: 7 years 6 months ago by TreppenBananenHutstaender.

Please Log in or Create an account to join the conversation.

  • Marty McFly
More
7 years 6 months ago #6 by Marty McFly Replied by Marty McFly on topic LUT Shader
The mediator also only edited the #defines. Nothing more. Just wrapped in a nice UI. The ReShade GUI works differently, it directly edits values in realtime. It's just that some values cannot be edited via uniforms and need recompilation.

Please Log in or Create an account to join the conversation.

  • FierySwordswoman
  • Topic Author
More
7 years 6 months ago - 7 years 6 months ago #7 by FierySwordswoman Replied by FierySwordswoman on topic LUT Shader
[strike]Ah, I figured it out. I had to change the technique of the LUT64.fx shader to a unique name. Okay. I'm fine now.

Now I have a separate shader for my 64^3 LUT's as I wait for the 'Lightroom' shader to come out. Then I can re-making my presets using the 32^3 LUT's it generates since 64^3 is unnecessarily large.[/strike]

EDIT: Nope. Even by changing the technique name to something unique, there's still artifacts not present when editing the main LUT.fx


Banana, what Marty means by "can't edit with uniforms" is this:

Shader values in ReShade 3 need to be able to change in real-time for it to be a GUI option. If it's a value that needs the shader to be completely re-loaded (like the image size of the LUT) it can't be a GUI option for that reason.
In ReShade 2, the active effects would re-load every time you pushed a change from the Assistant UI to your game (the loading text in the upper-left would appear every time), so it was possible to edit these settings.
Last edit: 7 years 6 months ago by FierySwordswoman.

Please Log in or Create an account to join the conversation.

  • crosire
More
7 years 6 months ago - 7 years 6 months ago #8 by crosire Replied by crosire on topic LUT Shader
It is still possible to edit these settings, just not in real-time. On the settings tab there is a "Preprocessor definitions" field, where you can set those defines.
For instance, add the following line to change the texture file name. Then hit "Reload".
fLUT_TextureName="lut2.png"
Last edit: 7 years 6 months ago by crosire.
The following user(s) said Thank You: TreppenBananenHutstaender

Please Log in or Create an account to join the conversation.

  • FierySwordswoman
  • Topic Author
More
7 years 6 months ago - 7 years 6 months ago #9 by FierySwordswoman Replied by FierySwordswoman on topic LUT Shader
With Crosire's suggestion:
"preprocessor error: redefinition of fLUT_TextureName"

Commenting-out the respective #define lines in LUT.fx fixes that, but that involves modifying the shader file, making sharing stuff a lot less easy for those who don't know what they're doing.
Last edit: 7 years 6 months ago by FierySwordswoman.

Please Log in or Create an account to join the conversation.

  • crosire
More
7 years 6 months ago #10 by crosire Replied by crosire on topic LUT Shader
Yeah, the shader file should have an #ifndef...#endif block around #define. Not sure why it's not there yeat, but that'll be fixed.

Please Log in or Create an account to join the conversation.

  • TreppenBananenHutstaender
More
7 years 5 months ago #11 by TreppenBananenHutstaender Replied by TreppenBananenHutstaender on topic LUT Shader

crosire wrote: It is still possible to edit these settings, just not in real-time. On the settings tab there is a "Preprocessor definitions" field, where you can set those defines.
For instance, add the following line to change the texture file name. Then hit "Reload".

fLUT_TextureName="lut2.png"


Good to know and the same is working with fLUT_TileSizeXY and fLUT_TileAmount too right? if yes what values should i put there to use a 4096x64 LUT?

Please Log in or Create an account to join the conversation.

  • Sunesha
More
7 years 5 months ago #12 by Sunesha Replied by Sunesha on topic LUT Shader
You can add this to the pre-proccessor settings in reshade 3.
LUT
// NON-GUI LUT settings
fLUT_TextureName="lut.png"
fLUT_TileSizeXY=32
fLUT_TileAmount=32

There is more settings for other shaders in this thread:
reshade.me/forum/shader-discussion/2366-...3-0-non-gui-settings

Please Log in or Create an account to join the conversation.

  • FierySwordswoman
  • Topic Author
More
7 years 5 months ago - 7 years 5 months ago #13 by FierySwordswoman Replied by FierySwordswoman on topic LUT Shader
Banana,

A 4096*64 LUT should consist of a lot of squares.
The square height/width (or the LUT image height) is what you put in for fLUT_TileSizeXY
The amount of squares (or the LUT's image.width/image.height) is what you put in for the fLUT_TileSizeXY
Yours is a 64^3 3D LUT, so the dimensions of each square are 64 and the amount of squares is also 64 (4096/64).


Oh, hey, that's a handy thread. Beats having to look through the .fx files.
Last edit: 7 years 5 months ago by FierySwordswoman.

Please Log in or Create an account to join the conversation.

  • crosire
More
7 years 5 months ago #14 by crosire Replied by crosire on topic LUT Shader
Since I don't think anybody realized this yet: ReShade searches for textures by going through the texture search paths in order. Now because after a fresh installation the search path contains both the game directory and the reshade-shaders\Textures folder in that order, if you put a lut.png in the game folder it will overwrite the one that came with the shaders without you having to change any file names in the settings or replacing existing files.

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.