Jump to content

Shader LUT


Macha

Recommended Posts

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 by Macha
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...