diff --git a/doc/format.tex b/doc/format.tex index 0680da42..d837adde 100644 --- a/doc/format.tex +++ b/doc/format.tex @@ -292,7 +292,7 @@ and \emph{animated transformations} as parameters. The latter is useful to render scenes involving motion blur. The syntax used to specify these is slightly different: \begin{xml} - + .. chained list of transformations as discussed above .. @@ -302,7 +302,7 @@ is slightly different: .. additional transformations (optional) .. - + \end{xml} Mitsuba then decomposes each transformation into a scale, translation, and rotation component and interpolates\footnote{Using linear interpolation diff --git a/doc/images/shape_instance_fractal_bot.jpg b/doc/images/shape_instance_fractal_bot.jpg new file mode 100644 index 00000000..c136c9a7 Binary files /dev/null and b/doc/images/shape_instance_fractal_bot.jpg differ diff --git a/doc/images/shape_instance_fractal_top.jpg b/doc/images/shape_instance_fractal_top.jpg new file mode 100644 index 00000000..e827827c Binary files /dev/null and b/doc/images/shape_instance_fractal_top.jpg differ diff --git a/doc/macros.sty b/doc/macros.sty index 854c02ed..6eae9806 100644 --- a/doc/macros.sty +++ b/doc/macros.sty @@ -31,7 +31,7 @@ \newcommand{\order}[1]{} % Ignore \newcommand{\Transform}{\texttt{transform}} -\newcommand{\ATransform}{\texttt{atransform}} +\newcommand{\Animation}{\texttt{animation}} \newcommand{\Spectrum}{\texttt{spectrum}} \newcommand{\Integer}{\texttt{integer}} \newcommand{\String}{\texttt{string}} diff --git a/doc/main.tex b/doc/main.tex index 40d29280..f4b3c7a0 100644 --- a/doc/main.tex +++ b/doc/main.tex @@ -116,7 +116,7 @@ medium,film,sampler,integrator,emitter,sensor, translate,rotate,scale,lookat,point,vector,matrix, include,fscat,volume,alias,rfilter,boolean, - subsurface,atransform + subsurface,animation }, } diff --git a/include/mitsuba/render/scenehandler.h b/include/mitsuba/render/scenehandler.h index 2959a6b3..268967f8 100644 --- a/include/mitsuba/render/scenehandler.h +++ b/include/mitsuba/render/scenehandler.h @@ -158,7 +158,7 @@ private: EBoolean, EString, ETranslate, ERotate, ELookAt, EScale, EMatrix, EPoint, EVector, ERGB, ESRGB, EBlackBody, - ESpectrum, ETransform, EATransform, + ESpectrum, ETransform, EAnimation, EInclude, EAlias }; diff --git a/src/emitters/collimated.cpp b/src/emitters/collimated.cpp index da278a2f..3f5f4550 100644 --- a/src/emitters/collimated.cpp +++ b/src/emitters/collimated.cpp @@ -26,7 +26,7 @@ MTS_NAMESPACE_BEGIN * \icon{emitter_collimated} * \order{5} * \parameters{ - * \parameter{toWorld}{\Transform\Or\ATransform}{ + * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies an optional emitter-to-world transformation. * \default{none (i.e. emitter space $=$ world space)} * } diff --git a/src/emitters/directional.cpp b/src/emitters/directional.cpp index 834857e0..25ea9bbb 100644 --- a/src/emitters/directional.cpp +++ b/src/emitters/directional.cpp @@ -25,7 +25,7 @@ MTS_NAMESPACE_BEGIN * \icon{emitter_directional} * \order{4} * \parameters{ - * \parameter{toWorld}{\Transform\Or\ATransform}{ + * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies an optional emitter-to-world transformation. * \default{none (i.e. emitter space $=$ world space)} * } diff --git a/src/emitters/point.cpp b/src/emitters/point.cpp index 098b41d0..e2b2c3a6 100644 --- a/src/emitters/point.cpp +++ b/src/emitters/point.cpp @@ -28,7 +28,7 @@ MTS_NAMESPACE_BEGIN * \icon{emitter_point} * \order{1} * \parameters{ - * \parameter{toWorld}{\Transform\Or\ATransform}{ + * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies an optional sensor-to-world transformation. * \default{none (i.e. sensor space $=$ world space)} * } diff --git a/src/emitters/sky.cpp b/src/emitters/sky.cpp index 2daf4284..4b15f110 100644 --- a/src/emitters/sky.cpp +++ b/src/emitters/sky.cpp @@ -71,7 +71,7 @@ MTS_NAMESPACE_BEGIN * Specifies the relative amount of samples * allocated to this emitter. \default{1} * } - * \parameter{toWorld}{\Transform\Or\ATransform}{ + * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies an optional sensor-to-world transformation. * \default{none (i.e. sensor space $=$ world space)} * } diff --git a/src/emitters/spot.cpp b/src/emitters/spot.cpp index acbcac86..4acb24c6 100644 --- a/src/emitters/spot.cpp +++ b/src/emitters/spot.cpp @@ -25,7 +25,7 @@ MTS_NAMESPACE_BEGIN * \icon{emitter_spot} * \order{3} * \parameters{ - * \parameter{toWorld}{\Transform\Or\ATransform}{ + * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies an optional sensor-to-world transformation. * \default{none (i.e. sensor space $=$ world space)} * } diff --git a/src/libcore/properties.cpp b/src/libcore/properties.cpp index f06555e5..23ab813e 100644 --- a/src/libcore/properties.cpp +++ b/src/libcore/properties.cpp @@ -100,7 +100,7 @@ ref Properties::getAnimatedTransform(const std::string const Transform *result2 = boost::get(&it->second.data); if (!result1 && !result2) - SLog(EError, "The property \"%s\" has the wrong type (expected or ). The " + SLog(EError, "The property \"%s\" has the wrong type (expected or ). The " "complete property record is :\n%s", name.c_str(), toString().c_str()); it->second.queried = true; @@ -118,7 +118,7 @@ ref Properties::getAnimatedTransform(const std::string const Transform *result2 = boost::get(&it->second.data); if (!result1 && !result2) - SLog(EError, "The property \"%s\" has the wrong type (expected or ). The " + SLog(EError, "The property \"%s\" has the wrong type (expected or ). The " "complete property record is :\n%s", name.c_str(), toString().c_str()); it->second.queried = true; @@ -138,7 +138,7 @@ ref Properties::getAnimatedTransform(const std::string const Transform *result2 = boost::get(&it->second.data); if (!result1 && !result2) - SLog(EError, "The property \"%s\" has the wrong type (expected or ). The " + SLog(EError, "The property \"%s\" has the wrong type (expected or ). The " "complete property record is :\n%s", name.c_str(), toString().c_str()); it->second.queried = true; diff --git a/src/librender/scenehandler.cpp b/src/librender/scenehandler.cpp index 0b60793a..7c77e75b 100644 --- a/src/librender/scenehandler.cpp +++ b/src/librender/scenehandler.cpp @@ -103,7 +103,7 @@ SceneHandler::SceneHandler(const SAXParser *parser, m_tags["blackbody"] = TagEntry(EBlackBody, (Class *) NULL); m_tags["spectrum"] = TagEntry(ESpectrum, (Class *) NULL); m_tags["transform"] = TagEntry(ETransform, (Class *) NULL); - m_tags["atransform"] = TagEntry(EATransform, (Class *) NULL); + m_tags["animation"] = TagEntry(EAnimation, (Class *) NULL); m_tags["include"] = TagEntry(EInclude, (Class *) NULL); m_tags["alias"] = TagEntry(EAlias, (Class *) NULL); @@ -254,7 +254,7 @@ void SceneHandler::startElement(const XMLCh* const xmlName, case ETransform: m_transform = Transform(); break; - case EATransform: { + case EAnimation: { m_animatedTransform = new AnimatedTransform(); ref translation = new VectorTrack(VectorTrack::ETranslationXYZ); ref rotation = new QuatTrack(VectorTrack::ERotationQuat); @@ -606,7 +606,7 @@ void SceneHandler::endElement(const XMLCh* const xmlName) { } break; - case EATransform: { + case EAnimation: { m_animatedTransform->sortAndSimplify(); context.parent->properties.setAnimatedTransform( context.attributes["name"], m_animatedTransform); diff --git a/src/mtsgui/save.cpp b/src/mtsgui/save.cpp index fe51b38d..3be9f008 100644 --- a/src/mtsgui/save.cpp +++ b/src/mtsgui/save.cpp @@ -84,7 +84,7 @@ static void setProperties(QDomDocument &doc, QDomElement &element, std::set times; trafo->collectKeyframes(times); - property = doc.createElement("atransform"); + property = doc.createElement("animation"); for (std::set::iterator it2 = times.begin(); it2 != times.end(); ++it2) { const Matrix4x4 &matrix = trafo->eval(*it2).getMatrix(); diff --git a/src/sensors/fluencemeter.cpp b/src/sensors/fluencemeter.cpp index 5a403d69..6bd5a084 100644 --- a/src/sensors/fluencemeter.cpp +++ b/src/sensors/fluencemeter.cpp @@ -26,7 +26,7 @@ MTS_NAMESPACE_BEGIN /*!\plugin{fluencemeter}{Fluence meter} * \order{7} * \parameters{ - * \parameter{toWorld}{\Transform\Or\ATransform}{ + * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies an optional sensor-to-world transformation. * \default{none (i.e. sensor space $=$ world space)} * } diff --git a/src/sensors/orthographic.cpp b/src/sensors/orthographic.cpp index 8568065f..ae9504d9 100644 --- a/src/sensors/orthographic.cpp +++ b/src/sensors/orthographic.cpp @@ -27,7 +27,7 @@ MTS_NAMESPACE_BEGIN /*!\plugin{orthographic}{Orthographic camera} * \order{3} * \parameters{ - * \parameter{toWorld}{\Transform\Or\ATransform}{ + * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies an optional camera-to-world transformation. * \default{none (i.e. camera space $=$ world space)} * } diff --git a/src/sensors/perspective.cpp b/src/sensors/perspective.cpp index 8bf0b8b3..7184b912 100644 --- a/src/sensors/perspective.cpp +++ b/src/sensors/perspective.cpp @@ -26,7 +26,7 @@ MTS_NAMESPACE_BEGIN /*!\plugin{perspective}{Perspective pinhole camera} * \order{1} * \parameters{ - * \parameter{toWorld}{\Transform\Or\ATransform}{ + * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies an optional camera-to-world transformation. * \default{none (i.e. camera space $=$ world space)} * } diff --git a/src/sensors/radiancemeter.cpp b/src/sensors/radiancemeter.cpp index b969eef8..ae1bd44b 100644 --- a/src/sensors/radiancemeter.cpp +++ b/src/sensors/radiancemeter.cpp @@ -25,7 +25,7 @@ MTS_NAMESPACE_BEGIN /*!\plugin{radiancemeter}{Radiance meter} * \order{6} * \parameters{ - * \parameter{toWorld}{\Transform\Or\ATransform}{ + * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies an optional sensor-to-world transformation. * \default{none (i.e. sensor space $=$ world space)} * } diff --git a/src/sensors/spherical.cpp b/src/sensors/spherical.cpp index 0e3421d2..e39c2143 100644 --- a/src/sensors/spherical.cpp +++ b/src/sensors/spherical.cpp @@ -25,7 +25,7 @@ MTS_NAMESPACE_BEGIN /*!\plugin{spherical}{Spherical camera} * \order{5} * \parameters{ - * \parameter{toWorld}{\Transform\Or\ATransform}{ + * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies an optional camera-to-world transformation. * \default{none (i.e. camera space $=$ world space)} * } diff --git a/src/sensors/telecentric.cpp b/src/sensors/telecentric.cpp index 5b9ac447..02bf566d 100644 --- a/src/sensors/telecentric.cpp +++ b/src/sensors/telecentric.cpp @@ -27,7 +27,7 @@ MTS_NAMESPACE_BEGIN /*!\plugin{telecentric}{Telecentric lens camera} * \order{4} * \parameters{ - * \parameter{toWorld}{\Transform\Or\ATransform}{ + * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies an optional sensor-to-world transformation. * \default{none (i.e. camera space $=$ world space)} * } diff --git a/src/sensors/thinlens.cpp b/src/sensors/thinlens.cpp index e9891b6a..7e52b87e 100644 --- a/src/sensors/thinlens.cpp +++ b/src/sensors/thinlens.cpp @@ -29,7 +29,7 @@ MTS_NAMESPACE_BEGIN /*!\plugin{thinlens}{Perspective camera with a thin lens} * \order{2} * \parameters{ - * \parameter{toWorld}{\Transform\Or\ATransform}{ + * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies an optional camera-to-world transformation. * \default{none (i.e. camera space $=$ world space)} * } diff --git a/src/shapes/cylinder.cpp b/src/shapes/cylinder.cpp index 1d4fa95a..133de92d 100644 --- a/src/shapes/cylinder.cpp +++ b/src/shapes/cylinder.cpp @@ -43,7 +43,7 @@ MTS_NAMESPACE_BEGIN * Is the cylinder inverted, i.e. should the normal vectors * be flipped? \default{\code{false}, i.e. the normals point outside} * } - * \parameter{toWorld}{\Transform\Or\ATransform}{ + * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies an optional linear object-to-world transformation. * Note that non-uniform scales are not permitted! * \default{none (i.e. object space $=$ world space)} diff --git a/src/shapes/disk.cpp b/src/shapes/disk.cpp index a7445f95..7d575ebc 100644 --- a/src/shapes/disk.cpp +++ b/src/shapes/disk.cpp @@ -31,7 +31,7 @@ MTS_NAMESPACE_BEGIN /*!\plugin{disk}{Disk intersection primitive} * \order{4} * \parameters{ - * \parameter{toWorld}{\Transform\Or\ATransform}{ + * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies a linear object-to-world transformation. * Note that non-uniform scales are not permitted! * \default{none (i.e. object space $=$ world space)} diff --git a/src/shapes/instance.cpp b/src/shapes/instance.cpp index 32f81525..3604d319 100644 --- a/src/shapes/instance.cpp +++ b/src/shapes/instance.cpp @@ -25,15 +25,33 @@ MTS_NAMESPACE_BEGIN * \parameters{ * \parameter{\Unnamed}{\ShapeGroup}{A reference to a * shape group that should be instantiated} - * \parameter{toWorld}{\Transform\Or\ATransform}{ + * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies an optional linear instance-to-world transformation. * \default{none (i.e. instance space $=$ world space)} * } * } + * \renderings{ + * \rendering{Surface viewed from the top}{shape_instance_fractal_top} + * \rendering{Surface viewed from the bottom}{shape_instance_fractal_bot} + * \caption{ + * A visualization of a fractal surface by Irving and Segerman. + * (a 2D Gospel curve developed up to level 5 along the third + * dimension). This scene makes use of instancing to replicate + * similar structures to cheaply render a structure that effectively + * consists of several hundred millions of triangles. + * } + * } * * This plugin implements a geometry instance used to efficiently replicate - * geometry many times. For details, please refer to the \pluginref{shapegroup} - * plugin. + * geometry many times. For details on how to create instances, refer to + * the \pluginref{shapegroup} plugin. + * \remarks{ + * \item Note that it is \emph{not} possible to assign a different + * material to each instance --- the material assignment specified within + * the shape group is the one that matters. + * \item Shape groups cannot be used to replicate shapes with + * attached emitters, sensors, or subsurface scattering models. + * } */ Instance::Instance(const Properties &props) : Shape(props) { diff --git a/src/shapes/obj.cpp b/src/shapes/obj.cpp index 015384e4..de49cb77 100644 --- a/src/shapes/obj.cpp +++ b/src/shapes/obj.cpp @@ -55,7 +55,7 @@ MTS_NAMESPACE_BEGIN * this convention. \default{\code{true}, i.e. flip them to get the * correct coordinates}. * } - * \parameter{toWorld}{\Transform\Or\ATransform}{ + * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies an optional linear object-to-world transformation. * Note that non-uniform scales are not permitted! * \default{none (i.e. object space $=$ world space)} diff --git a/src/shapes/ply.cpp b/src/shapes/ply.cpp index 75fca394..67324782 100644 --- a/src/shapes/ply.cpp +++ b/src/shapes/ply.cpp @@ -62,7 +62,7 @@ MTS_NAMESPACE_BEGIN * Optional flag to flip all normals. \default{\code{false}, i.e. * the normals are left unchanged}. * } - * \parameter{toWorld}{\Transform\Or\ATransform}{ + * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies an optional linear object-to-world transformation. * Note that non-uniform scales are not permitted! * \default{none (i.e. object space $=$ world space)} diff --git a/src/shapes/rectangle.cpp b/src/shapes/rectangle.cpp index e95a5e4f..73c2cad8 100644 --- a/src/shapes/rectangle.cpp +++ b/src/shapes/rectangle.cpp @@ -30,7 +30,7 @@ MTS_NAMESPACE_BEGIN /*!\plugin{rectangle}{Rectangle intersection primitive} * \order{3} * \parameters{ - * \parameter{toWorld}{\Transform\Or\ATransform}{ + * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies a linear object-to-world transformation. * It is allowed to use non-uniform scaling, but no shear. * \default{none (i.e. object space $=$ world space)} diff --git a/src/shapes/serialized.cpp b/src/shapes/serialized.cpp index bdfced9e..7f932074 100644 --- a/src/shapes/serialized.cpp +++ b/src/shapes/serialized.cpp @@ -55,7 +55,7 @@ MTS_NAMESPACE_BEGIN * Optional flag to flip all normals. \default{\code{false}, i.e. * the normals are left unchanged}. * } - * \parameter{toWorld}{\Transform\Or\ATransform}{ + * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies an optional linear object-to-world transformation. * Note that non-uniform scales are not permitted! * \default{none (i.e. object space $=$ world space)} diff --git a/src/shapes/shapegroup.cpp b/src/shapes/shapegroup.cpp index c9e60c73..6dff5e9d 100644 --- a/src/shapes/shapegroup.cpp +++ b/src/shapes/shapegroup.cpp @@ -34,9 +34,9 @@ MTS_NAMESPACE_BEGIN * so that they can efficiently be referenced many times using the * \pluginref{instance} plugin. This is useful for rendering things like * forests, where only a few distinct types of trees have to be kept - * in memory. + * in memory. An example is given below: * - + * \vspace{5mm} * \begin{xml}[caption={An example of geometry instancing}, label=lst:instancing] * * @@ -68,14 +68,6 @@ MTS_NAMESPACE_BEGIN * * * \end{xml} - * \vspace{-2mm} - * \remarks{ - * \item Note that it is not possible to assign a different - * material to each instance --- the material assignment specified within - * the shape group is the one that matters. - * \item Shape groups can not be used to replicate shapes with - * attached emitters, sensors, or subsurface scattering models. - * } */ ShapeGroup::ShapeGroup(const Properties &props) : Shape(props) { diff --git a/src/shapes/sphere.cpp b/src/shapes/sphere.cpp index 6c8c0ad4..d35ad11c 100644 --- a/src/shapes/sphere.cpp +++ b/src/shapes/sphere.cpp @@ -37,7 +37,7 @@ MTS_NAMESPACE_BEGIN * \parameter{radius}{\Float}{ * Radius of the sphere in object-space units \default{1} * } - * \parameter{toWorld}{\Transform\Or\ATransform}{ + * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies an optional linear object-to-world transformation. * Note that non-uniform scales are not permitted! * \default{none (i.e. object space $=$ world space)}