Profile Picture

How is DOF specified in Iray

Posted By animagic 6 Years Ago
You don't have permission to rate!
Author
Message
animagic
animagic
Posted 6 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)

Group: Forum Members
Last Active: 49 minutes ago
Posts: 15.7K, Visits: 30.5K
I recreated a scene from iClone in CC, with some gravestones in the foreground and few church buildings in the background. (It sounds like it, but I'm NOT preparing for Halloween.)

The image I wanted to render had some light (faraway) DOF in CC, but I noticed that the effect was much stronger in Iray, blurring out the church buildings in the background.

I remember with Indigo there was also a disconnect, which could be adjusted in the UI, but there is no such setting for Iray. The field of view itself seems to be accurate enough.


https://forum.reallusion.com/uploads/images/436b0ffd-1242-44d6-a876-d631.jpg

justaviking
justaviking
Posted 6 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)

Group: Forum Members
Last Active: Last Week
Posts: 8.2K, Visits: 26.5K
SHORT ANSWER...  I think Reallusion will need to copy all the "Camera definition" controls from iClone to CC3.

Hopefully the applications share a lot of common code, and it is close to a plug-and-play capability to add it to CC3.


LONGER ANSWER...

I remember we struggled a lot with matching iClone cameras to Indigo cameras when that plug-in was first released, but eventually Reallusion got it all figured out.  Indigo also had a front-end user interface where you could define things like focal distance and stuff like that.  But the Iray renderer does not have a user interface like that.  Editing the .mi file for things like camera definitions would be a very technical challenge.

I hope (assume?) that the iClone plug-in for Iray will honor iClone's camera settings, including DOF



EVEN LONGER ANSWER:

The bold person can do a "Save MI Scene" and attempt to edit the camera definition in the .mi file.
Good luck.

1) mip_lens_focus appears to be the distance from the camera to the point of perfect focus
2) mip_lens_radius appears to control the "blur"... ZERO is infinite focus,  a value of 1 seems to blur most everything, so start small

camera "Scene_camera_definition"
 attribute scalar "mip_lens_focus" 1.800
 attribute scalar "mip_lens_radius" 0.010

 attribute scalar "mip_lens_radial_bias" 0.600000024
 attribute boolean "mip_burn_highlights_per_component" false
 attribute boolean "mip_use_camera_near_plane" true
 attribute boolean "iray_internal_tonemapper" true
 focal 49.999996185302734
 aperture 36
 aspect 1.7777777910232544
 resolution 1280 720
 offset 0 0
 window 0 0 -1 -1
 clip 0.10000000149011612 999.989990234375
 frame 0 0
 attribute string "tm_tonemapper" "mia_exposure_photographic"
 attribute color "mip_whitepoint" 1 1 1 1
 attribute scalar "mip_film_iso" 100
 attribute scalar "mip_camera_shutter" 128
 attribute scalar "mip_f_number" 8
 attribute scalar "mip_vignetting" 0
 attribute scalar "mip_burn_highlights" 0.300000012
 attribute scalar "mip_crush_blacks" 0.200000003
 attribute scalar "mip_saturation" 1
 attribute scalar "mip_gamma" 2.20000005
 backplate_background_color 436.27832 436.27832 436.27832 1
 backplate_tonemapping on
 output "jpg"   "default.jpg"
end camera





iClone 7... Character Creator... Substance Designer/Painter... Blender... Audacity...
Desktop (homebuilt) - Windows 10, Ryzen 9 3900x CPU, GTX 1080 GPU (8GB), 32GB RAM, Asus X570 Pro motherboard, 2TB SSD, terabytes of disk space, dual  monitors.
Laptop - Windows 10, MSI GS63VR STEALTH-252, 16GB RAM, GTX 1060 (6GB), 256GB SSD and 1TB HDD

Edited
6 Years Ago by justaviking
justaviking
justaviking
Posted 6 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)

Group: Forum Members
Last Active: Last Week
Posts: 8.2K, Visits: 26.5K
Ignore this post.
You can also ignore most of my previous post.

I was reading and posting way after my bedtime last night.  I should know better by now.

Since you cannot "Create Camera" in CC3 like you can in iClone, I was thinking the camera settings were also missing.  But Wires' post reminded me that camera settings, including Depth of Field, are available in CC3, and do affect your Iray renders.  Blush




iClone 7... Character Creator... Substance Designer/Painter... Blender... Audacity...
Desktop (homebuilt) - Windows 10, Ryzen 9 3900x CPU, GTX 1080 GPU (8GB), 32GB RAM, Asus X570 Pro motherboard, 2TB SSD, terabytes of disk space, dual  monitors.
Laptop - Windows 10, MSI GS63VR STEALTH-252, 16GB RAM, GTX 1060 (6GB), 256GB SSD and 1TB HDD

Edited
6 Years Ago by justaviking
wires
wires
Posted 6 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (15.0K reputation)Distinguished Member (15.0K reputation)Distinguished Member (15.0K reputation)Distinguished Member (15.0K reputation)Distinguished Member (15.0K reputation)Distinguished Member (15.0K reputation)Distinguished Member (15.0K reputation)Distinguished Member (15.0K reputation)Distinguished Member (15.0K reputation)

Group: Forum Members
Last Active: 2 days ago
Posts: 5.7K, Visits: 26.4K
There are very clear differences between a render directly out of CC with DOF and the same scene rendered using the Iray plugin.

Screen shot:
https://forum.reallusion.com/uploads/images/e25b0e14-c6ed-4276-b701-f844.png


CC render:
https://forum.reallusion.com/uploads/images/c51fa751-a0c7-4e11-a091-5432.png

Iray render:
https://forum.reallusion.com/uploads/images/b7be3195-8161-4d73-837a-e648.png

Comparing the CC camera settings with the Iray .mi settings shows quite a lot of similarities: 
https://forum.reallusion.com/uploads/images/567ee5f3-0467-4059-85f2-9a2e.png

Lens Focus and Focus Distance both show about the same, Focal length are the same in both.

Now to find out where the other settings are stored in the .mi file.

To be continued. BlinkErmm


Gerry



System: Win 10 Pro (21H2), Asus X99-E WS, CPU i7-5930K -3,5 GHz, 32 GB DDR4 2666-16 RAM, NVidia GTX 1080 Ti GPU - 11 GB VRAM(Driver Studio-536.99), Samsung 850 Pro 512 GB SSD, 6 TB HD storage.


justaviking
justaviking
Posted 6 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)Distinguished Member (20.4K reputation)

Group: Forum Members
Last Active: Last Week
Posts: 8.2K, Visits: 26.5K
Great screenshots, Gerry.

There sure is a "banding" artifact in the CC3 render.  If not a bug, it certainly looks like "room for improvement" to me.
https://forum.reallusion.com/uploads/images/f7613bd5-01f6-455a-9bd3-02d7.jpg
I'm not a photography expert, but I'm assuming the Iray render is "more correct" in this case.



iClone 7... Character Creator... Substance Designer/Painter... Blender... Audacity...
Desktop (homebuilt) - Windows 10, Ryzen 9 3900x CPU, GTX 1080 GPU (8GB), 32GB RAM, Asus X570 Pro motherboard, 2TB SSD, terabytes of disk space, dual  monitors.
Laptop - Windows 10, MSI GS63VR STEALTH-252, 16GB RAM, GTX 1060 (6GB), 256GB SSD and 1TB HDD

Edited
6 Years Ago by justaviking
animagic
animagic
Posted 6 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)

Group: Forum Members
Last Active: 49 minutes ago
Posts: 15.7K, Visits: 30.5K
Thanks guys, for the research. Time to dive into the code...Unsure

Or perhaps it's better to enter it in FT and let RL figure it out. 


https://forum.reallusion.com/uploads/images/436b0ffd-1242-44d6-a876-d631.jpg

animagic
animagic
Posted 6 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)

Group: Forum Members
Last Active: 49 minutes ago
Posts: 15.7K, Visits: 30.5K
There is now an Iray online manual: http://manual.reallusion.com/Iray_Render_Plug_in/ENU/1/default.htm .

It explains, among others, differences in DOF to be expected (not how to resolve it though...).


https://forum.reallusion.com/uploads/images/436b0ffd-1242-44d6-a876-d631.jpg

illusionLAB
illusionLAB
Posted 6 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 393, Visits: 4.8K
The DOF function in iClone/CC is not optically correct, or even consistent (recall the different results with various screen sizes while rendering) - case in point, they offer a "near focus blur" setting separate from the 'far focus blur" (not possible with a real lens)... with that in mind, set up a scene with "focus targets" at different depths and find the setting in CC3 that yields the result you want with IRay.  If you do this a few times, you'll probably see a pattern emerge and may be able to come up with a basic formula like:   CC3 focus depth divided by 1.333 will yield a similar result with Iray (of course it'll probably be more complex than that... like logarithmic scale).
illusionLAB
illusionLAB
Posted 6 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 393, Visits: 4.8K
Test exporting iC settings to Indigo... result is nothing like expected.  As Indigo and Iray are raytrace renderers, there is really only ONE setting for DOF (ie. real world) - which is aperture.  iClone's "simulation" is basically a cheat, so 'real world' values do not apply... setting the "in focus" range is like aperture (not really as real lens focus 'range' is not centered on the "in focus" object), but then they give you a "near" and "far" blur settings... a way to simulate the fact that near objects are always more defocused than far.  In short, the fact that there are 'several' parameters for DOF in iClone that you can adjust 'to taste' means it's virtually impossible to send that info to a renderer that calculates DOF based on 'real world' physics (with only one parameter).


https://forum.reallusion.com/uploads/images/a387cbe8-2faf-4723-9951-2da3.png
animagic
animagic
Posted 6 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)Distinguished Member (32.5K reputation)

Group: Forum Members
Last Active: 49 minutes ago
Posts: 15.7K, Visits: 30.5K
I started playing with parameters in the .mi scene file directly, because there was absolutely no rhyme or reason in how iClone CC made the conversion. I could set the far setting in iClone CC to 99999 and I still ended up with about the same amount of DOF in Iray.

That said, the Iray implementation is also kind of weird. I'm not a photographer, but I seem to remember that the F-stop setting influences DOF for a real lens. 

Iray has an F-stop setting, but it is part of the mapping. It influences the amount of exposure (dark/light of the image), but not the DOF.

What I found (and Viking also communicated to me in an email and mentioned in a post above) is that the mip_lens_radius parameter influences DOF. It is 0 for no DOF and by increasing it, you get increasing amounts of DOF.

Unfortunately, editing a .mi file is not a solution in the long run, so more should be exposed in the UI. There is also the issue of anti-aliasing, which requires another setting to be changed as 4u2ges has pointed out.

EDIT: It's CC, not iClone...Blush


https://forum.reallusion.com/uploads/images/436b0ffd-1242-44d6-a876-d631.jpg

Edited
6 Years Ago by animagic



Reading This Topic