Compile and use PBRT on Ubuntu

來源:互聯網
上載者:User

    If you want to experiment with Physically Based Rendering, PBRT is the tool to use. Unfortunately, the latest builds have some incomplete instructions on how to build PBRT on your own machine.This article will show you how to compile and use PBRT on Ubuntu(
Version12.10 ).

          First,you should install some packages that would use in the process of compiling.Copy/paste the next line to install
them:

          

sudo apt-get install build-essential openexr openexr-viewers libopenexr-dev libilmbase-dev libfl-dev

         Second,download the zip file from pbrt-v2-src.tar.bz2, for Linux and OSX (12MB) ,then extract the file to some place (For example :~/pbrt)

        Third,go into the src folder(For example : cd ~/pbrt/pbrt-v2/src) from terminal ,then run  make  in the src directory.If
there is no error happened,that means you have complete the compile.

       Fourth,add the PBRT to environment viarable. Run the next line in terminal:

      

sudo gedit /etc/profile

       then add the path at the end 

export PATH="$PATH:/home/{the account you use }/pbrt/pbrt-v2/src/bin"

       save the change,and you should restart your computer to make the change effective.

         To see if the path had been added successfully ,run in terminal:

       

    echo $PATH

        if there have the path you have added ,that means you have done

       The next is to test what you have done above.Run in terminal:

cd ~/pbrt/pbrt-v2/scenes
pbrt  bunny.pbrt

      this is rendering the bunny .If you have no error hanppened,that you can see a file named pbrt.exr in the folder .This is what you rendered.To see the result,run in terminal:

exrdisplay  pbrt.exr

Ha ,you will see the result 

     

       

       

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.