2011-08-23 09:03:58 +08:00
|
|
|
\newpage
|
|
|
|
\subsection{Shapes}
|
|
|
|
\label{sec:shapes}
|
|
|
|
This section presents an overview of the shape plugins that are released along with the renderer.
|
|
|
|
|
|
|
|
In Mitsuba, shapes define surfaces that mark transitions between different types of materials. For instance,
|
|
|
|
a shape could describe a boundary between air and a solid object, such as a piece of rock. Alternatively,
|
2012-10-25 02:44:26 +08:00
|
|
|
a shape can mark the beginning of a region of space that isn't solid at all, but rather contains a participating
|
2011-08-23 09:03:58 +08:00
|
|
|
medium, such as smoke or steam. Finally, a shape can be used to create an object that emits light on its own.
|
|
|
|
|
2012-10-25 02:44:26 +08:00
|
|
|
Shapes are usually declared along with a surface scattering model (named ``BSDF'', see \secref{bsdfs} for details).
|
|
|
|
This BSDF characterizes what happens \emph{at the surface}. In the XML scene description language, this might look like
|
2011-08-23 09:03:58 +08:00
|
|
|
the following:
|
|
|
|
\begin{xml}
|
|
|
|
<scene version=$\MtsVer$>
|
2014-02-06 22:11:30 +08:00
|
|
|
<shape type="... shape type ...">
|
|
|
|
... $\code{shape}$ parameters ...
|
2011-08-23 09:03:58 +08:00
|
|
|
|
2014-02-06 22:11:30 +08:00
|
|
|
<bsdf type="... bsdf type ...">
|
|
|
|
... $\code{bsdf}$ parameters ..
|
|
|
|
</bsdf>
|
2011-08-23 09:03:58 +08:00
|
|
|
|
2014-02-06 22:11:30 +08:00
|
|
|
<!-- Alternatively: reference a named BSDF that
|
|
|
|
has been declared previously
|
2011-08-23 09:03:58 +08:00
|
|
|
|
|
|
|
<ref id="myBSDF"/>
|
2014-02-06 22:11:30 +08:00
|
|
|
-->
|
|
|
|
</shape>
|
2011-08-23 09:03:58 +08:00
|
|
|
</scene>
|
|
|
|
\end{xml}
|
|
|
|
|
|
|
|
When a shape marks the transition to a participating medium (e.g. smoke, fog, ..), it is furthermore
|
|
|
|
necessary to provide information about the two media that lie at the \emph{interior} and \emph{exterior}
|
|
|
|
of the shape. This informs the renderer about what happens in the region of space \emph{surrounding the surface}.
|
|
|
|
|
|
|
|
\begin{xml}
|
|
|
|
<scene version=$\MtsVer$>
|
2014-02-06 22:11:30 +08:00
|
|
|
<shape type="... shape type ...">
|
|
|
|
... $\code{shape}$ parameters ...
|
2011-08-23 09:03:58 +08:00
|
|
|
|
2014-02-06 22:11:30 +08:00
|
|
|
<medium name="interior" type="... medium type ...">
|
|
|
|
... $\code{medium}$ parameters ...
|
|
|
|
</medium>
|
2012-10-25 02:44:26 +08:00
|
|
|
|
2014-02-06 22:11:30 +08:00
|
|
|
<medium name="exterior" type="... medium type ...">
|
|
|
|
... $\code{medium}$ parameters ...
|
|
|
|
</medium>
|
2011-08-23 09:03:58 +08:00
|
|
|
|
2014-02-06 22:11:30 +08:00
|
|
|
<!-- Alternatively: reference named media that
|
|
|
|
have been declared previously
|
2011-08-23 09:03:58 +08:00
|
|
|
|
|
|
|
<ref name="interior" id="myMedium1"/>
|
|
|
|
<ref name="exterior" id="myMedium2"/>
|
2014-02-06 22:11:30 +08:00
|
|
|
-->
|
|
|
|
</shape>
|
2011-08-23 09:03:58 +08:00
|
|
|
</scene>
|
|
|
|
\end{xml}
|
|
|
|
|
|
|
|
You may have noticed that the previous XML example dit not make any mention of surface
|
|
|
|
scattering models (BSDFs). In Mitsuba, such a shape declaration creates an \emph{index-matched} boundary.
|
2012-10-25 02:44:26 +08:00
|
|
|
This means that incident illumination will pass through the surface without undergoing any kind of
|
|
|
|
interaction. However, the renderer will still uses the information available in the shape to correctly
|
2011-08-23 09:03:58 +08:00
|
|
|
account for the medium change.
|
|
|
|
|
|
|
|
It is also possible to create \emph{index-mismatched} boundaries between media, where some of
|
|
|
|
the light is affected by the boundary transition:
|
|
|
|
\begin{xml}
|
|
|
|
<scene version=$\MtsVer$>
|
2014-02-06 22:11:30 +08:00
|
|
|
<shape type="... shape type ...">
|
|
|
|
... $\code{shape}$ parameters ...
|
2011-08-23 09:03:58 +08:00
|
|
|
|
2014-02-06 22:11:30 +08:00
|
|
|
<bsdf type="... bsdf type ...">
|
|
|
|
... $\code{bsdf}$ parameters ..
|
|
|
|
</bsdf>
|
2011-08-23 09:03:58 +08:00
|
|
|
|
2014-02-06 22:11:30 +08:00
|
|
|
<medium name="interior" type="... medium type ...">
|
|
|
|
... $\code{medium}$ parameters ...
|
|
|
|
</medium>
|
2012-10-25 02:44:26 +08:00
|
|
|
|
2014-02-06 22:11:30 +08:00
|
|
|
<medium name="exterior" type="... medium type ...">
|
|
|
|
... $\code{medium}$ parameters ...
|
|
|
|
</medium>
|
2011-08-23 09:03:58 +08:00
|
|
|
|
2014-02-06 22:11:30 +08:00
|
|
|
<!-- Alternatively: reference named media and BSDF
|
|
|
|
instances that have been declared previously
|
2011-08-23 09:03:58 +08:00
|
|
|
|
|
|
|
<ref id="myBSDF"/>
|
|
|
|
<ref name="interior" id="myMedium1"/>
|
|
|
|
<ref name="exterior" id="myMedium2"/>
|
2014-02-06 22:11:30 +08:00
|
|
|
-->
|
|
|
|
</shape>
|
2011-08-23 09:03:58 +08:00
|
|
|
</scene>
|
|
|
|
\end{xml}
|
2012-09-28 00:43:51 +08:00
|
|
|
This constitutes the standard ways in which a shape can be declared.
|
|
|
|
The following subsections discuss the available types in greater detail.
|