PDF slides
PDF slides
PDF slides
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
template<br />
class RayTracingRenderer : public Renderer {<br />
PixelSampler m_sampler;<br />
Integrator m_integrator;<br />
public:<br />
template<br />
void render(<br />
Scene& scene, Camera& camera,<br />
Framebuffer& framebuffer, ImageClipRegion& clip,<br />
Primitive& primitive, Intersector& intersector)<br />
{<br />
PixelSampler::Sample sample;<br />
PixelSampler::Iterator it =<br />
m_sampler.getIterator(clip);<br />
while(it.getNextSample(sample))<br />
{<br />
RayPacket rays = camera.genRay(sample);<br />
Integrator::Color color = m_integrator.eval(<br />
sample, rays, primitive, intersector, scene);<br />
m_sampler.writeColor(sample, color, framebuffer);<br />
}<br />
}<br />
/* omitted: preprocess() function for pre-integration*/<br />
};