本文整理汇总了C#中ShadingState.traceTransparency方法的典型用法代码示例。如果您正苦于以下问题:C# ShadingState.traceTransparency方法的具体用法?C# ShadingState.traceTransparency怎么用?C# ShadingState.traceTransparency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShadingState
的用法示例。
在下文中一共展示了ShadingState.traceTransparency方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getRadiance
public Color getRadiance(ShadingState state)
{
// don't use these - gather lights for sphere of directions
// gather lights
state.initLightSamples();
state.initCausticSamples();
Vector3 v = state.getRay().getDirection();
v.negate();
Vector3 h = new Vector3();
Vector3 t = state.getBasis().transform(new Vector3(0, 1, 0));
Color diff = Color.black();
Color spec = Color.black();
foreach (LightSample ls in state)
{
Vector3 l = ls.getShadowRay().getDirection();
float dotTL = Vector3.dot(t, l);
float sinTL = (float)Math.Sqrt(1 - dotTL * dotTL);
// float dotVL = Vector3.dot(v, l);
diff.madd(sinTL, ls.getDiffuseRadiance());
Vector3.add(v, l, h);
h.normalize();
float dotTH = Vector3.dot(t, h);
float sinTH = (float)Math.Sqrt(1 - dotTH * dotTH);
float s = (float)Math.Pow(sinTH, 10.0f);
spec.madd(s, ls.getSpecularRadiance());
}
Color c = Color.add(diff, spec, new Color());
// transparency
return Color.blend(c, state.traceTransparency(), state.getV(), new Color());
}