mmp / pbrt-v4

Source code to pbrt, the ray tracer described in the forthcoming 4th edition of the "Physically Based Rendering: From Theory to Implementation" book.
https://pbrt.org
Apache License 2.0
2.75k stars 407 forks source link

Aspherical elements in camera #382

Closed panwangjun closed 10 months ago

panwangjun commented 10 months ago

How to add aspherical lens in camera?

pbrt4bounty commented 10 months ago

Hi.. you meant add spherical lens or directly use a Spherical camera?? imagen imagen

Example scene.. Spherical_Camera.zip

pbrt4bounty commented 10 months ago

To add lens, you can create a 'Realistic' camera type and add a predefined lenses file, as is explained in the guide: https://pbrt.org/fileformat-v4

Camera "realistic"
    "float shutterclose" [ 1.0 ]
    "float shutteropen" [ 0.0 ]
    "string lensfile" "fisheye.10mm.dat"
    "float aperturediameter" [ 3.0 ]
    "float focusdistance" [ 1.0 ]
    "string aperture" "gaussian"

imagen

mmp commented 10 months ago

For aspherical lens elements, you would need to:

In general, you should thoroughly understand the current RealisticCamera implementation, at which point hopefully it will be evident what needs to be done.