Hi all, I've been tinkering with the nodes in Octane Editor in an attempt to match the DOF settings of Octane ThinLens, with those of the Lightwave perspective camera and I think I have something which works quite well. I often need object and surface isolation masks and before I bought Octane I'd render these out using ShaderMeister. Along comes the fabulous Octane render, but how to generate isolation masks? I noticed the default diffuse material has a 'matte' button but only the diffuse materal, not glossy or specular. Even if all Octane materials had the matte option it would still be a daunting task to activate/deactivate these individually as required especially in a scene with many objects and materials. The 'material override' feature would be helpfull but only on a per-object basis (good for object masks but not surface masks)
So.. back to shadermeister for my masks & passes but here's the problem: ThinLens DOF needs to match Lightwaves own DOF or the masks won't match the beauty render. This is what I've come up with and so far I've found it to work, but I haven't fully tested it in a variety of different scenes/camera focal lengths etc.
First thing to note is the Focal Depth is controlled in the usual Lightwave way ie: targeted to a null via proximity modifier in the LW Camera DOF panel. Add a null for the DOF Target, parent to camera and disable the null's rotation HPB, scale XYZ and Position XY.. you only want to move this along the Z axis towards and away from the camera. I added a 'shape' custom object to the null so it's easier to see in your scene. Open up the octane editor and drop in the 'Camera' node (Item info-->Camera) double click and select 'Render Camera' Connect the focal distance node output to the focal depth input of thinlens camera. Boom- focal distance now mathches.
The Lens F-Stop (amount of defocus) is also controlled via the LW camera DOF panel. No modifier here though, just enter a number and it ties into Octane later in the Editor. This next step was a bit tricky (for me anyway I'm very much mathematically challenged) Octane's aperture setting works inversely to Lightwave. If both LW F-stop and Octane's aperture settings are set to 1 the defocus matches. A LW F-stop value of 0.5 = Octane Aperture setting of 2. A LW F-stop value of 0.25 = Octane Aperture setting of 4, and so on. Halve the LW F-stop and double the Octane setting to get the same defocus effect. Back to the octane editor drop in a divide node. In the LW camera node added earlier, connect the 'Lens F-stop' output node to both the A & B inputs of the divide node. This divides the LW fstop number by itself, but you need to do this twice. Copy and paste the divide node, connect the 'result' from the first divide node into A of the second divide node, and in the B input, connect the Lens Fstop node from the LW camera. ie: LW fstop number of 0.5 divided by 0.5 = 1 divided by 0.5 = 2.
This seemed to do the trick until I realised the Lens Focal Length (or zoom factor) of the LW camera effected the defocus amount. The next part was trial and error.. connect the LW camera 'zoom factor' output node to the input A of a divide node and in input B put 2.7, run the result into a multiply node and connect the result into the octane aperture node input.
I tested this at focal lengths of 12mm, 18mm, 35mm, 50mm and both the Octane and LW DOF match perfectly. (Best way to check this is rendering out alpha's)