I am attempting to use a GUI to feed scenes into the PBRT engine, and
the output is a completely gray exr image. Stepping through the
program, I suspect it to be a result of some bad rays being generated
by the camera. I am using the following function to create a
perspective camera for rendering:
--- QPerspectiveCamera.cpp (line 82) -----
PBRT::Camera* QPerspectiveCamera::getPBRTCamera()
{
QSize FilmSize = m_Film->getResolution();
float Screen[4] = {0, 0, FilmSize.width(), FilmSize.height()};
PBRT::Transform WorldToCam = PBRT::LookAt(
PBRT::Point(m_Eye[X], m_Eye[Y], m_Eye[Z]),
PBRT::Point(m_Center[X], m_Center[Y], m_Center[Z]),
PBRT::Vector(m_Up[X], m_Up[Y], m_Up[Z]));
return new PBRT::PerspectiveCamera(
WorldToCam, Screen, m_Near, m_Far, 0.0f, 1.0f, 2.0f, 10.f,
m_FOV, m_Film->getPbrtFilm());
}
-----------------------------------------------------------
The rays generated by the camera do not seem to be within the view
frustum. For example a camera with Eye<0, 1, 0>, Lookat <0, 1, -1>,
Up <0,1,0>, and FOV 35deg is generating a ray of Origin <-0.8, 192.1,
-1> and Direction <0.0005, 1.0, -0.005>. Note the large Y value for
the origin. Is there an obvious mistake I am making that might be
causing this?
Besides putting in hooks for status output to the GUI, moving PBRT
into a separate namespace, some documentation for my benefit, and
fixing the Lookat function to generate Up and Right instead of down
and left vectors (although I was getting bad camera rays before making
that change as well), I have not made many changes to the PBRT source
tree.
FYI, my current full source tree with the VS2008 Project is at
https://sourceforge.net/projects/phyzray/
Thanks for any assistance!