本文整理汇总了C++中Spectrum::fromLinearRGB方法的典型用法代码示例。如果您正苦于以下问题:C++ Spectrum::fromLinearRGB方法的具体用法?C++ Spectrum::fromLinearRGB怎么用?C++ Spectrum::fromLinearRGB使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spectrum
的用法示例。
在下文中一共展示了Spectrum::fromLinearRGB方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Li
Spectrum Li(const RayDifferential &ray, RadianceQueryRecord &rRec) const {
Intersection &its = rRec.its;
if (m_indirectOnly && (rRec.type & RadianceQueryRecord::EDirectSurfaceRadiance))
rRec.type ^= RadianceQueryRecord::EDirectSurfaceRadiance;
if (rRec.rayIntersect(ray)) {
const BSDF *bsdf = its.getBSDF(ray);
if (bsdf && (bsdf->getType() & BSDF::EAll) == BSDF::EDiffuseReflection &&
(rRec.type & RadianceQueryRecord::EIndirectSurfaceRadiance)) {
Spectrum E;
if (Frame::cosTheta(its.wi) <= 0) {
E = Spectrum(0.0f);
} else if (!m_irrCache->get(its, E)) {
handleMiss(ray, rRec, E);
if (m_debug)
E.fromLinearRGB(1e3, 0, 0);
}
rRec.type ^= RadianceQueryRecord::EIndirectSurfaceRadiance;
return E * bsdf->getDiffuseReflectance(its) * INV_PI +
m_subIntegrator->Li(ray, rRec);
}
}
return m_subIntegrator->Li(ray, rRec);
}
示例2: getMinimum
Spectrum getMinimum() const {
Spectrum result;
if (m_mipmap3.get()) {
Color3 value = m_mipmap3->getMinimum();
result.fromLinearRGB(value[0], value[1], value[2]);
} else {
Color1 value = m_mipmap1->getMinimum();
result = Spectrum(value[0]);
}
return result;
}
示例3: eval
Spectrum eval(const Point2 &uv, const Vector2 &d0, const Vector2 &d1) const {
stats::filteredLookups.incrementBase();
++stats::filteredLookups;
Spectrum result;
if (m_mipmap3.get()) {
Color3 value = m_mipmap3->eval(uv, d0, d1);
result.fromLinearRGB(value[0], value[1], value[2]);
} else {
Color1 value = m_mipmap1->eval(uv, d0, d1);
result = Spectrum(value[0]);
}
return result;
}
示例4: SamplingIntegrator
/// Initialize the integrator with the specified properties
MyIntegrator(const Properties &props) : SamplingIntegrator(props) {
Spectrum defaultColor;
defaultColor.fromLinearRGB(0.2f, 0.5f, 0.2f);
m_color = props.getSpectrum("color", defaultColor);
}