How can i make a LUT Shader with a dropdown selector

Post Reply
  • Author
  • Message
Offline
Posts: 9
Joined: 27 Sep 2023, 23:45

How can i make a LUT Shader with a dropdown selector

Hey, i learned a lot of things and now i'm trying to make a LUT Shader, but idk how to make a shader for a dropdown selector that changes the lut texture which is 4096x64px. I'd also try to add a Intensity, Black/White Input and Black/White Output. So how do i proceed?

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17481
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: How can i make a LUT Shader with a dropdown selector

Find shaders on Nexus with same features and learn from them. It's much simpler to understand from existing examples. This is compex enough to write how to do. In short, textures must be created at the start all, then dropdown box just to switch code path to read one of them, quantity of lut textures influence performance because of this and it's can't be avoid cause of limitations of hlsl. Something like this:
if (lutindex==1)
{
lut = TextureLut1.Sample(Sampler, lutuv);
}
if (lutindex==2)
{
lut = TextureLut2.Sample(Sampler, lutuv);
}
if (lutindex==3)
{
lut = TextureLut3.Sample(Sampler, lutuv);
}
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7
Post Reply