Lightwave Camera & ThinLens DOF Matching for Masks & Passes

Forums: Lightwave Camera & ThinLens DOF Matching for Masks & Passes
Newtek Lightwave 3D (exporter developed by holocube, Integrated Plugin developed by juanjgon)

Moderator: juanjgon

Lightwave Camera & ThinLens DOF Matching for Masks & Passes

Postby MrFurious » Tue Nov 19, 2013 5:21 pm

MrFurious Tue Nov 19, 2013 5:21 pm
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.

FD.jpg
The yellow diamond is the DOF target null


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.

fstop1.jpg


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.

fstop2.jpg


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)
Dino Inglese
CG Artist
Melbourne Australia


Intel Core i7-4820K, 3x GTX 980ti
Windows 7 64bit, Modo 12.2v2 for PC
Octane build 4.04.0.145
User avatar
MrFurious
Licensed Customer
Licensed Customer
 
Posts: 529
Joined: Wed Oct 23, 2013 5:46 pm
Location: Melbourne, Australia

Re: Lightwave Camera & ThinLens DOF Matching for Masks & Pas

Postby UnCommonGrafx » Thu Nov 21, 2013 2:23 am

UnCommonGrafx Thu Nov 21, 2013 2:23 am
Well,
That's quite helpful!
Thank you.
i7-4770K, 32gb ram, windows 8.1, GTX Titan and gt 620 for display
UnCommonGrafx
Licensed Customer
Licensed Customer
 
Posts: 199
Joined: Wed Mar 13, 2013 9:14 pm

Re: Lightwave Camera & ThinLens DOF Matching for Masks & Pas

Postby marchermitte » Thu Nov 21, 2013 9:31 am

marchermitte Thu Nov 21, 2013 9:31 am
Yeap, congrats, that was one of my issues as well. I'm going to test out.
Thank you!
Marc Hermitte
Intel I7 4.5 Ghz, 24 gig ram, 2x Nvidia GTX 480, win 764bits
marchermitte
Licensed Customer
Licensed Customer
 
Posts: 283
Joined: Sat May 29, 2010 9:25 pm
Location: Geneva

Re: Lightwave Camera & ThinLens DOF Matching for Masks & Pas

Postby MrFurious » Thu Nov 21, 2013 12:17 pm

MrFurious Thu Nov 21, 2013 12:17 pm
I've yet to test this myself on an actual job and a more complex scene, hopefully this will hold up and wasn't just a per-scene solution- may need some tweaking
Dino Inglese
CG Artist
Melbourne Australia


Intel Core i7-4820K, 3x GTX 980ti
Windows 7 64bit, Modo 12.2v2 for PC
Octane build 4.04.0.145
User avatar
MrFurious
Licensed Customer
Licensed Customer
 
Posts: 529
Joined: Wed Oct 23, 2013 5:46 pm
Location: Melbourne, Australia

Re: Lightwave Camera & ThinLens DOF Matching for Masks & Pas

Postby alexos » Sun Nov 24, 2013 9:57 pm

alexos Sun Nov 24, 2013 9:57 pm
Very interesting and informative, thank you. Er, however, I might have missed something here, but when you speak of "surface isolation", I mean... Couldn't you just use the "surfaceID" pass in the info kernel?

ADP.
alexos
Licensed Customer
Licensed Customer
 
Posts: 58
Joined: Tue Mar 12, 2013 1:55 pm

Re: Lightwave Camera & ThinLens DOF Matching for Masks & Pas

Postby MrFurious » Mon Nov 25, 2013 6:46 am

MrFurious Mon Nov 25, 2013 6:46 am
Hey I'd totally missed the passes option in the Info Kernel.. Unfortunately this is the result I get from a Material ID pass, less than desireable :(

render.jpg
render

materialID.jpg
note: no DOF where objects are in front of the background. Also colours all smooshed toghether where objects intersect


This is what I'm trying to achieve:

starthing mask.jpg
item/material 1 mask

blob mask.jpg
item/material 2 mask
Dino Inglese
CG Artist
Melbourne Australia


Intel Core i7-4820K, 3x GTX 980ti
Windows 7 64bit, Modo 12.2v2 for PC
Octane build 4.04.0.145
User avatar
MrFurious
Licensed Customer
Licensed Customer
 
Posts: 529
Joined: Wed Oct 23, 2013 5:46 pm
Location: Melbourne, Australia

Re: Lightwave Camera & ThinLens DOF Matching for Masks & Pas

Postby alexos » Mon Nov 25, 2013 10:48 am

alexos Mon Nov 25, 2013 10:48 am
Oops, you're quite right - no mask DOF if there's no geometry in the background. Bug report/feature request on this one, I would say, even though I seem to remember reading they're going to add all sorts of passes in v1.5... Juanjo? :)

ADP.
alexos
Licensed Customer
Licensed Customer
 
Posts: 58
Joined: Tue Mar 12, 2013 1:55 pm

Re: Lightwave Camera & ThinLens DOF Matching for Masks & Pas

Postby MrFurious » Mon Nov 25, 2013 1:43 pm

MrFurious Mon Nov 25, 2013 1:43 pm
Simple workaround could add a background plane for the sake of passes then deactivate when not needed. Still.. I'm not a fan of the the smooshy colour bleeding. wonder if there's some way to use the alpha input of the Info Kernel to isolate an object or material?
Dino Inglese
CG Artist
Melbourne Australia


Intel Core i7-4820K, 3x GTX 980ti
Windows 7 64bit, Modo 12.2v2 for PC
Octane build 4.04.0.145
User avatar
MrFurious
Licensed Customer
Licensed Customer
 
Posts: 529
Joined: Wed Oct 23, 2013 5:46 pm
Location: Melbourne, Australia

Re: Lightwave Camera & ThinLens DOF Matching for Masks & Pas

Postby FrankPooleFloating » Mon Nov 25, 2013 3:21 pm

FrankPooleFloating Mon Nov 25, 2013 3:21 pm
I do not have time to read entire thread today, but I have made more than a couple separation masks using Override w/ Override Exclusion in object properties... and for separating a certain material, I make two new copies of this object - one with polys of the material I want, and the other without... Do Override as Matte and turn off Override for that material object I wanted...
Win10Pro || GA-X99-SOC-Champion || i7 5820k w/ H60 || 32GB DDR4 || 3x EVGA RTX 2070 Super Hybrid || EVGA Supernova G2 1300W || Tt Core X9 || LightWave Plug (v4 for old gigs) || Blender E-Cycles
User avatar
FrankPooleFloating
Licensed Customer
Licensed Customer
 
Posts: 1669
Joined: Thu Nov 29, 2012 3:48 pm

Re: Lightwave Camera & ThinLens DOF Matching for Masks & Pas

Postby happymilk » Sat Dec 14, 2013 2:03 pm

happymilk Sat Dec 14, 2013 2:03 pm
i use a different solution for determine the DOF distance.
Only 2 ItemInfo node (one for camera and one for the NullObject that i use for focus) and a Distance Node.
It's work well for me :)
Attachments
Untitled.jpg
Win 10pro 64 | 3 x Geforce GTX980Ti | i7 5930K | 32GB
User avatar
happymilk
Licensed Customer
Licensed Customer
 
Posts: 54
Joined: Wed Jun 20, 2012 8:25 pm
Next

Return to Lightwave 3D


Who is online

Users browsing this forum: No registered users and 21 guests

Thu Apr 25, 2024 3:19 pm [ UTC ]