Search This Blog

Wednesday, February 8, 2012

Luxrender compile with VS2010

This documented is a guide to make development environment for Luxrender with VS2010. Because the guide to compile Luxrender in is based on VS2008, you may want to following instructions to compile it with the latest version of Visual Studio.

Note. This guide was tested with Luxrender x64, Windows 7 x64, and VS2010.

1. Check out sources from the repository

- You need a Mercurial client for this job

- Make an empty directory for the BASE
- Clone 3 sources into your BASE

- source: destination: BASE/lux
- source: destination: BASE/windows
- source: destination: BASE/luxrays

2. Start the Visual Studio Command prompt

- You need to run x64 Win64 command prompt for x64 platform, otherwise you can run 32bit command prompt.

3. Goto BASE/windows

4. Run the appropriate build batch file

- Run getdeps.bat
- If you don't want to install OpenCL SDK, choose N3, N4 or A when you need to choose so that you don't have to download.
- Run build-vars.reg to register environmental variables
- Log out and log in for the changes to take effect

- Replace msvc-9.0 with msvc-10.0 in build-deps-*.bat
- Run build-deps-x64.bat
- It will make some errors while building FreeImage and LuxRays, since they are designed for VS2008.

5. Compile FreeImage

- Go to BASE\deps\x64\FreeImage3141\FreeImage and open FreeImage.2008.sln
- Convert the solution to VS2010
- Change run-time libraries to /MD for FreeImageLib, LibJPEG, LibMNG, LibOpenJPEG, LibPNG, LibRaw, LibTIFF, OpenEXR and ZLib
- Build Solution for Win64 Release

6. Compile Luxrender

- Go to BASE\windows

- Convert the solution to VS2010
- Build liblux for Win64 ReleaseNoOpenCL

- Build liblux

- You may want to change flex_on_path.bat and bison_on_path, since you may want to use flex and bison for Lux here.

- Add FreeImage.lib to Additional Dependencies


- Add ..\..\..\deps\x64\boost_1_43_0\stage\boost\lib to Additional library directories


- Build luxrender

Wednesday, February 1, 2012

Depth of Field

The depth of field (DOF) is the range between the nearest and farthest objects in a scene that appears acceptably sharp in a picture. A large DOF makes the entire image sharp, while a small DOF makes subjects clear but blurred out the foreground and the background.

In assignment #1, you need to make a shallow depth of field. Luxrender provides the perspective camera that can control the DOF by configuring lens radius. Increasing the lens radius will make a shallow depth of field, since small aperture does not disperse the ray that is penetrating the lens like large aperture. In Blender, you can control the lens size with f-stop. Smaller f-stop is larger lens radius.

In order to focus an object in a scene, you may want to configure focal distance. Focal distance is the distance between the camera and the subject that you want to see clearly in an image.

In addition, decreasing the distance between the focused object and camera will help to get a shallow DOF. You can find out DOF formulas in the article of Jeff Conrad or Wikipedia. From this formula, you can see that the DOF is decided according to the focal length and f-number of the lens, and the camera-to-subject distance. In addition, the DOF is inversely proportional to the camera-to-subject distance. So, it will be useful to make it close-up.

When moving camera close to the subject, you would miss some objects in your image. In this case, you can  put every object you want to include in the image by increasing Field of View.

Scaling down the scene will be helpful see the shallow depth of field also. When the model shrinks, the camera-to-subject distance will decrease also.

Blog Archive