Its possible to render an object with transparency on (to don't see the background) and also to get the mist channel with the transparency applied to? I would like the part marked in blue on the picture to be transparent, but the mist channel take it as white (I imagine that it considers that far away)
In order to set pixels of the mist transparent where the original render is transparent, you can multiply the alpha pass with the mist pass.
The full steps to achieve this result are:
- Enable film transparency (Render Properties > Film > Transparent)
- Enable the mist pass (View Layer Properties > Passes > Data > Mist)
- Switch to the Compositing workspace or open the compositor and enable Use Nodes
- Add a Math node (Add > Converter > Math), set the mode to Multiply and use the Alpha of the render layer and the Mist as inputs. Alternatively this should also work with the Mix node set to Multiply and the factor set to 1. The effect is that the alpha is used to mask the mist. When the alpha is zero the result of the math node is zero as well, thus the result is transparent in exactly the same places as the alpha channel.
- Use the result from the previous step for further compositing.
Below is a visualization of the intermediate steps of the compositing node tree.