Fermat
mesh_lights.h
1 //
2 //Copyright (c) 2016 NVIDIA Corporation. All rights reserved.
3 //
4 //NVIDIA Corporation and its licensors retain all intellectual property and
5 //proprietary rights in and to this software, related documentation and any
6 //modifications thereto. Any use, reproduction, disclosure or distribution of
7 //this software and related documentation without an express license agreement
8 //from NVIDIA Corporation is strictly prohibited.
9 //
10 //TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
11 //*AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
12 //OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
13 //MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
14 //NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR
15 //CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR
16 //LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
17 //INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
18 //INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE
19 //POSSIBILITY OF SUCH DAMAGES
20 //
21 
22 #pragma once
23 
24 #include <lights.h>
25 #include <mesh/MeshView.h>
26 #include <cugar/basic/vector.h>
27 #include <cugar/bvh/bvh_node.h>
28 #include <vtl_mesh_view.h>
29 
30 struct RenderingContext;
31 
33 struct MeshVTLStorageImpl;
34 
35 struct FERMAT_API MeshLightsStorage
36 {
38 
39  void init(const uint32 n_vpls, MeshView h_mesh, MeshView d_mesh, const MipMapView* h_textures, const MipMapView* d_textures, const uint32 instance = 0);
40  void init(const uint32 n_vpls, RenderingContext& renderer, const uint32 instance = 0);
41 
42  MeshLight view(const bool use_vpls) const;
43 
44  uint32 get_vpl_count() const;
45  VPL* get_vpls() const;
46 
47  uint32 get_bvh_nodes_count() const;
48  uint32 get_bvh_clusters_count() const;
49 
50  const cugar::Bvh_node_3d* get_bvh_nodes() const;
51  const uint32* get_bvh_parents() const;
52  const uint2* get_bvh_ranges() const;
53  const uint32* get_bvh_clusters() const;
54  const uint32* get_bvh_cluster_offsets() const;
55 
56  MeshLightsStorageImpl* m_impl;
57 };
58 
59 struct FERMAT_API MeshVTLStorage
60 {
62 
63  void init(const uint32 n_vpls, MeshView h_mesh, MeshView d_mesh, const MipMapView* h_textures, const MipMapView* d_textures, const uint32 instance = 0);
64  void init(const uint32 n_vpls, RenderingContext& renderer, const uint32 instance = 0);
65 
66  VTLMeshView view() const;
67 
68  uint32 get_vtl_count() const;
69  VTL* get_vtls() const;
70 
71  uint32 get_bvh_nodes_count() const;
72  uint32 get_bvh_clusters_count() const;
73 
74  const cugar::Bvh_node_3d* get_bvh_nodes() const;
75  const uint32* get_bvh_parents() const;
76  const uint2* get_bvh_ranges() const;
77  const uint32* get_bvh_clusters() const;
78  const uint32* get_bvh_cluster_offsets() const;
79 
80  MeshVTLStorageImpl* m_impl;
81 };
Entry point to the generic Bounding Volume Hierarchy library.
Definition: bvh_node.h:80
Definition: lights.h:299
Definition: mesh_lights.h:59
Definition: lights.h:59
Definition: mesh_lights_impl.h:41
Definition: mesh_lights.h:35
Definition: vtl.h:44
Definition: vtl_mesh_view.h:40
Definition: MeshView.h:96
Definition: renderer.h:52
Definition: texture_view.h:73
Definition: mesh_lights_impl.h:80