File: PathTracerData.h

package info (click to toggle)
ospray 3.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 10,040 kB
  • sloc: cpp: 80,569; ansic: 951; sh: 805; makefile: 171; python: 69
file content (47 lines) | stat: -rw-r--r-- 1,179 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
// Copyright 2022 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include "common/StructShared.h"
#include "render/RendererData.h"
// ispc shared
#include "PathTracerDataShared.h"

namespace ospray {

struct World;
struct Instance;
struct GeometricModel;
struct Renderer;

struct PathTracerData
    : public AddStructShared<RendererData, ispc::PathTracerData>
{
  PathTracerData(const World &world,
      bool importanceSampleGeometryLights,
      const Renderer &renderer);
  ~PathTracerData() override;

  bool scannedForGeometryLights{false};

 private:
  ispc::Light *createGeometryLight(const Instance *instance,
      const GeometricModel *model,
      const int32 numPrimIDs,
      const std::vector<int> &primIDs,
      const std::vector<float> &distribution,
      float pdf);

  void generateGeometryLights(const World &world,
      const Renderer &renderer,
      std::vector<ispc::Light *> &lightShs);

  BufferSharedUq<ispc::Light *> lightArray;
  BufferSharedUq<float> lightCDFArray;

  std::vector<devicert::BufferShared<int>> geoLightPrimIDArray;
  std::vector<devicert::BufferShared<float>> geoLightDistrArray;
};

} // namespace ospray