File: GeometryDispatch.ih

package info (click to toggle)
ospray 3.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,048 kB
  • sloc: cpp: 80,569; ansic: 951; sh: 805; makefile: 170; python: 69
file content (43 lines) | stat: -rw-r--r-- 1,857 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2022 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include "common/FeatureFlags.ih"

OSPRAY_BEGIN_ISPC_NAMESPACE

// Geometries are supposed to fill certain members of DifferentialGeometry:
// calculate Ng, Ns, st, color, and materialID if the respective bit DG_NG,
// DG_NS, DG_TEXCOORD, DG_COLOR, and DG_MATERIALID, in flags is set.
// Important with instancing: P and ray are in world-coordinates, whereas Ng
// and Ns are in object-coordinates and transformed to world-space by
// Instance_postIntersect.
// World::postIntersect already set the hit point P, color, geometry, and
// material before, and handles normalization/faceforwarding
// (DG_NORMALIZE/DG_FACEFORWARD) after Geometry_postIntersectFct is called.
// Thus the material pointer only needs to be set if different to
// geometry->material, or the color when different to vec4f(1.0f).
SYCL_EXTERNAL void Geometry_dispatch_postIntersect(const Geometry *uniform self,
    varying DifferentialGeometry &dg,
    const varying Ray &ray,
    uniform int64 flags,
    const uniform FeatureFlagsHandler &ffh);

// sample the given primitive uniformly wrt. area
SYCL_EXTERNAL SampleAreaRes Geometry_dispatch_sampleArea(
    const Geometry *const uniform,
    const int32 primID,
    const uniform affine3f &xfm, // instance transformation (obj2world)
    const uniform affine3f &rcp_xfm, // inverse transformation (world2obj)
    const vec2f &s, // random numbers to generate the sample
    const float time, // for deformation motion blur
    const uniform FeatureFlagsHandler &ffh);

RTC_SYCL_INDIRECTLY_CALLABLE unmasked void Geometry_dispatch_intersect(
    RTCIntersectFunctionNArguments *uniform args);

RTC_SYCL_INDIRECTLY_CALLABLE unmasked void Geometry_dispatch_occluded(
    RTCOccludedFunctionNArguments *uniform args);

OSPRAY_END_ISPC_NAMESPACE