本文整理汇总了C#中Scene.Intersects16方法的典型用法代码示例。如果您正苦于以下问题:C# Scene.Intersects16方法的具体用法?C# Scene.Intersects16怎么用?C# Scene.Intersects16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scene
的用法示例。
在下文中一共展示了Scene.Intersects16方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CoherentIntersect16
private static void CoherentIntersect16(Scene<Sphere> scene, int w, int h)
{
float invW = 1.0f / w, invH = 1.0f / h;
for (var y = 0; y < h; y += 4)
for (var x = 0; x < w; x += 4)
{
var rays = new[]
{
new Ray(Vector.Zero, new Vector((float)(x + 0) * invW, 1, (float)(y + 0) * invH)),
new Ray(Vector.Zero, new Vector((float)(x + 1) * invW, 1, (float)(y + 0) * invH)),
new Ray(Vector.Zero, new Vector((float)(x + 2) * invW, 1, (float)(y + 0) * invH)),
new Ray(Vector.Zero, new Vector((float)(x + 3) * invW, 1, (float)(y + 0) * invH)),
new Ray(Vector.Zero, new Vector((float)(x + 0) * invW, 1, (float)(y + 1) * invH)),
new Ray(Vector.Zero, new Vector((float)(x + 1) * invW, 1, (float)(y + 1) * invH)),
new Ray(Vector.Zero, new Vector((float)(x + 2) * invW, 1, (float)(y + 1) * invH)),
new Ray(Vector.Zero, new Vector((float)(x + 3) * invW, 1, (float)(y + 1) * invH)),
new Ray(Vector.Zero, new Vector((float)(x + 0) * invW, 1, (float)(y + 2) * invH)),
new Ray(Vector.Zero, new Vector((float)(x + 1) * invW, 1, (float)(y + 2) * invH)),
new Ray(Vector.Zero, new Vector((float)(x + 2) * invW, 1, (float)(y + 2) * invH)),
new Ray(Vector.Zero, new Vector((float)(x + 3) * invW, 1, (float)(y + 2) * invH)),
new Ray(Vector.Zero, new Vector((float)(x + 0) * invW, 1, (float)(y + 3) * invH)),
new Ray(Vector.Zero, new Vector((float)(x + 1) * invW, 1, (float)(y + 3) * invH)),
new Ray(Vector.Zero, new Vector((float)(x + 2) * invW, 1, (float)(y + 3) * invH)),
new Ray(Vector.Zero, new Vector((float)(x + 3) * invW, 1, (float)(y + 3) * invH)),
};
scene.Intersects16(rays);
}
}
示例2: IncoherentIntersect16
private static void IncoherentIntersect16(Scene<Sphere> scene, int nray, Ray[] rays)
{
for (var t = 0; t < nray / 16; ++t)
{
var rays2 = new[]
{
rays[t * 16 + 0],
rays[t * 16 + 1],
rays[t * 16 + 2],
rays[t * 16 + 3],
rays[t * 16 + 4],
rays[t * 16 + 5],
rays[t * 16 + 6],
rays[t * 16 + 7],
rays[t * 16 + 8],
rays[t * 16 + 9],
rays[t * 16 + 10],
rays[t * 16 + 11],
rays[t * 16 + 12],
rays[t * 16 + 13],
rays[t * 16 + 14],
rays[t * 16 + 15],
};
scene.Intersects16(rays2);
}
}