File: SpotLightShared.h

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 (64 lines) | stat: -rw-r--r-- 1,625 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Copyright 2022 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include "IntensityDistributionShared.h"
#include "LightShared.h"

#ifdef __cplusplus
namespace ispc {
#endif // __cplusplus

// state that changes under transformations
struct SpotLightDynamic
{
  vec3f position;
  vec3f direction;
  vec3f c0;
  vec3f c90;

#ifdef __cplusplus
  SpotLightDynamic()
      : position(0.f),
        direction(0.f, 0.f, 1.f),
        c0(1.f, 0.f, 0.f),
        c90(0.f, 1.f, 0.f)
  {}
#endif // __cplusplus
};

struct SpotLight
{
  Light super;
  vec3f intensity; // RGB radiative intensity of the SpotLight
  vec3f radiance; // emitted RGB radiance
  float cosAngleMax; // Angular limit of the spot in an easier to use form:
                     // cosine of the half angle in radians
  float cosAngleScale; // 1/(cos(border of the penumbra area) - cosAngleMax);
                       // positive
  float radius; // defines the size of the DiskLight represented using
                // the (extended) SpotLight
  float innerRadius; // defines the size of the inner cut out of the DiskLight
                     // to represent a RingLight
  float areaPdf; // pdf of disk/ring with radius/innerRadius
  IntensityDistribution intensityDistribution;
  SpotLightDynamic pre; // un- or pre-transformed state

#ifdef __cplusplus
  SpotLight()
      : intensity(0.f),
        radiance(1.f),
        cosAngleMax(1.f),
        cosAngleScale(1.f),
        radius(0.f),
        innerRadius(0.f),
        areaPdf(inf)
  {
    super.type = LIGHT_TYPE_SPOT;
  }
};
} // namespace ispc
#else
};
#endif // __cplusplus