28.06.2014 Views

PDF slides

PDF slides

PDF slides

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

struct Integrator {<br />

template struct Result; // the result type<br />

template<br />

Color eval(Sample& sample, // image sample<br />

RayPacket& rayPacket, // initial ray packet<br />

Primitive& primitive, // top-level primitive<br />

Intersector& intersector, // top-level intersector<br />

Scene& scene);<br />

// shading scene data<br />

};<br />

struct Material {<br />

template<br />

void evaluate(Vec3f& w_o,<br />

Vec3f& w_i,<br />

ShadingData& sh,<br />

Vec3f& result);<br />

...<br />

};<br />

// packet size<br />

// BSDF parts to evaluate<br />

// outgoing direction<br />

// incoming direction<br />

// hit point, normal, etc.<br />

// returns computed radiance<br />

template<br />

// for materials, lights, and rays<br />

struct SurfaceShader {<br />

template<br />

// packet size<br />

void shade(const RayPacket& rayPacket, // the actual rays<br />

ShadingData& intersection, // ray intersection structure<br />

Context& context,<br />

// rendering context<br />

Vec3f& result);<br />

// returns computed radiance<br />

};

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!