20 #if !defined(__MITSUBA_HW_BASICSHADER_H_)
21 #define __MITSUBA_HW_BASICSHADER_H_
69 return m_value.toString();
77 return m_value ==
Spectrum(m_value[0]);
126 std::ostringstream oss;
164 return m_a->
eval(its) + m_b->eval(its);
168 return m_a->getAverage() + m_b->getAverage();
173 return m_a->getMaximum() + m_b->getMaximum();
178 return m_a->getMinimum() + m_b->getMinimum();
182 return m_a->isConstant() && m_b->isConstant();
186 std::ostringstream oss;
187 oss <<
"SpectrumAdditionTexture[" << endl
188 <<
" a = " <<
indent(m_a->toString()) <<
"," << endl
189 <<
" b = " <<
indent(m_a->toString()) << endl
195 return m_a->usesRayDifferentials() || m_b->usesRayDifferentials();
199 return m_a->isMonochromatic() && m_b->isMonochromatic();
210 ref<const Texture> m_a, m_b;
227 return m_a->
eval(its) - m_b->eval(its);
231 return m_a->getAverage() - m_b->getAverage();
236 return m_a->getMaximum() - m_b->getMinimum();
241 return m_a->getMinimum() - m_b->getMaximum();
245 return m_a->isConstant() && m_b->isConstant();
249 std::ostringstream oss;
250 oss <<
"SpectrumSubtractionTexture[" << endl
251 <<
" a = " <<
indent(m_a->toString()) <<
"," << endl
252 <<
" b = " <<
indent(m_b->toString()) << endl
258 return m_a->usesRayDifferentials() || m_b->usesRayDifferentials();
262 return m_a->isMonochromatic() && m_b->isMonochromatic();
273 ref<const Texture> m_a, m_b;
290 return m_a->
eval(its) * m_b->eval(its);
294 SLog(
EError,
"SpectrumProductTexture::getAverage() -- information unavailable!");
300 return m_a->getMaximum() * m_b->getMaximum();
305 return m_a->getMinimum() * m_b->getMinimum();
309 return m_a->isConstant() && m_b->isConstant();
313 std::ostringstream oss;
314 oss <<
"SpectrumProductTexture[" << endl
315 <<
" a = " <<
indent(m_a->toString()) <<
"," << endl
316 <<
" b = " <<
indent(m_b->toString()) << endl
322 return m_a->usesRayDifferentials() || m_b->usesRayDifferentials();
326 return m_a->isMonochromatic() && m_b->isMonochromatic();
337 ref<const Texture> m_a, m_b;
Spectrum getAverage() const
Return the component-wise average value of the texture over its domain.
Definition: basicshader.h:293
bool isConstant() const
Return whether the texture takes on a constant value everywhere.
Definition: basicshader.h:308
Componentwise product of two textures.
Definition: basicshader.h:282
Componentwise addition of two textures.
Definition: basicshader.h:156
std::string toString() const
Return a human-readable string representation of the object's contents.
Definition: basicshader.h:312
bool isMonochromatic() const
Return whether the texture is monochromatic / spectrally uniform.
Definition: basicshader.h:325
Shader base class for use with a VPL-style renderer.
Definition: shader.h:54
virtual void serialize(Stream *stream, InstanceManager *manager) const
Serialize to a binary data stream.
Spectrum getMinimum() const
Return the component-wise minimum of the texture over its domain.
Definition: basicshader.h:239
Constant float-valued texture.
Definition: basicshader.h:97
Spectrum getMinimum() const
Return the component-wise minimum of the texture over its domain.
Definition: basicshader.h:117
Spectrum getAverage() const
Return the component-wise average value of the texture over its domain.
Definition: basicshader.h:52
bool isConstant() const
Return whether the texture takes on a constant value everywhere.
Definition: basicshader.h:181
MTS_EXPORT_CORE std::string indent(const std::string &string, int amount=1)
Indent a string (Used for recursive toString() structure dumping)
Base class of all textures. Computes values for an arbitrary surface point. Texture2D is a specializa...
Definition: texture.h:34
SpectrumAdditionTexture(const Texture *a, const Texture *b)
Definition: basicshader.h:158
Componentwise subtraction of two textures.
Definition: basicshader.h:219
std::string toString() const
Return a human-readable string representation of the object's contents.
Definition: basicshader.h:248
#define SLog(level, fmt,...)
Write a Log message to the console (static version - to be used outside of classes that derive from O...
Definition: logger.h:49
bool usesRayDifferentials() const
Does this texture perform any pre-filtering when ray differentials are available? ...
Definition: basicshader.h:321
virtual Shader * createShader(Renderer *renderer) const
virtual ref< Bitmap > getBitmap(const Vector2i &sizeHint=Vector2i(-1,-1)) const
Return a bitmap representation of the texture.
Spectrum getMaximum() const
Return the component-wise maximum of the texture over its domain.
Definition: basicshader.h:171
bool isMonochromatic() const
Return whether the texture is monochromatic / spectrally uniform.
Definition: basicshader.h:198
bool isConstant() const
Return whether the texture takes on a constant value everywhere.
Definition: basicshader.h:244
Spectrum eval(const Intersection &its, bool) const
Return the texture value at its.
Definition: basicshader.h:105
ConstantFloatTexture(const Float &value)
Definition: basicshader.h:99
Float eval(Float lambda) const
Evaluate the SPD for the given wavelength in nanometers.
Spectrum getMaximum() const
Return the component-wise maximum of the texture over its domain.
Definition: basicshader.h:234
Spectrum getMinimum() const
Return the component-wise minimum of the texture over its domain.
Definition: basicshader.h:303
SpectrumProductTexture(const Texture *a, const Texture *b)
Definition: basicshader.h:284
bool usesRayDifferentials() const
Does this texture perform any pre-filtering when ray differentials are available? ...
Definition: basicshader.h:131
std::string toString() const
Return a human-readable string representation of the object's contents.
Definition: basicshader.h:68
Spectrum eval(const Intersection &its, bool) const
Return the texture value at its.
Definition: basicshader.h:48
Spectrum getMaximum() const
Return the component-wise maximum of the texture over its domain.
Definition: basicshader.h:113
Spectrum getMinimum() const
Return the component-wise minimum of the texture over its domain.
Definition: basicshader.h:60
bool usesRayDifferentials() const
Does this texture perform any pre-filtering when ray differentials are available? ...
Definition: basicshader.h:194
Abstract seekable stream class.
Definition: stream.h:58
#define MTS_DECLARE_CLASS()
This macro must be used in the initial definition in classes that derive from Object.
Definition: class.h:158
Reference counting helper.
Definition: ref.h:40
bool isConstant() const
Return whether the texture takes on a constant value everywhere.
Definition: basicshader.h:121
std::string toString() const
Return a human-readable string representation of the object's contents.
Definition: basicshader.h:185
ConstantSpectrumTexture(const Spectrum &value)
Definition: basicshader.h:42
Spectrum getMaximum() const
Return the component-wise maximum of the texture over its domain.
Definition: basicshader.h:298
Abstract renderer implementation.
Definition: renderer.h:79
Error message, causes an exception to be thrown.
Definition: formatter.h:33
SpectrumSubtractionTexture(const Texture *a, const Texture *b)
Definition: basicshader.h:221
bool isMonochromatic() const
Return whether the texture is monochromatic / spectrally uniform.
Definition: basicshader.h:261
bool usesRayDifferentials() const
Does this texture perform any pre-filtering when ray differentials are available? ...
Definition: basicshader.h:257
Spectrum getAverage() const
Return the component-wise average value of the texture over its domain.
Definition: basicshader.h:230
Associative parameter map for constructing subclasses of ConfigurableObject.
Definition: properties.h:46
Container for all information related to a surface intersection.
Definition: shape.h:36
Coordinates the serialization and unserialization of object graphs.
Definition: serialization.h:65
Spectrum eval(const Intersection &its, bool) const
Return the texture value at its.
Definition: basicshader.h:289
Discrete spectral power distribution based on a number of wavelength bins over the 360-830 nm range...
Definition: spectrum.h:663
bool isMonochromatic() const
Return whether the texture is monochromatic / spectrally uniform.
Definition: basicshader.h:135
Spectrum eval(const Intersection &its, bool) const
Return the texture value at its.
Definition: basicshader.h:163
std::string toString() const
Return a human-readable string representation of the object's contents.
Definition: basicshader.h:125
Spectrum getMaximum() const
Return the component-wise maximum of the texture over its domain.
Definition: basicshader.h:56
bool isMonochromatic() const
Return whether the texture is monochromatic / spectrally uniform.
Definition: basicshader.h:76
Spectrum eval(const Intersection &its, bool) const
Return the texture value at its.
Definition: basicshader.h:226
bool isConstant() const
Return whether the texture takes on a constant value everywhere.
Definition: basicshader.h:64
Spectrum getAverage() const
Return the component-wise average value of the texture over its domain.
Definition: basicshader.h:167
Spectrum getAverage() const
Return the component-wise average value of the texture over its domain.
Definition: basicshader.h:109
bool usesRayDifferentials() const
Does this texture perform any pre-filtering when ray differentials are available? ...
Definition: basicshader.h:72
Spectrum getMinimum() const
Return the component-wise minimum of the texture over its domain.
Definition: basicshader.h:176
Constant spectrum-valued texture.
Definition: basicshader.h:40