Double Checking LUT Interpolation #45
-
Hello! While I know you have some LUT interpolation code here https://github.com/ScanMountGoat/Smush-LUT/blob/master/src/interp.rs , I do want to double check that this is how smash does that interpolation, and want to ask where the code for said interpolation is within the code. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The interpolation is done by the GPU hardware and determined by the sampler settings. You can find the sampling algorithms in places like the vulkan specification, but it shouldn't be relevant for anything shader related. In shader code, you can just write |
Beta Was this translation helpful? Give feedback.
The interpolation is done by the GPU hardware and determined by the sampler settings. You can find the sampling algorithms in places like the vulkan specification, but it shouldn't be relevant for anything shader related. In shader code, you can just write
vec3 color = texture(my_3d_tex, vec3(x,y,z)).rgb;
. I would not expect the assembly to be much more complex since interpolation is a hardware feature on any modern GPU. For color grading LUTs in Ultimate, the values use linear interpolation in X, Y, and Z to avoid needing a large 256x256x256 texture.