File: LightDispatch.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 (40 lines) | stat: -rw-r--r-- 1,535 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
// Copyright 2022 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include "common/FeatureFlags.ih"
#include "common/OSPCommon.ih"
#include "rkcommon/math/vec.ih"
// c++ shared
#include "LightShared.h"

OSPRAY_BEGIN_ISPC_NAMESPACE

struct Light;
struct DifferentialGeometry;

// compute the weighted radiance at a point caused by a sample on the light
// source
// by convention, giving (0, 0) as "random" numbers should sample the "center"
// of the light source (used by the raytracing renderers such as the SciVis
// renderer)
SYCL_EXTERNAL __noinline Light_SampleRes Light_dispatch_sample(
    const Light *uniform self,
    const DifferentialGeometry &dg, // point (&normal) to generate the sample
    const vec2f &s, // random numbers to generate the sample
    const float time, // generate the sample at time (motion blur)
    const uniform FeatureFlagsHandler &ffh);

//! compute the radiance and pdf caused by the light source (pointed to by the
//! given direction up until maxDist)
SYCL_EXTERNAL __noinline Light_EvalRes Light_dispatch_eval(
    const Light *uniform self,
    const DifferentialGeometry &dg, // point to evaluate illumination for
    const vec3f &dir, // direction towards the light source, normalized
    const float minDist, // minimum distance to look for light contribution
    const float maxDist, // maximum distance to look for light contribution
    const float time, // evaluate at time (motion blur)
    const uniform FeatureFlagsHandler &ffh);

OSPRAY_END_ISPC_NAMESPACE