本文整理汇总了C#中RayDen.Library.Core.Primitives.RgbSpectrum.IsNegative方法的典型用法代码示例。如果您正苦于以下问题:C# RgbSpectrum.IsNegative方法的具体用法?C# RgbSpectrum.IsNegative怎么用?C# RgbSpectrum.IsNegative使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RayDen.Library.Core.Primitives.RgbSpectrum
的用法示例。
在下文中一共展示了RgbSpectrum.IsNegative方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EvalBrdf
private void EvalBrdf(out RgbSpectrum fs, ref Vector lwi, ref Vector lwo)
{
float sinthetai = SinTheta(ref lwi);
float sinthetao = SinTheta(ref lwo);
// Compute cosine term of Oren--Nayar model
float sinphii = SinPhi(ref lwi), cosphii = CosPhi(ref lwi);
float sinphio = SinPhi(ref lwo), cosphio = CosPhi(ref lwo);
float dcos = cosphii*cosphio + sinphii*sinphio;
#if VERBOSE
Assert.IsNotNaN(cosphii,"cosphii "+lwi.ToString());
Assert.IsNotNaN(cosphio, "cosphio " + lwo.ToString());
Assert.IsNotNaN(sinphii, "sinphii " + lwi.ToString());
Assert.IsNotNaN(sinphio, "sinphio " + lwo.ToString());
#endif
float maxcos = Math.Max(0f, dcos);
// Compute sine and tangent terms of Oren--Nayar model
float sinalpha, tanbeta;
if (Math.Abs(CosTheta(ref lwi)) > Math.Abs(CosTheta(ref lwo)))
{
sinalpha = sinthetao;
tanbeta = sinthetai/Math.Abs(CosTheta(ref lwi));
}
else
{
sinalpha = sinthetai;
tanbeta = sinthetao/Math.Abs(CosTheta(ref lwo));
}
fs = R*MathLab.INVPI*
(A + B*maxcos*sinalpha*tanbeta);
#if VERBOSE
if (fs.IsNegative())
{
Tracer.TraceLine("OrenNayar - f - negative");
}
if (fs.IsBlack())
{
Tracer.TraceLine("OrenNayar - f - black");
}
#endif
}