I wonder would it be calculative or memory expensive to turn grayscale image to RGB same way Gradient node in Substance designer works ? or just by using LUt image like 8x1 pixels texture?
Why we use 2k RGB textures for base color instead of just one channel packed together with roughness and AO + some tiny LUT image if we do base color/albedo exactly same "gradient node" way in SubsDesigner?
Replies
if it's a runtime changeable thing there will be a cost associated with passing data around - that can be prohibitive but will depend on your engine/use case. it'll be equivalent to something like changing a light colour based on input from the game and if there is a problem it will most likely be related to how many things have the functionality enabled or how many datapoints are involved.
you need to be a bit clever with texture formats on the luts and the textures that drive them - what you choose will be peculiar to your engine/use case but we have been known to use very small (32x4) uncompressed luts rather than larger compressed ones and we tend to use higher quality grayscale inputs than you normally would. this is mainly to reduce banding and is arguably only a good idea because we generally have a very clean and simple art style.
The result of that is that you may only be 1/2 the memory footprint rather than 1/4 vs using color maps.
it's worth mentioning that you can apply the same logic to generating roughness/metallic etc - we did that to great success in a recent game
with the most basic implementation you're sampling one extra texture so that's a thing someone might choose to argue over. If you dont' have any need for dynamic changes or haven't planned to mix and match luts with the grayscale source textures then you're really only gaining in terms of memory footprint.
This sort of thing is extremely common in vfx and the shader world so I imagine it's not going to be a strange idea to the shader programmer.
in terms of what happens on the GPU I would expect it's very specific to your implementation so i can't possibly comment
I'm a big fan of the technique independent of any efficiency gains - its a hell of a step up visually from multiplying your basecolor over a grayscale map and it opens up all sorts of options if you have customisation systems or want to re-use assets