New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement RealisticCamera #70

Closed
wahn opened this Issue Nov 21, 2018 · 6 comments

Comments

Projects
None yet
1 participant
@wahn
Copy link
Owner

wahn commented Nov 21, 2018

I asked on the PBRT mailing list (pbrt@googlegroups.com):

Are there any example .pbrt files for EnvironmentCamera and/or RealisticCamera? I couldn't find any example scenes using them ...

And Haarm-Pieter Duiker replied with:

https://github.com/hpd/PBRTForMaya/tree/master/maya/renderData

Finding the one example for the RealisticCamera:

> rg realistic
pbrt_feature_demo_camera_realistic.pbrt
29:Camera "realistic"

And the resulting image (rendered with the C++ version of PBRT):

pbrt_camera_realistic

Now, lets add the Rust code to render the same image ...

@wahn wahn self-assigned this Nov 21, 2018

@wahn wahn added the enhancement label Nov 21, 2018

@wahn

This comment has been minimized.

Copy link
Owner Author

wahn commented Nov 26, 2018

Matt Pharr answered to the mailing list:

In the pbrt-v3 scenes distribution (https://pbrt.org/scenes-v3.html),                                                                       
sanmiguel/f6-17.pbrt and f6-25.pbrt use the realistic camera.  There                                                                        
are a bunch of lens description files in lenses/ in the example scenes                                                                      
distribution as well.                                                                                                                       
                                                                                                                                            
(We should probably have a few more examples that use those!)                                                                               
@wahn

This comment has been minimized.

Copy link
Owner Author

wahn commented Nov 27, 2018

Before starting to work on RealisticCamera, let's see how a PerspectiveCamera camera looks like (rendered by the Rust version):

perspective

diff --git a/maya/renderData/pbrt_feature_demo_camera_realistic.pbrt b/maya/renderData/pbrt_feature_demo_camera_realistic.pbrt
index 8c22db6..b0b8ac1 100644
--- a/maya/renderData/pbrt_feature_demo_camera_realistic.pbrt
+++ b/maya/renderData/pbrt_feature_demo_camera_realistic.pbrt
@@ -26,11 +26,12 @@ Accelerator "bvh"
 # Camera begin
 Scale -1 1 1
 LookAt 0.000000 4.250000 -45.000000 -0.000000 -0.177129 -2.878684 -0.000000 0.994522 0.104528
-Camera "realistic"
-       "float aperturediameter" [1.0]
-       "float focusdistance" [10.0]
-       "bool simpleweighting" ["true"]
-       "string lensfile" ["../assets/pbrt-v3-scenes/lenses/dgauss.50mm.dat"]
+Camera "perspective"
+# Camera "realistic"
+#      "float aperturediameter" [1.0]
+#      "float focusdistance" [10.0]
+#      "bool simpleweighting" ["true"]
+#      "string lensfile" ["../assets/pbrt-v3-scenes/lenses/dgauss.50mm.dat"]
 # Camera end
 
 WorldBegin

wahn added a commit that referenced this issue Dec 3, 2018

@wahn

This comment has been minimized.

Copy link
Owner Author

wahn commented Dec 3, 2018

BTW the lens data file used in the example (dgauss.50mm.dat) looks like this:

# D-GAUSS F/2 22deg HFOV			
# US patent 2,673,491 Tronnier"			
# Moden Lens Design, p.312"			
# Scaled to 50 mm from 100 mm			
#    radius	 axpos	N	aperture
29.475	3.76	1.67	25.2
84.83	0.12	1	25.2
19.275	4.025	1.67	23
40.77	3.275	1.699	23
12.75	5.705	1	18
0	4.5	0	17.1
-14.495	1.18	1.603	17
40.77	6.065	1.658	20
-20.385	0.19	1	20
437.065	3.22	1.717	20
-39.73	0	1	20
@wahn

This comment has been minimized.

Copy link
Owner Author

wahn commented Dec 3, 2018

@wahn

This comment has been minimized.

Copy link
Owner Author

wahn commented Dec 10, 2018

Since commit cbb1d2d the Rust version seems to render fine using the RealisticCamera:

pbrt

@wahn wahn closed this Dec 11, 2018

@wahn

This comment has been minimized.

Copy link
Owner Author

wahn commented Dec 11, 2018

BTW they rings visible in the C++ version are fixed now:

mmp/pbrt-v3#162

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment