Welcome, Guest.
Username: Password: Remember me

TOPIC: LUT Shader

LUT Shader 1 month 2 weeks ago #1

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: 1 month 2 weeks ago by FierySwordswoman.
The administrator has disabled public write access.
The following user(s) said Thank You: TreppenBananenHutstaender

LUT Shader 1 month 2 weeks ago #2

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: 1 month 2 weeks ago by TreppenBananenHutstaender.
The administrator has disabled public write access.

LUT Shader 1 month 2 weeks ago #3

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 609
  • Thank you received: 716
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: 1 month 2 weeks ago by Marty McFly.
The administrator has disabled public write access.

LUT Shader 1 month 2 weeks ago #4

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: 1 month 2 weeks ago by FierySwordswoman.
The administrator has disabled public write access.

LUT Shader 1 month 2 weeks ago #5

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: 1 month 2 weeks ago by TreppenBananenHutstaender.
The administrator has disabled public write access.

LUT Shader 1 month 2 weeks ago #6

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 609
  • Thank you received: 716
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.
The administrator has disabled public write access.

LUT Shader 1 month 2 weeks ago #7

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.


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: 1 month 2 weeks ago by FierySwordswoman.
The administrator has disabled public write access.

LUT Shader 1 month 2 weeks ago #8

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2437
  • Thank you received: 1384
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"
Cheers, crosire =)
Last Edit: 1 month 2 weeks ago by crosire.
The administrator has disabled public write access.
The following user(s) said Thank You: TreppenBananenHutstaender

LUT Shader 1 month 2 weeks ago #9

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: 1 month 2 weeks ago by FierySwordswoman.
The administrator has disabled public write access.

LUT Shader 1 month 2 weeks ago #10

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2437
  • Thank you received: 1384
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.
Cheers, crosire =)
The administrator has disabled public write access.

LUT Shader 1 month 2 weeks ago #11

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?
The administrator has disabled public write access.

LUT Shader 1 month 2 weeks ago #12

  • Sunesha
  • Sunesha's Avatar
  • Offline
  • Posts: 94
  • Thank you received: 6
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
The administrator has disabled public write access.

LUT Shader 1 month 2 weeks ago #13

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: 1 month 2 weeks ago by FierySwordswoman.
The administrator has disabled public write access.

LUT Shader 1 month 1 week ago #14

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2437
  • Thank you received: 1384
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.
Cheers, crosire =)
The administrator has disabled public write access.