Not sure if I’ve asked this before, but quick searches yielded no results.
Is it possible to render a scene where we can effectively have a matte for the reflections from certain geometry. For instance, if I have a piece of geometry, I want to be able to render a black and white matte, the white being the reflections, the black being where nothing is reflected (i.e. where it is reflecting empty space).
I want to do this at rendertime, without doing a separate pass just for this reflection matte.
(actually, I might have just found my old thread on this!!!)
you could do something like that with reflective occlusion in extra tex and have an inclusion list where only objects you want to reflect are being traced. then you can pull a black and white matte .
Yes, vray dirt has a mode - reflective occlusion. It acts as a primary reflection ray, where by it traces the objects in the scene with reflection rays and not occlusion rays. Then, the occlusion color becomes the traced object color. This is how you can generate a mask from it.
I’ve attached a very quick test scene if you had a spare moment to take a look Dmitry. There is a mirror and a teapot. Essentially, I need a matte of the reflections in the mirror. I have been clicking buttons like a monkey writing Shakespeare on a typewriter but cannot get what I want. Any ideas? ReflectionMatte.zip (28.3 KB)
Right - as Dmitry says you can use a dirt map for this. Stick one into the extra tex map slot and use the include / exclude list on it to only choose the objects that you want to get your matte for - in your case the mirror. In the dirt map set the mode to reflection occlusion and use whatever mode (blinn / phong) is the same as the shading mode your mirror material is using. If you’re doing any glossy reflections on the mirror mat, you’ll need to use the same value in the vray dirt so they blur the same amount. For a flat sharp mirror then it’s just 1. If you’ve multiple objects but only need a matte of one of them you can use the result affect button in vray dirt to exclude objects that you don’t want to get a matte for. The last thing to get this to behave is upping the radius of your vray dirt to a large enough amount that the rays coming from your mirror can reach the object you want to get a matte for. reflection_matte_01.zip (22.7 KB)
Fabulous! You know, I think the thing that I overlooked was the radius!
So, to have a single pass render with *almost* invisible glass in the RGB beauty, but have all the control of that glass as a series of render elements (the VrayRawReflection, a matte for the glass (set up through a simple multimatte element) and a matte for the reflections (set up using the VrayExtraTex Dirt method)), we just have to give the glass a diffuse of 0,0,0, a reflection of 1,1,1 without falloff, and set the refraction at 255,255,255.
Ideally, I’d like to have the glass completely invisible in the RGB beauty pass, but appear in the various reflection elements. I don’t thing this is possible though.
I am not sure if such mask could be extracted from the dirt-map but here how it can be extracted from MultiMatte Render Element.
First Affect Channels from the Reflection Layer of the mirror object must be set to All Channels - this option will force MultiMatte element to create masks not only from the camera rays but from reflection rays as well:
Second we have to create copy the teapot-material which will be used as a Reflection Override Material with unique ID number. This is necessary because otherwise the MultiMatte element will create a mask for both camera and reflection rays so in order to separate them they have to use materials with different IDs. Create a new VrayOverrideMtl, assign it to the teapot, the original material should be plugged into Base slot and a copy of it into Reflect Mtl. Then set ID of the Reflection Override mtl:
The last thing would be to use the same ID number into MultiMatte element and to turn on isMATID checkbox:
Please note the strength/value of the mask will depend from the strength of the reflection layer of the mirror but this could be easily modified on post:
Svetlozar I don’t think the people on the forum tell you often enough that we love you - Much appreciated for all the tips and workflow examples over the years
Unfortunately it isn’t a good solution for us as we want to have the reflection strength VERY dim (as dim as is possible, if not invisible) in the RGB render, but maximum as an element (in the VRayRawReflection element). This means the reflection colour of the material is just 1,1,1 and rendering a multimatte of the reflections using this method yields a VERY VERY dim matte, if not invisible.
Essentially, we want the beauty pass to have no glass in it, but the raw reflection element to have the glass in it as ‘mirror-like’ glass, and then have a matte for the reflections on their own. We want this all to happen at render time in one pass.
The vraydirt option as an extratex gets us 95% the way there.