rough plastic documentation is done..

metadata
Wenzel Jakob 2011-09-17 21:28:43 -04:00
parent 1852d18833
commit 45d3be5ec5
6 changed files with 48 additions and 39 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

View File

@ -86,7 +86,6 @@ MTS_NAMESPACE_BEGIN
* \rendering{GGX, $\alpha=0.3$}{bsdf_roughplastic_ggx}
* }
*
*
* This plugin is essentially the ``roughened'' equivalent of the (smooth) plugin
* \pluginref{plastic}. For very low values of $\alpha$, the two will
* be identical, though scenes using this plugin will take longer to render
@ -108,8 +107,8 @@ MTS_NAMESPACE_BEGIN
*
* The simplicity of this setup makes it possible to account for interesting
* nonlinear effects due to internal scattering, which is controlled by
* the \texttt{nonlinear} parameter. Please refer to the description of this
* parameter given in the the \pluginref{plastic} plugin section
* the \texttt{nonlinear} parameter. For more details, please refer to the description
* of this parameter given in the the \pluginref{plastic} plugin section
* on \pluginpage{plastic}.
*
*
@ -136,18 +135,30 @@ MTS_NAMESPACE_BEGIN
* }
* \newpage
* \renderings{
* \setcounter{subfigure}{2}
* \rendering{Beckmann, $\alpha=0.05$, diffuseReflectance=0}
* {bsdf_roughplastic_beckmann_lacquer}
* \rendering{Wood material with smooth horizontal stripes}{bsdf_roughplastic_roughtex1}
* \rendering{A material with imperfections at a much smaller scale than what
* is modeled e.g. using a bump map.}{bsdf_roughplastic_roughtex2}\vspace{-3mm}
* \caption{
* The ability to texture the roughness parameter makes it possible
* to render materials with a structured finish, as well as
* ``smudgy'' objects.
* }
* }
*
* \begin{xml}[caption={A material definition for rough, black laquer.},
* label=lst:roughplastic-lacquer]
* \vspace{2mm}
* \begin{xml}[caption={A material definition for black plastic material with
* a spatially varying roughness.},
* label=lst:roughplastic-varyingalpha]
* <bsdf type="roughplastic">
* <string name="distribution" value="beckmann"/>
* <float name="alpha" value="0.05"/>
* <float name="intIOR" value="1.61"/>
* <spectrum name="diffuseReflectance" value="0"/>
* <!-- Fetch roughness values from a texture and slightly reduce them -->
* <texture type="scale" name="alpha">
* <texture name="alpha" type="bitmap">
* <string name="filename" value="bump.png"/>
* </texture>
* <float name="scale" value="0.6"/>
* </texture>
* </bsdf>
* \end{xml}
*
@ -159,6 +170,17 @@ MTS_NAMESPACE_BEGIN
* restricted here---in comparison to other rough scattering models in
* Mitsuba, anisotropic distributions are not allowed.
*
* The implementation of this model makes heavy use of a \emph{rough
* Fresnel transmittance} function, which is a generalization of the
* usual Fresnel transmittion coefficient to microfacet surfaces. Unfortunately,
* this function is normally prohibitively expensive, since each
* evaluation involves a numerical integration over the sphere.
*
* To avoid this performance issue, Mitsuba ships with data files
* (contained in the \code{data/microfacet} directory) containing precomputed
* values of this function over a large range of parameter values. At runtime,
* the relevant parts are extracted using tricubic interpolation.
*
* When rendering with the Phong microfacet distributions, a conversion
* is used to turn the specified $\alpha$ roughness value into the Phong
* exponent. This is done in a way, such that the different distributions

View File

@ -47,11 +47,12 @@ MTS_NAMESPACE_BEGIN
* Note that non-uniform scales are not permitted!
* \default{none (i.e. object space $=$ world space)}
* }
* \parameter{recenter}{\Boolean}{
* When set to \code{true}, the geometry will be uniformly scaled
* and shifted to so that its object-space footprint fits into $[-1, 1]^3$.
* }
* }
*
* This plugin implements a simple loader for Wavefront OBJ files. It handles
* triangle and quad meshes, vertex normals, and UV coordinates. Due to the
* heavy-weight nature of OBJ files, this loader is usually quite a bit slower
* than the \pluginref{ply} or \pluginref{serialized} plugins.
*/
class WavefrontOBJ : public Shape {
public:
@ -103,10 +104,6 @@ public:
*/
m_faceNormals = props.getBoolean("faceNormals", false);
/* Re-center & scale all contents to move them into the
AABB [-1, -1, -1]x[1, 1, 1]? */
m_recenter = props.getBoolean("recenter", false);
/* Causes all normals to be flipped */
m_flipNormals = props.getBoolean("flipNormals", false);
@ -360,20 +357,6 @@ public:
std::map<Vertex, int, vertex_key_order> vertexMap;
std::vector<Vertex> vertexBuffer;
size_t numMerged = 0;
Vector translate(0.0f);
Float scale = 0.0f;
if (m_recenter) {
AABB aabb;
for (unsigned int i=0; i<triangles.size(); i++) {
for (unsigned int j=0; j<3; j++) {
unsigned int vertexId = triangles[i].p[j];
aabb.expandBy(vertices.at(vertexId));
}
}
scale = 2/aabb.getExtents()[aabb.getLargestAxis()];
translate = -Vector(aabb.getCenter());
}
/* Collapse the mesh into a more usable form */
Triangle *triangleArray = new Triangle[triangles.size()];
@ -387,10 +370,7 @@ public:
Vertex vertex;
if (m_recenter)
vertex.p = objectToWorld((vertices.at(vertexId) + translate)*scale);
else
vertex.p = objectToWorld(vertices.at(vertexId));
vertex.p = objectToWorld(vertices.at(vertexId));
if (hasNormals && normalId >= 0 && normals.at(normalId) != Normal(0.0f))
vertex.n = normalize(objectToWorld(normals.at(normalId)));
@ -533,7 +513,7 @@ public:
private:
std::vector<TriMesh *> m_meshes;
std::map<std::string, BSDF *> m_materials;
bool m_flipNormals, m_faceNormals, m_recenter;
bool m_flipNormals, m_faceNormals;
std::string m_name;
AABB m_aabb;
};

View File

@ -67,8 +67,15 @@ MTS_NAMESPACE_BEGIN
* \rendering{The Stanford bunny loaded with \code{faceNormals=true}. Note
* the faceted appearance.}{shape_ply_bunny}
* }
* This plugin is based on the library \code{libply} by Ares Lagae
* (\url{http://people.cs.kuleuven.be/~ares.lagae/libply}).
* This plugin implements a fast loader for the Stanford PLY format (both
* the ASCII and binary format). It is based on the \code{libply} library by
* Ares Lagae (\url{http://people.cs.kuleuven.be/~ares.lagae/libply}).
* The current plugin implementation supports triangle meshes with optional
* UV coordinates, vertex normals, and vertex colors.
*
* When loading meshes that contain vertex colors, note that they need to be
* explicitly referenced in a BSDF using a special texture named
* \pluginref{vertexcolors}.
*/
class PLYLoader : public TriMesh {
public: