Bicameral Engine
GPU-resident engine for a magic-research open-world game
Loading...
Searching...
No Matches
probe_view_constants.h
Go to the documentation of this file.
1
// probe_view_constants.h — デバッグ表示(render/probe_view)のフレームの定数。CPU がフレームごとにアップロードのバッファへ書き、
2
// shaders/render/probe_view.hlsl が ByteAddressBuffer で読む(並びと値の意味は両方で同じにする)。D3D12 に依存しない(単体テストから使う)。
3
#pragma once
4
5
#include <array>
6
#include <cstdint>
7
8
namespace
bicameral::render
{
9
10
// 表示の仕方(probe_view.hlsl の VIEW_MODE_*)
11
enum class
DebugViewMode
: uint8_t {
12
Volume
= 0,
// 吸収と発光(熱い所ほど明るく、濃い)
13
MaximumProjection
= 1,
// 光線の上の最大値(どこに熱があるか)
14
Slice
= 2,
// 断面だけ
15
};
16
17
// 色分けする量(probe_view.hlsl の VIEW_QUANTITY_*。T-0089)
18
enum class
DebugViewQuantity
: uint8_t {
19
Temperature
= 0,
// 300 K より上の分
20
OxygenDepletion
= 1,
// 空気の O2 からの減り
21
CarbonDioxide
= 2,
22
Carbon
= 3,
// 炭
23
};
24
25
inline
constexpr
uint32_t
DEBUG_VIEW_QUANTITY_COUNT
= 4;
26
27
// flags のビット(probe_view.hlsl の VIEW_FLAG_*)。ビット 8〜9 は色分けする量、16〜19 は潜っている段
28
inline
constexpr
uint32_t
VIEW_FLAG_ACTIVE_BLOCKS
= 1u << 0;
// 活性なブロックを重ねる
29
inline
constexpr
uint32_t
VIEW_FLAG_LOGARITHMIC
= 1u << 1;
// 色は対数(無ければ線形)
30
inline
constexpr
uint32_t
VIEW_QUANTITY_SHIFT
= 8;
31
inline
constexpr
uint32_t
32
VIEW_PEEK_DEPTH_SHIFT
= 16;
// ビット 16〜19 = 覗き窓で潜っている段(0 = 潜っていない。T-0096)
33
34
// 並びは probe_view.hlsl の LoadConstants と同じにする(16 バイトずつ読む)
35
struct
ProbeViewConstants
{
36
// --- 何をどこに描くか ---
37
uint32_t
extractionIndex
= 0;
// 読む抽出(0〜2)
38
uint32_t
width
= 0;
// 描く大きさ(画素)
39
uint32_t
height
= 0;
40
uint32_t
flags
= 0;
// VIEW_FLAG_* の組み合わせ
41
42
// --- 表示の仕方 ---
43
uint32_t
mode
= 0;
// DebugViewMode
44
uint32_t
sliceAxis
= 2;
// 断面の軸(0 = x・1 = y・2 = z)
45
uint32_t
slicePosition
= 0;
// 断面のセルの番号(クリックがつつく面)
46
47
// --- カメラ(render/debug_camera.h の CameraBasis。w は使わない)---
48
uint32_t
orthographic
= 0;
// 平行投影なら 1(0 なら透視)
49
std::array<float, 4>
position
{};
50
std::array<float, 4>
forward
{};
51
std::array<float, 4>
right
{};
52
std::array<float, 4>
up
{};
53
};
54
55
static_assert
(
sizeof
(ProbeViewConstants) == 96,
"probe_view.hlsl の読み方と合わせる"
);
56
57
}
// namespace bicameral::render
bicameral::render
Definition
debug_camera.cpp:9
bicameral::render::VIEW_FLAG_LOGARITHMIC
constexpr uint32_t VIEW_FLAG_LOGARITHMIC
Definition
probe_view_constants.h:29
bicameral::render::DebugViewMode
DebugViewMode
Definition
probe_view_constants.h:11
bicameral::render::DebugViewMode::Volume
@ Volume
Definition
probe_view_constants.h:12
bicameral::render::DebugViewMode::Slice
@ Slice
Definition
probe_view_constants.h:14
bicameral::render::DebugViewMode::MaximumProjection
@ MaximumProjection
Definition
probe_view_constants.h:13
bicameral::render::DebugViewQuantity
DebugViewQuantity
Definition
probe_view_constants.h:18
bicameral::render::DebugViewQuantity::OxygenDepletion
@ OxygenDepletion
Definition
probe_view_constants.h:20
bicameral::render::DebugViewQuantity::Temperature
@ Temperature
Definition
probe_view_constants.h:19
bicameral::render::DebugViewQuantity::CarbonDioxide
@ CarbonDioxide
Definition
probe_view_constants.h:21
bicameral::render::DebugViewQuantity::Carbon
@ Carbon
Definition
probe_view_constants.h:22
bicameral::render::VIEW_PEEK_DEPTH_SHIFT
constexpr uint32_t VIEW_PEEK_DEPTH_SHIFT
Definition
probe_view_constants.h:32
bicameral::render::VIEW_QUANTITY_SHIFT
constexpr uint32_t VIEW_QUANTITY_SHIFT
Definition
probe_view_constants.h:30
bicameral::render::VIEW_FLAG_ACTIVE_BLOCKS
constexpr uint32_t VIEW_FLAG_ACTIVE_BLOCKS
Definition
probe_view_constants.h:28
bicameral::render::DEBUG_VIEW_QUANTITY_COUNT
constexpr uint32_t DEBUG_VIEW_QUANTITY_COUNT
Definition
probe_view_constants.h:25
bicameral::render::ProbeViewConstants
Definition
probe_view_constants.h:35
bicameral::render::ProbeViewConstants::extractionIndex
uint32_t extractionIndex
Definition
probe_view_constants.h:37
bicameral::render::ProbeViewConstants::width
uint32_t width
Definition
probe_view_constants.h:38
bicameral::render::ProbeViewConstants::forward
std::array< float, 4 > forward
Definition
probe_view_constants.h:50
bicameral::render::ProbeViewConstants::flags
uint32_t flags
Definition
probe_view_constants.h:40
bicameral::render::ProbeViewConstants::mode
uint32_t mode
Definition
probe_view_constants.h:43
bicameral::render::ProbeViewConstants::up
std::array< float, 4 > up
Definition
probe_view_constants.h:52
bicameral::render::ProbeViewConstants::height
uint32_t height
Definition
probe_view_constants.h:39
bicameral::render::ProbeViewConstants::right
std::array< float, 4 > right
Definition
probe_view_constants.h:51
bicameral::render::ProbeViewConstants::orthographic
uint32_t orthographic
Definition
probe_view_constants.h:48
bicameral::render::ProbeViewConstants::slicePosition
uint32_t slicePosition
Definition
probe_view_constants.h:45
bicameral::render::ProbeViewConstants::position
std::array< float, 4 > position
Definition
probe_view_constants.h:49
bicameral::render::ProbeViewConstants::sliceAxis
uint32_t sliceAxis
Definition
probe_view_constants.h:44
engine
src
render
probe_view_constants.h
Generated by
1.15.0