added a new Texture::isMonochromatic function
parent
3d7592cf6e
commit
a424a29602
|
@ -73,6 +73,10 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool isMonochromatic() const {
|
||||||
|
return m_value == Spectrum(m_value[0]);
|
||||||
|
}
|
||||||
|
|
||||||
Shader *createShader(Renderer *renderer) const;
|
Shader *createShader(Renderer *renderer) const;
|
||||||
|
|
||||||
ref<Bitmap> getBitmap(const Vector2i &resolutionHint) const;
|
ref<Bitmap> getBitmap(const Vector2i &resolutionHint) const;
|
||||||
|
@ -128,6 +132,10 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool isMonochromatic() const {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
Shader *createShader(Renderer *renderer) const;
|
Shader *createShader(Renderer *renderer) const;
|
||||||
|
|
||||||
ref<Bitmap> getBitmap(const Vector2i &resolutionHint) const;
|
ref<Bitmap> getBitmap(const Vector2i &resolutionHint) const;
|
||||||
|
@ -187,6 +195,10 @@ public:
|
||||||
return m_a->usesRayDifferentials() || m_b->usesRayDifferentials();
|
return m_a->usesRayDifferentials() || m_b->usesRayDifferentials();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool isMonochromatic() const {
|
||||||
|
return m_a->isMonochromatic() && m_b->isMonochromatic();
|
||||||
|
}
|
||||||
|
|
||||||
Shader *createShader(Renderer *renderer) const;
|
Shader *createShader(Renderer *renderer) const;
|
||||||
|
|
||||||
ref<Bitmap> getBitmap(const Vector2i &resolutionHint) const;
|
ref<Bitmap> getBitmap(const Vector2i &resolutionHint) const;
|
||||||
|
@ -246,6 +258,10 @@ public:
|
||||||
return m_a->usesRayDifferentials() || m_b->usesRayDifferentials();
|
return m_a->usesRayDifferentials() || m_b->usesRayDifferentials();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool isMonochromatic() const {
|
||||||
|
return m_a->isMonochromatic() && m_b->isMonochromatic();
|
||||||
|
}
|
||||||
|
|
||||||
Shader *createShader(Renderer *renderer) const;
|
Shader *createShader(Renderer *renderer) const;
|
||||||
|
|
||||||
ref<Bitmap> getBitmap(const Vector2i &resolutionHint) const;
|
ref<Bitmap> getBitmap(const Vector2i &resolutionHint) const;
|
||||||
|
@ -306,6 +322,10 @@ public:
|
||||||
return m_a->usesRayDifferentials() || m_b->usesRayDifferentials();
|
return m_a->usesRayDifferentials() || m_b->usesRayDifferentials();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool isMonochromatic() const {
|
||||||
|
return m_a->isMonochromatic() && m_b->isMonochromatic();
|
||||||
|
}
|
||||||
|
|
||||||
Shader *createShader(Renderer *renderer) const;
|
Shader *createShader(Renderer *renderer) const;
|
||||||
|
|
||||||
void serialize(Stream *stream, InstanceManager *manager) const;
|
void serialize(Stream *stream, InstanceManager *manager) const;
|
||||||
|
|
|
@ -63,9 +63,16 @@ public:
|
||||||
/// Return the resolution in pixels, if applicable
|
/// Return the resolution in pixels, if applicable
|
||||||
virtual Vector3i getResolution() const;
|
virtual Vector3i getResolution() const;
|
||||||
|
|
||||||
/// Return whether the texture takes on a single constant value
|
/// Return whether the texture takes on a constant value everywhere
|
||||||
virtual bool isConstant() const;
|
virtual bool isConstant() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Return whether the texture is monochromatic / spectrally uniform
|
||||||
|
*
|
||||||
|
* The implementation may conservatively return \c false if it is not sure.
|
||||||
|
*/
|
||||||
|
virtual bool isMonochromatic() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Does this texture perform any pre-filtering when
|
* \brief Does this texture perform any pre-filtering when
|
||||||
* ray differentials are available?
|
* ray differentials are available?
|
||||||
|
|
|
@ -482,6 +482,7 @@ void export_render() {
|
||||||
.def("getSensor", shape_getSensor, BP_RETURN_VALUE)
|
.def("getSensor", shape_getSensor, BP_RETURN_VALUE)
|
||||||
.def("hasBSDF", &Shape::hasBSDF)
|
.def("hasBSDF", &Shape::hasBSDF)
|
||||||
.def("getBSDF", shape_getBSDF, BP_RETURN_VALUE)
|
.def("getBSDF", shape_getBSDF, BP_RETURN_VALUE)
|
||||||
|
.def("setBSDF", &Shape::setBSDF)
|
||||||
.def("getPrimitiveCount", &Shape::getPrimitiveCount)
|
.def("getPrimitiveCount", &Shape::getPrimitiveCount)
|
||||||
.def("getEffectivePrimitiveCount", &Shape::getEffectivePrimitiveCount)
|
.def("getEffectivePrimitiveCount", &Shape::getEffectivePrimitiveCount)
|
||||||
.def("copyAttachments", &Shape::copyAttachments);
|
.def("copyAttachments", &Shape::copyAttachments);
|
||||||
|
|
|
@ -46,6 +46,7 @@ Spectrum Texture::getAverage() const { NotImplementedError("getAverage"); }
|
||||||
Spectrum Texture::getMinimum() const { NotImplementedError("getMinimum"); }
|
Spectrum Texture::getMinimum() const { NotImplementedError("getMinimum"); }
|
||||||
Spectrum Texture::getMaximum() const { NotImplementedError("getMaximum"); }
|
Spectrum Texture::getMaximum() const { NotImplementedError("getMaximum"); }
|
||||||
bool Texture::isConstant() const { NotImplementedError("isConstant"); }
|
bool Texture::isConstant() const { NotImplementedError("isConstant"); }
|
||||||
|
bool Texture::isMonochromatic() const { NotImplementedError("isMonochromatic"); }
|
||||||
bool Texture::usesRayDifferentials() const { NotImplementedError("usesRayDifferentials"); }
|
bool Texture::usesRayDifferentials() const { NotImplementedError("usesRayDifferentials"); }
|
||||||
ref<Bitmap> Texture::getBitmap(const Vector2i &) const { NotImplementedError("getBitmap"); }
|
ref<Bitmap> Texture::getBitmap(const Vector2i &) const { NotImplementedError("getBitmap"); }
|
||||||
|
|
||||||
|
|
|
@ -542,6 +542,10 @@ public:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isMonochromatic() const {
|
||||||
|
return m_mipmap1.get() != NULL;
|
||||||
|
}
|
||||||
|
|
||||||
Vector3i getResolution() const {
|
Vector3i getResolution() const {
|
||||||
if (m_mipmap3.get()) {
|
if (m_mipmap3.get()) {
|
||||||
return Vector3i(
|
return Vector3i(
|
||||||
|
|
|
@ -105,6 +105,11 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isMonochromatic() const {
|
||||||
|
return Spectrum(m_color0[0]) == m_color0
|
||||||
|
&& Spectrum(m_color1[0]) == m_color1;
|
||||||
|
}
|
||||||
|
|
||||||
std::string toString() const {
|
std::string toString() const {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << "Checkerboard[" << endl
|
oss << "Checkerboard[" << endl
|
||||||
|
|
|
@ -105,6 +105,10 @@ public:
|
||||||
return Spectrum(1.0f);
|
return Spectrum(1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isMonochromatic() const {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool isConstant() const {
|
bool isConstant() const {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,6 +122,11 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isMonochromatic() const {
|
||||||
|
return Spectrum(m_color0[0]) == m_color0
|
||||||
|
&& Spectrum(m_color1[0]) == m_color1;
|
||||||
|
}
|
||||||
|
|
||||||
std::string toString() const {
|
std::string toString() const {
|
||||||
return "GridTexture[]";
|
return "GridTexture[]";
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,6 +138,10 @@ public:
|
||||||
return m_nested->usesRayDifferentials();
|
return m_nested->usesRayDifferentials();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isMonochromatic() const {
|
||||||
|
return m_nested->isMonochromatic();
|
||||||
|
}
|
||||||
|
|
||||||
Shader *createShader(Renderer *renderer) const;
|
Shader *createShader(Renderer *renderer) const;
|
||||||
|
|
||||||
void serialize(Stream *stream, InstanceManager *manager) const {
|
void serialize(Stream *stream, InstanceManager *manager) const {
|
||||||
|
|
|
@ -80,6 +80,10 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isMonochromatic() const {
|
||||||
|
return false; /* No way to tell from here, really .. */
|
||||||
|
}
|
||||||
|
|
||||||
std::string toString() const {
|
std::string toString() const {
|
||||||
return "VertexColors[]";
|
return "VertexColors[]";
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,6 +152,11 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isMonochromatic() const {
|
||||||
|
return Spectrum(m_edgeColor[0]) == m_edgeColor
|
||||||
|
&& Spectrum(m_interiorColor[0]) == m_interiorColor;
|
||||||
|
}
|
||||||
|
|
||||||
std::string toString() const {
|
std::string toString() const {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << "WireFrame[" << endl
|
oss << "WireFrame[" << endl
|
||||||
|
|
Loading…
Reference in New Issue