zpelgrims / pota

Polynomial optics to Arnold. Camera shader with high-order aberrations, including bidirectional filter that adaptively samples out-of-focus highlights.
https://www.lentil.xyz
20 stars 5 forks source link

Some models won't work in HTOA #6

Closed melMass closed 6 years ago

melMass commented 6 years ago

I might be missing something but the DOF is off in HTOA:

Using POTA DOF:

Focus Distance: 7 F-Stop: 5.6 Played with the Extra Sensor Shift Aperture Blades: 4

Removing POTA and using Ai DOF:

Focus Distance: 7 Aperture Size: 1

Any idea of what I'm doing wrong ?

zpelgrims commented 6 years ago

Which lens is this? I haven't tested htoa yet.

Could you please post the output that appears in the arnold log (anything starting with [POTA])?

melMass commented 6 years ago

@zpelgrims This one was using the Zeiss Biotar 1927 58mm

The output does show stange missing attr:

00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: position (ar_position)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: look_at (ar_look_at)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: up (ar_up)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: matrix (ar_matrix)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: handedness (ar_handedness)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: near_clip (ar_near_clip)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: far_clip (ar_far_clip)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: screen_window_min (ar_screen_window_min)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: screen_window_max (ar_screen_window_max)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: shutter_start (ar_shutter_start)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: shutter_end (ar_shutter_end)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: motion_start (ar_motion_start)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: motion_end (ar_motion_end)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: lensModel (ar_lensModel)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: sensor_width (ar_sensor_width)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: wavelength (ar_wavelength)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: dof (ar_dof)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: fstop (ar_fstop)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: extra_sensor_shift (ar_extra_sensor_shift)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: vignetting_retries (ar_vignetting_retries)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: backward_samples (ar_backward_samples)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: minimum_rgb (ar_minimum_rgb)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: bokeh_exr_path (ar_bokeh_exr_path)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: proper_ray_derivatives (ar_proper_ray_derivatives)
00:00:00  1040MB WARNING | [htoa.node.node] [soho] Parameter not found: name (ar_name)
melMass commented 6 years ago

I'm using

HtoA 2.2.2 (Arnold 5.0.2.3)

zpelgrims commented 6 years ago

Thanks for this output. I don't know that much about htoa but it looks pretty clear to me the parameter's can't be found :-). Just to check, when adjusting the parameters, does anything happen at all?

melMass commented 6 years ago

Yes some of them.. :

Attribute Working Details
lensModel Yes -
sensor_width Yes -
wavelength Yes -
dof Yes -
fstop Yes -
focus_distance NO -
extra_sensor_shift NO ( hard to tell ) -
aperture_blades Yes Something stange happens here, at 2, the first progressive pass is all sharp (without DOF I mean), whereas from the second progressive pass, dof kicks in. Looking at the log the error posted above are printed more than once, I'll say at each progressive pass ?
backward_samples NO -
minimum_rgb NO -
melMass commented 6 years ago

The pota thin lens's focus_distance works as expected (but prints similar missing attr to the log):

zpelgrims commented 6 years ago

There's definitely some stuff wrong here. You shouldn't even be seeing the backwards_samples or minimum_rgb parameters.

Also, the thin lens is a different shader from pota, there's no thin lens option..

melMass commented 6 years ago

@zpelgrims Just to be clear the pota thin lens is not an option, it is another shader from the pota one in htoa menus.

melMass commented 6 years ago

Here are the default parameter list in HtoA:

zpelgrims commented 6 years ago

I've updated the metadata file, it still had some unused parameters in there. Could you try again with that one?

Still not sure what the Parameter Not Found warnings are about. All that should be required is this metadata file..

What's the distance to your object? Make sure to work in real life scale. But apart from that, it should all work..

Cheers for the debugging! Keep me posted

melMass commented 6 years ago

Sorry I was on location for a few days. I saw you retweet about someone using it in HTOA, so I must be doing something wrong, I'm still seing backward samples & minimum rgb and the focus distance has no effect,

Houdini works in meter, HTOA respects that. My object is at 7m

If I can provide anything to help debugging let me know

melMass commented 6 years ago

Actually both the Takumar and WideAngle models works as expected with DOF on !

Wideangle wideangle

Takumar takumar

zpelgrims commented 6 years ago

I've completely got rid of the new attributes, so expect them to disappear in the next release.

Are these the only two working? I was talking to a htoa person today who was focusing the aspherical fisheye at 0.74 Houdini units. Maybe somehow the translation of aiFocusDistance is wrong? What are your thought on that? I really should install Houdini so I can debug this myself..

What was your focus distance for e.g. the takumar?

melMass commented 6 years ago

Thanks. Yes ! the other models do works without DOF. The Focus distance on Takumar and Wideangle match my arnold only test (7 m).

I'll test different order of magnitude on the other models to see if it might be a scaling interpretation issue (by the way the focus distance parameter states cm in the name) but it strange that it matches perfectly on those two models don't you think ?

I'll dig a little more before lunch (GMT+1) so I have two hours. And try to report as much as I can.

Thanks for the support!

melMass commented 6 years ago

Hooray, I don't know which commit did resolve Houdini parameters but it seems to be all resolved now!

Except at Aperture Blades == 2 where no DOF is applied

BTW is it possible to add samples on the camera shader only ? I'll close the issue after further testing tonight.

Thanks again Zeno.

zpelgrims commented 6 years ago

I think there was some strange translation for the aiFocusDistance parameter, I took the same name as the Arnold core to be consistent but I think it scales it by 0.01 to comply with Houdini's units. All I did was change the name of the parameter to see if that would fix it. Let me know if you now focus correctly in cm. I haven't installed houdini yet so it was a shot in the dark.

Adding samples only on the camera shader isn't possible with the Arnold architecture. However, I've already written an aov shader (you can check out the code) which does extra sampling of high intensity samples by shooting rays the other way through the lens. It's inspired by what Animal Logic is doing with Glimpse but they haven't released their paper yet (hence the ad-hoc implementation).

I've updated the code to fix no DOF when aperture_blades is set to 2. Was a silly mistake.

Thanks again for reporting man, super helpful.

melMass commented 6 years ago

Yes the parameter is translated to meters in H now. See image in #7 the Focus Distance on both is 5.7 meters

Great work i'll try the AOVs implementation ASAP. Some models still have issues with DOF, i'll try to make a precise report on a the same test scene as soon as I have the time.

zpelgrims commented 6 years ago

So to focus at 5.7 meter, you have to enter 5.7 in the focal_distance? It should be in cm (570 units) 😭. I don't understand how houdini could replace the value of one parameter and not the others.... Looks like i'll have to install Houdini anyway haha

melMass commented 6 years ago

Haha, correct 😢 ! I guess aiFocalDistance does a translation per DCC according to the scene scale. (so does SSS radius, default Focal Distance etc etc ...):

From Frederic Servant @Autodesk:

The length parameters in Arnold are unitless, they use whatever the application unit is. Houdini's default unit is 1m, Maya is 1cm and Softimage is 10cm and this is why you see this discrepancy.

zpelgrims commented 6 years ago

Still, strange that there would be a difference for focal_distance and not for lets say wavelength. I'll ask the guys at solidangle about this after I've done some more testing. The Arnold core parameter is aiFocusDistance, not aiFocalDistance so I thought it would have worked.

melMass commented 6 years ago

Starting from this working example (Takumar 1969 50mm): image

Here is the full list of the models that do not work as expected in HTOA:

All the other ones work as expected

zpelgrims commented 6 years ago

Thanks for these tests man. Those are some funky renders, haha. Definitely very incorrect.

I'll get on this ASAP.

zpelgrims commented 6 years ago

If you consider Houdini units (m) as centimeters (scale up your scene * 100), it all works. Now just to figure out how to get around this issue.

melMass commented 6 years ago

@zpelgrims What do you mean ? All the other models work as expected, only the one from my previous post are having focal distance issues, scaling it by 100 does not work either :(

zpelgrims commented 6 years ago

@melMass

I've commited a fix for this problem and introduced a unit parameter. For htoa, just set it to meters. I'll upload a new release sometime today.