Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
GFXShaderData.h
Go to the documentation of this file.
1/*
2Copyright (c) 2018 DIVIDE-Studio
3Copyright (c) 2009 Ionut Cava
4
5This file is part of DIVIDE Framework.
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software
9and associated documentation files (the "Software"), to deal in the Software
10without restriction,
11including without limitation the rights to use, copy, modify, merge, publish,
12distribute, sublicense,
13and/or sell copies of the Software, and to permit persons to whom the
14Software is furnished to do so,
15subject to the following conditions:
16
17The above copyright notice and this permission notice shall be included in
18all copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21IMPLIED,
22INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23PARTICULAR PURPOSE AND NONINFRINGEMENT.
24IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25DAMAGES OR OTHER LIABILITY,
26WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27IN CONNECTION WITH THE SOFTWARE
28OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30*/
31
32#pragma once
33#ifndef DVD_HARDWARE_VIDEO_GFX_SHADER_DATA_H_
34#define DVD_HARDWARE_VIDEO_GFX_SHADER_DATA_H_
35
36#include "config.h"
37
38namespace Divide {
39
40enum class RenderStage : U8;
41
43#pragma pack(push, 1)
44 struct CamData {
49 vec4<F32> _viewPort = { 0.0f, 0.0f, 1.0f, 1.0f };
50 // x - scale, y - bias, z - light bleed bias, w - min shadow variance
51 vec4<F32> _lightingTweakValues = { 1.f, 1.f, 0.2f, 0.001f};
52 //x - nearPlane, y - farPlane, z - FoV, w - clip plane count
53 vec4<F32> _cameraProperties = { 0.01f, 1.0f, 40.f, 0.f };
54 //xy - depth range, zw - light cluster size X / Y
55 vec4<F32> _renderTargetInfo{0.f, 1.f, 1.f, 1.f};
59#pragma pack(pop)
60
62 {
67
68 bool _camNeedsUpload = true;
69};
70
71[[nodiscard]] F32 AspectRatio(const GFXShaderData::CamData& dataIn) noexcept;
72[[nodiscard]] vec2<F32> CameraZPlanes(const GFXShaderData::CamData& dataIn) noexcept;
73[[nodiscard]] F32 FoV(const GFXShaderData::CamData& dataIn) noexcept;
74
75[[nodiscard]] bool ValidateGPUDataStructure() noexcept;
76}; //namespace Divide
77
78#endif //DVD_HARDWARE_VIDEO_GFX_SHADER_DATA_H_
79
80#include "GFXShaderData.inl"
constexpr U8 MAX_LOCAL_PLAYER_COUNT
Maximum number of players we support locally. We store per-player data such as key-bindings,...
Definition: config.h:144
constexpr U8 MAX_CLIP_DISTANCES
Definition: config.h:127
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
F32 AspectRatio(const GFXShaderData::CamData &dataIn) noexcept
uint8_t U8
vec2< F32 > CameraZPlanes(const GFXShaderData::CamData &dataIn) noexcept
F32 FoV(const GFXShaderData::CamData &dataIn) noexcept
bool ValidateGPUDataStructure() noexcept
static const mat4< F32 > MAT4_IDENTITY
Definition: MathMatrices.h:740
vec4< F32 > _clipPlanes[Config::MAX_CLIP_DISTANCES]
Definition: GFXShaderData.h:56
struct Divide::GFXShaderData::CamData _camData
struct Divide::GFXShaderData::PrevFrameData _prevFrameData[Config::MAX_LOCAL_PLAYER_COUNT]