载入中...
搜索中...
未找到
SparseVolumeTexture.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
6
7#include <cstddef>
8#include <cstdint>
9#include <string>
10#include <unordered_map>
11#include <vector>
12
13namespace eve::graphics {
14
15class VolumeDensityGraph;
16
19public:
21 void resize(int width, int height, int depth, int brickSize = 8);
23 void clear();
24
26 int getWidth() const { return width_; }
28 int getHeight() const { return height_; }
30 int getDepth() const { return depth_; }
32 int getBrickSize() const { return brickSize_; }
34 std::size_t getBrickCount() const { return bricks_.size(); }
36 std::size_t getAllocatedVoxelCount() const;
37
39 void setVoxel(int x, int y, int z, const FogFroxel &voxel);
41 FogFroxel getVoxel(int x, int y, int z) const;
43 FogFroxel sample(float u, float v, float w) const;
44
46 void bake(const VolumeDensityGraph &graph, const glm::vec3 &worldMin,
47 const glm::vec3 &worldMax, float extinctionScale, const glm::vec3 &albedo,
48 float emptyThreshold = 1e-5f, float time = 0.f);
49
51 bool save(const std::string &path) const;
53 bool load(const std::string &path);
54
55private:
56 struct Brick {
57 std::vector<FogFroxel> voxels;
58 };
59
60 std::uint64_t brickKey(int bx, int by, int bz) const;
61 std::size_t localIndex(int x, int y, int z) const;
62 bool inBounds(int x, int y, int z) const;
63
64 int width_ = 0;
65 int height_ = 0;
66 int depth_ = 0;
67 int brickSize_ = 8;
68 std::unordered_map<std::uint64_t, Brick> bricks_;
69};
70
71} // namespace eve::graphics
float w
Definition AnimClip.cpp:738
float y
Definition AnimClip.cpp:738
float x
Definition AnimClip.cpp:738
float z
Definition AnimClip.cpp:738
int bz
Definition CaveMesh.cpp:114
int bx
Definition CaveMesh.cpp:114
int by
Definition CaveMesh.cpp:114
graphics::Texture * albedo
#define EVENGINE_API_BACKENDS
Definition Export.h:108
float u
Definition Grass.cpp:233
float v
std::uint32_t height
std::uint32_t width
std::map< std::string, std::vector< std::string > > graph
Definition Package.cpp:59
std::string path
Definition PlayHost.cpp:110
std::uint32_t depth
Brick-sparse, pre-bakeable participating-media texture.
int getWidth() const
Returns the width.
int getHeight() const
Returns the height.
std::size_t getBrickCount() const
Returns the brick count.
int getDepth() const
Returns the depth.
int getBrickSize() const
Returns the brick size.
Compact acyclic program that evaluates procedural volume density.
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
Participating-media coefficients stored in one froxel.