field.cpp: added ability to extract albedo values
parent
209a19967b
commit
b27a81f71b
|
@ -35,6 +35,7 @@ MTS_NAMESPACE_BEGIN
|
||||||
* \item \code{geoNormal}: Geometric surface normal
|
* \item \code{geoNormal}: Geometric surface normal
|
||||||
* \item \code{shNormal}: Shading surface normal
|
* \item \code{shNormal}: Shading surface normal
|
||||||
* \item \code{uv}: UV coordinate value
|
* \item \code{uv}: UV coordinate value
|
||||||
|
* \item \code{albedo}: Albedo value of the BSDF
|
||||||
* \item \code{shapeIndex}: Integer index of the high-level shape
|
* \item \code{shapeIndex}: Integer index of the high-level shape
|
||||||
* \item \code{primIndex}: Integer shape primitive index
|
* \item \code{primIndex}: Integer shape primitive index
|
||||||
* \end{itemize}
|
* \end{itemize}
|
||||||
|
@ -60,6 +61,7 @@ public:
|
||||||
EGeometricNormal,
|
EGeometricNormal,
|
||||||
EShadingNormal,
|
EShadingNormal,
|
||||||
EUV,
|
EUV,
|
||||||
|
EAlbedo,
|
||||||
EShapeIndex,
|
EShapeIndex,
|
||||||
EPrimIndex
|
EPrimIndex
|
||||||
};
|
};
|
||||||
|
@ -79,6 +81,8 @@ public:
|
||||||
m_field = EShadingNormal;
|
m_field = EShadingNormal;
|
||||||
} else if (field == "uv") {
|
} else if (field == "uv") {
|
||||||
m_field = EUV;
|
m_field = EUV;
|
||||||
|
} else if (field == "albedo") {
|
||||||
|
m_field = EAlbedo;
|
||||||
} else if (field == "shapeIndex") {
|
} else if (field == "shapeIndex") {
|
||||||
m_field = EShapeIndex;
|
m_field = EShapeIndex;
|
||||||
} else if (field == "primIndex") {
|
} else if (field == "primIndex") {
|
||||||
|
@ -146,6 +150,9 @@ public:
|
||||||
case EUV:
|
case EUV:
|
||||||
result.fromLinearRGB(its.uv.x, its.uv.y, 0);
|
result.fromLinearRGB(its.uv.x, its.uv.y, 0);
|
||||||
break;
|
break;
|
||||||
|
case EAlbedo:
|
||||||
|
result = its.shape->getBSDF()->getDiffuseReflectance(its);
|
||||||
|
break;
|
||||||
case EShapeIndex: {
|
case EShapeIndex: {
|
||||||
const ref_vector<Shape> &shapes = rRec.scene->getShapes();
|
const ref_vector<Shape> &shapes = rRec.scene->getShapes();
|
||||||
result = Spectrum((Float) -1);
|
result = Spectrum((Float) -1);
|
||||||
|
|
Loading…
Reference in New Issue