This project implements and builds upon the method described in the paper Poisson-Based Continuous Surface Generation for Goal-Based Caustics.
With the code in this repository you can calculate the shape of a transparent window that casts an image if light passes through.
It does that by modulating the angle of the surface across the entire surface to steer the light in the desired directions.
A more detailed explanation is that it first calculates from where on the lens surface to where on the screen the light should go. It then calculates the the shape of the lens such that it satisfies all these directions.
Result simulated with Blender using LuxRender:
- Implementation of the Poisson-based continuous surface generation algorithm by Yue et al.
- exports a solidified .obj
- the only non-standard C++ dependancy is libpng
- can export the the inverse transport map (can be used for for density sampling)
- multithreaded poisson solver
- C++ compiler with C++17 support for your platform
- libpng (requires zlib)
-
Clone the repository:
git clone [email protected]:dylanmsu/caustic_engineering.git
-
Navigate to the project directory:
cd caustic_engineering
-
Compile the source code:
# create build directory mkdir build && cd build # generate build files cmake .. # build make
-
Run the code:
./CausticEngineering [parameters]
-
Clone the repository:
git clone [email protected]:dylanmsu/caustic_engineering.git
-
Navigate to the project directory:
cd caustic_engineering
-
Compile the source code:
# create build directory mkdir build && cd build # generate build files (assumes C:/mingw64 to be the mingw64 path) & "C:/mingw64/bin/cmake.exe" -G "MinGW Makefiles" .. # build & "C:/mingw64/bin/mingw32-make.exe"
-
Run the code:
./CausticEngineering.exe [parameters]
-
Parameters:
-
--input_png=[image path] # input image path (REQUIRED)
-
--progress_out=[output svg path] # path to put the transport solver progress in svg
-
--output=[output] # path to put the final 3d model of the lens
-
--res_w=[grid resolution] # mesh resolution in the x-axis
-
--mesh_width=[mesh width] # physical width of the mesh
-
--focal_l=[focal length] # focal length
-
--thickness=[lens thickness] # thickness of the final caustic lens
-
--conv_tres=[convergence treshold] # higher number = faster but lower contrast image
-
--threads=[max number of threads] # sets the maximum cpu threads for the poisson solver
-
-
Execute the program:
./CausticEngineering.exe --input_png=../img/siggraph.png --progress_out=../ --output=../ --res_w=100 --mesh_width=0.5 --focal_l=1.5 --thickness=0.1 --conv_tres=0.01 --threads=16
input_image | parameterization | inverted parameterization | 3d_model | simulation | |
---|---|---|---|---|---|
Lena (Mesh: 256 x 256) | ![]() |
![]() |
![]() |
||
Siggraph logo (Mesh: 200 x 200) | ![]() |
![]() |
![]() |
||
Hello World (Mesh: 256 x 128) | ![]() |
![]() |
![]() |
transport from an image to an almost uniform distribution:
Shadow of the machined prototype:
- least squares solver for the heightmap -> this will allow more freedom in the lens design
- reflective caustics -> is currently not that usefull because of the limited freedom in the height solver
- circular caustic lenses
- use the fast transport map algoritm from the paper: [https://gnader.github.io/publications/2018-ot-transport.html](Instant Transport Maps on 2D Grids)
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature
) - Make your changes
- Commit your changes (
git commit -am 'Add new feature'
) - Push to the branch (
git push origin feature
) - Create a new Pull Request
This project uses the MIT License.
Thank you to Yue et al for their awesome research paper.
I would also like to thank Matt Ferraro for providing their informative article about the paper.