Macha Posted October 2, 2012 Share Posted October 2, 2012 (edited) Has anybody worked on shaders parts that 'undo' LUTs? I have a rather tricky volume shader that maps density to color and it's very finicky in the way it maps accumulated voxel density to pixel density. So, once I worked out a good color palette and apply a LUT it goes all wonky again. There should be a way to apply an inverse of a LUT, since it is just a function mapping from one R3 space to another, and an inverse exists. Has anybody tried that before? Edited October 2, 2012 by Macha Quote Link to comment Share on other sites More sharing options...
edward Posted October 4, 2012 Share Posted October 4, 2012 In general, an inverse may not exist since your LUT may map multiple values to the same one. If your LUT is invertible, then you can feed it all possible values and get an map of it from output to input. Quote Link to comment Share on other sites More sharing options...
Macha Posted October 4, 2012 Author Share Posted October 4, 2012 Thanks Edward. I assumed -hoped- LUTs were 1-1 maps. Maybe they are clamped at the top and bottom values. Do you think we could plot the effect of LUTs on RGB values in COPs? If at least I have some idea of how they behave I could build an approximate inverse function for it. Is there any good online explanation of how LUTs are represented? Is there a standard of sorts? Quote Link to comment Share on other sites More sharing options...
malexander Posted October 4, 2012 Share Posted October 4, 2012 There's generally 2 main types of LUTs - curve based LUTs, and 3D LUTs. Curve-based LUTs are fairly easy to invert as long as they're continually increasing in value. If they double back on themselves (like a U) then they cannot be inverted. 3D LUTs are best visualized as a giant color cube. They can be inverted by creating a point cloud out of the the output values in 3D LUT space (position = output value, Cd value = input value) then sampling the nearby points for Cd, for all entries in the inverse LUT. However, you can run into the same issues as curve-based LUTs if more than one 3D LUT entry maps to the same output value. Our LUTs are described in detail here: http://www.sidefx.co...hdk_io_lut.html Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.