In version 4.4.0, I have a nicely working Compositor node setup for adding mist to a scene with Mist Pass turned on.
However, I would like to exclude the VDB cloud and the environmental image from being affected by the mist so I can control their look independently. I have tried all manner of tricks suggested by Microsoft Co-Pilot (A.I. = artificial ignorance) and nothing works. I tried the “Cryptomatte” node to mask some elements, but I never got it to work. Does anyone know of a great video or node setup I could learn from?
Well, I think you might need to create a viewlayer without the cloud and environment, to make the mist pass …
I’m not sure how volumes (VDB) would work with cryptomattes, at least for regular objects this looks like an option to control the mist independently.
From a distance it’s like that you are trying to solve too many issue at the same time and I think you’re running in different problems at the same time.
I’d first try to edit the mist pass with a regular object, so you’re sure it’s either the technique that doesn’t work with VDB or you really didn’t manage to make that work.
Then look into the viewlayer to create the proper mist pass, if needed…
Is it an animation project ? can you afford to render the image twice ( with and without the VDB) ?
No, not an animation - just an experimental very simple file to try to figure out how to have cloud / sky not be affected by the mist. Not sure how to “create a view layer” either.
Well, view layers / render layers are a way do do selective renders , kind of like a layer in photoshop so you can isolate parts of it and then combine
them in comp…
Anyway, sorry if this sounds sarcastic, but take forums interactions as many learning opportunities, if a term isn’t clear it’s always worth looking into it and worse case scenario if it’s not useful now it can be latter…
This looks like a good first step toward solving your problem : https://letmegooglethat.com/?q=blender+create+a+view+layer
Feel free to poke me again if nothing there helped
OK, thanks sozap. I now know about and am using View Layers, and yet the problem persists. I find no way to allow an environment to be excluded from the mist. It is not possible to turn transparency on for some View layers but off for others. The whole trick can be done with multiple renders combined in photoshop, but that means the results cannot be seen and adjusted in Blender.
So, yeah viewlayers and compositing in general tend to be post-processing techniques that isn’t always possible to visualize right away in the viewport.
Some things are possible but viewlayers don’t work with viewport compositor.
Anyway, instead of going through photoshop the point is to use nodes, so at least you get the result when rendering.
Here is a trick you can try, you don’t need viewlayers for that :
Turn out that when testing volumes aren’t influencing the mist pass so this wasn’t an issue in the first place
Now for the environment we can create a mask by taking the environment pass and selecting the pixels that are brighter than black :
The antialiasing node helps to smooth edges that might need a bit of massaging to work … It’s never going to be pixel perfect but it can still be good enough.
Then you multiply that mask with the mist pass to exclude the sky :
I’d just render the volume in a separate scene then add it back to the main scene using a mix colour node. You can render all the scenes at once if you add the volume scene’s render layer node to the main scene’s compositor.
So that objects cast shadows into the volume correctly, I’d make the volume scene a linked copy of the main scene, and then in the outliner set all objects other than the volume to be indirect only. That setting is on the collection, so you’ll need to put your volume into it’s own collection.