<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\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,
a shape can mark the beginning of a region of space that isn't solid at all, but rather contains a participating
medium, such as smoke or steam. Finally, a shape can be used to create an object that emits light on its own.

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
the following:
\begin{xml}
&lt;scene version=$\MtsVer$&gt;
	&lt;shape type="... shape type ..."&gt;
	    ... $\code{shape}$ parameters ...

	    &lt;bsdf type="... bsdf type ..."&gt;
		    ... $\code{bsdf}$ parameters ..
		&lt;/bsdf&gt;

		&lt;!-- Alternatively: reference a named BSDF that
		     has been declared previously

             &lt;ref id="myBSDF"/&gt;
		--&gt;
	&lt;/shape&gt;
&lt;/scene&gt;
\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}
&lt;scene version=$\MtsVer$&gt;
	&lt;shape type="... shape type ..."&gt;
	    ... $\code{shape}$ parameters ...

		&lt;medium name="interior" type="... medium type ..."&gt;
		    ... $\code{medium}$ parameters ...
		&lt;/medium&gt;

		&lt;medium name="exterior" type="... medium type ..."&gt;
		    ... $\code{medium}$ parameters ...
		&lt;/medium&gt;

		&lt;!-- Alternatively: reference named media that
		     have been declared previously

             &lt;ref name="interior" id="myMedium1"/&gt;
             &lt;ref name="exterior" id="myMedium2"/&gt;
		--&gt;
	&lt;/shape&gt;
&lt;/scene&gt;
\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.
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
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}
&lt;scene version=$\MtsVer$&gt;
	&lt;shape type="... shape type ..."&gt;
	    ... $\code{shape}$ parameters ...

	    &lt;bsdf type="... bsdf type ..."&gt;
		    ... $\code{bsdf}$ parameters ..
		&lt;/bsdf&gt;

		&lt;medium name="interior" type="... medium type ..."&gt;
		    ... $\code{medium}$ parameters ...
		&lt;/medium&gt;

		&lt;medium name="exterior" type="... medium type ..."&gt;
		    ... $\code{medium}$ parameters ...
		&lt;/medium&gt;

		&lt;!-- Alternatively: reference named media and BSDF
		     instances that have been declared previously

             &lt;ref id="myBSDF"/&gt;
             &lt;ref name="interior" id="myMedium1"/&gt;
             &lt;ref name="exterior" id="myMedium2"/&gt;
		--&gt;
	&lt;/shape&gt;
&lt;/scene&gt;
\end{xml}
This constitutes the standard ways in which a shape can be declared.
The following subsections discuss the available types in greater detail.
</pre></body></html>