Quake II RTX doxygen  1.0 dev
precomputed_sky.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2019, NVIDIA CORPORATION. All rights reserved.
3 
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18 
19 #ifndef __PRECOMPUTED_SKY_H__
20 #define __PRECOMPUTED_SKY_H__
21 
22 static const uint32_t ShadowmapSize = 2048; // Heightmap dimension vertical and horizontal
23 static const uint32_t ShadowmapHeightmapSize = 4096; // Heightmap dimension vertical and horizontal
24 static const uint32_t ShadowmapGridSize = 1024; // Size of the polygonal grid, in squares. Squares made of two triangles
25 static const float ShadowmapWorldSize = 30.0f; // World size of the grid
26 static const float ShadowmapWorldElevation = 3.0f; // Heightmap world height coefficient
27 
28 typedef enum
29 {
33 } SkyPreset;
34 
35 /*-----------------------------------------------------------------------------
36  Structures for sky constant buffer
37 -----------------------------------------------------------------------------*/
38 
40 {
41  float solar_irradiance[3];
43 
46 
47  float mie_scattering[3];
48  float top_radius;
49 
53  float reserved;
54 };
55 
56 
57 VkResult SkyInitializeDataGPU();
58 void SkyReleaseDataGPU();
60 VkResult SkyLoadScatterParameters(SkyPreset preset);
61 
62 VkDescriptorSetLayout* SkyGetDescriptorLayout();
63 VkDescriptorSet SkyGetDescriptorSet();
64 
65 void RecordCommandBufferShadowmap(VkCommandBuffer cmd_buf);
66 
69 #endif /*__PRECOMPUTED_SKY_H__*/
AtmosphereParameters::SqDistanceToHorizontalBoundary
float SqDistanceToHorizontalBoundary
Definition: precomputed_sky.h:51
AtmosphereParameters
Definition: precomputed_sky.h:39
RecordCommandBufferShadowmap
void RecordCommandBufferShadowmap(VkCommandBuffer cmd_buf)
Definition: precomputed_sky.c:991
AtmosphereParameters::sun_angular_radius
float sun_angular_radius
Definition: precomputed_sky.h:42
AtmosphereParameters::AtmosphereHeight
float AtmosphereHeight
Definition: precomputed_sky.h:52
SkyInitializeDataGPU
VkResult SkyInitializeDataGPU()
Definition: precomputed_sky.c:597
AtmosphereParameters::bottom_radius
float bottom_radius
Definition: precomputed_sky.h:45
AtmosphereParameters::rayleigh_scattering
float rayleigh_scattering[3]
Definition: precomputed_sky.h:44
AtmosphereParameters::top_radius
float top_radius
Definition: precomputed_sky.h:48
AtmosphereParameters::mie_scattering
float mie_scattering[3]
Definition: precomputed_sky.h:47
SKY_NONE
@ SKY_NONE
Definition: precomputed_sky.h:30
AtmosphereParameters::reserved
float reserved
Definition: precomputed_sky.h:53
ShadowmapHeightmapSize
static const uint32_t ShadowmapHeightmapSize
Definition: precomputed_sky.h:23
forward
static vec3_t forward
Definition: p_view.c:27
SkyGetDescriptorLayout
VkDescriptorSetLayout * SkyGetDescriptorLayout()
Definition: precomputed_sky.c:356
ShadowmapSize
static const uint32_t ShadowmapSize
Definition: precomputed_sky.h:22
InitializeShadowmapResources
void InitializeShadowmapResources()
Definition: precomputed_sky.c:975
AtmosphereParameters::mie_phase_function_g
float mie_phase_function_g
Definition: precomputed_sky.h:50
ShadowmapWorldElevation
static const float ShadowmapWorldElevation
Definition: precomputed_sky.h:26
SkyReleaseDataGPU
void SkyReleaseDataGPU()
Definition: precomputed_sky.c:610
SKY_EARTH
@ SKY_EARTH
Definition: precomputed_sky.h:31
AtmosphereParameters::solar_irradiance
float solar_irradiance[3]
Definition: precomputed_sky.h:41
UpdateTerrainShadowMapView
void UpdateTerrainShadowMapView(vec3_t forward)
Definition: precomputed_sky.c:550
ShadowmapGridSize
static const uint32_t ShadowmapGridSize
Definition: precomputed_sky.h:24
ReleaseShadowmapResources
void ReleaseShadowmapResources()
Definition: precomputed_sky.c:981
ShadowmapWorldSize
static const float ShadowmapWorldSize
Definition: precomputed_sky.h:25
SKY_STROGGOS
@ SKY_STROGGOS
Definition: precomputed_sky.h:32
SkyGetDescriptorSet
VkDescriptorSet SkyGetDescriptorSet()
Definition: precomputed_sky.c:361
SkyPreset
SkyPreset
Definition: precomputed_sky.h:28
SkyLoadScatterParameters
VkResult SkyLoadScatterParameters(SkyPreset preset)
Definition: precomputed_sky.c:565