Giter Site home page Giter Site logo

ryushinn / mitsuba-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yongsen/mitsuba

0.0 0.0 0.0 237.63 MB

Homework of CSCI780: implementing BRDF models using mitsuba

Home Page: http://yongsen.github.io/mitsuba/

Shell 0.05% C++ 63.98% Python 0.63% C 1.43% Objective-C 1.80% PowerShell 0.01% XSLT 0.14% CSS 0.01% Objective-C++ 0.17% Makefile 28.26% CMake 3.38% GLSL 0.15% Batchfile 0.01%

mitsuba-1's Introduction

CSCI780 Advanced Topics: Computer Graphics

Homework 2

Name: Yongsen Ma, Email: [email protected]

References

This homework implements the Smooth Surface and Microfacet BRDF models in the paper by [Löw et al] using the mitsuba render system.

  1. Mitsuba. Physically Based Renderer. mitsuba-renderer.org
  2. Joakim Löw, Joel Kronander, Anders Ynnerman, and Jonas Unger. 2012. BRDF models for accurate and efficient rendering of glossy surfaces. ACM Trans. Graph. 31, 1, Article 9 (February 2012), 14 pages. DOI=http://dx.doi.org/10.1145/2077341.2077350

Folder Structure Summary

Some folders and files are not listed.

mitsuba
|	README.md
|	CMakeList.txt
|	smoothsurface.cpp
|	microfacet.cpp
|	...
|---scenes
	|	grace.exr
	|	sphere_mf_chrome.xml
	|	sphere_ss_chrome.xml
	|	...
	|---merlmit

Add new BRDF models (based on the assignment description)

  1. Copy or write the new BRDF model in the root folder, e.g., smoothsurface.cpp.
  2. Add the new BRDF model to CMakeList.txt, e.g., adding the following two lines to CMakeList.txt.
# add a new BRDF model
add_bsdf(smoothsurface smoothsurface.cpp)
  1. Run cmake . and make in the root folder to compile the new BRDF model.

Run the new BRDF model

  1. Change BRDF parameters by modifying the *.xml file in the ~/scenes folder.
  • Change the BRDF model and type of the xml file. For example,
  <bsdf type="smoothsurvace" id="alum-bronze-smooth-surface">
  ...
  </bsdf>
  <shape type="sphere">
  <float name="radius" value="1"/>
  <ref id="alum-bronze-smooth-surface"/>
  </shape>
  • Set the BRDF parameters. Low et al
    • m_difusseReflectance: diffuse factor, RGB values.
    • m_A: A for the S function, RGB values.
    • m_B: B for the S function, float value.
    • m_C: C for the S function, float value.
    • m_F0: Fresnel factor, float value.
  1. Change other settings if necessary. For example, change the angle of the view direction to -225.
-<transform name="toWorld">
<rotate y="1" angle="-225"/>
</transform>
  1. Run the code in the root folder
./binaries/mitsuba ./scenes/sphere_XX_YYY.xml

XX represnets mf (Microfacet) or sf (Smooth Surface), and YYY is the name of the material, e.g., chrome or alum_bronze. The result of sphere_XX_YYY.exr will be in the folder ./scenes after about 30 seconds or 1 minute.

mitsuba-1's People

Contributors

yongsen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.