Quake II RTX doxygen  1.0 dev
physical_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 __PHYSICAL_SKY__
20 #define __PHYSICAL_SKY__
21 
22 
23 #include "vkpt.h"
24 
25 #include "shader/sky.h"
26 
27 //
28 // physical sun & sky
29 //
30 
31 // API
32 
33 void vkpt_evaluate_sun_light(sun_light_t* light, const vec3_t sky_matrix[3], float time);
34 
36 VkResult vkpt_physical_sky_destroy();
41 VkResult vkpt_physical_sky_record_cmd_buffer(VkCommandBuffer cmd_buf);
42 VkResult vkpt_physical_sky_update_ubo(QVKUniformBuffer_t * ubo, const sun_light_t* light, qboolean render_world);
46 
47 void InitialiseSkyCVars();
48 
50 
51 typedef struct PhysicalSkyDesc {
52  vec3_t sunColor; // sun color
53  float sunAngularDiameter; // size of sun in sky
54  vec3_t groundAlbedo; // ground albedo
55  uint32_t flags;
56  int preset; // SkyPreset
58 
59 PhysicalSkyDesc_t const * GetSkyPreset(uint16_t index);
60 
61 void CalculateDirectionToSun(float DayOfYear, float TimeOfDay, float LatitudeDegrees, vec3_t result);
62 
63 #endif // __PHYSICAL_SKY__
64 
sun_light_s
Definition: vkpt.h:414
vkpt_evaluate_sun_light
void vkpt_evaluate_sun_light(sun_light_t *light, const vec3_t sky_matrix[3], float time)
Definition: physical_sky.c:620
PhysicalSkyDesc
Definition: physical_sky.h:51
QVKUniformBuffer_s
Definition: global_ubo.h:247
CalculateDirectionToSun
void CalculateDirectionToSun(float DayOfYear, float TimeOfDay, float LatitudeDegrees, vec3_t result)
Definition: physical_sky.c:1041
vkpt_physical_sky_needs_update
qboolean vkpt_physical_sky_needs_update()
Definition: physical_sky.c:459
vkpt_physical_sky_record_cmd_buffer
VkResult vkpt_physical_sky_record_cmd_buffer(VkCommandBuffer cmd_buf)
Definition: physical_sky.c:467
InitialiseSkyCVars
void InitialiseSkyCVars()
Definition: physical_sky.c:881
PhysicalSkyDesc::sunAngularDiameter
float sunAngularDiameter
Definition: physical_sky.h:53
vkpt.h
vkpt_next_sun_preset
void vkpt_next_sun_preset()
Definition: physical_sky.c:603
vkpt_physical_sky_endRegistration
VkResult vkpt_physical_sky_endRegistration()
Definition: physical_sky.c:346
vkpt_physical_sky_destroy
VkResult vkpt_physical_sky_destroy()
Definition: physical_sky.c:315
vkpt_physical_sky_destroy_pipelines
VkResult vkpt_physical_sky_destroy_pipelines()
Definition: physical_sky.c:402
GetSkyPreset
const PhysicalSkyDesc_t * GetSkyPreset(uint16_t index)
Definition: physical_sky.c:986
vkpt_physical_sky_create_pipelines
VkResult vkpt_physical_sky_create_pipelines()
Definition: physical_sky.c:364
UpdatePhysicalSkyCVars
void UpdatePhysicalSkyCVars()
Definition: physical_sky.c:947
vkpt_physical_sky_beginRegistration
VkResult vkpt_physical_sky_beginRegistration()
Definition: physical_sky.c:338
PhysicalSkyDesc::flags
uint32_t flags
Definition: physical_sky.h:55
PhysicalSkyDesc::preset
int preset
Definition: physical_sky.h:56
sky.h
PhysicalSkyDesc::groundAlbedo
vec3_t groundAlbedo
Definition: physical_sky.h:54
vkpt_physical_sky_latch_local_time
void vkpt_physical_sky_latch_local_time()
Definition: physical_sky.c:75
vkpt_physical_sky_update_ubo
VkResult vkpt_physical_sky_update_ubo(QVKUniformBuffer_t *ubo, const sun_light_t *light, qboolean render_world)
Definition: physical_sky.c:774
PhysicalSkyDesc_t
struct PhysicalSkyDesc PhysicalSkyDesc_t
vkpt_physical_sky_initialize
VkResult vkpt_physical_sky_initialize()
Definition: physical_sky.c:249
PhysicalSkyDesc::sunColor
vec3_t sunColor
Definition: physical_sky.h:52