Cogs.Core
DensityFieldTask.h
1#pragma once
2
3#include "Resources/Resources.h"
4#include "Resources/Buffer.h"
5
6#include "Foundation/Memory/MemoryBuffer.h"
7
8namespace Cogs::Core
9{
10 class Context;
11}
12
13namespace Cogs::Core::Volumetric
14{
15 struct DensityFieldComponent;
16 struct DensityFieldData;
17 struct PointDataData;
18
19 struct Point
20 {
21 glm::uvec3 ix;
22 float data;
23 };
24
26 {
27 Context * context;
28 std::vector<float> thresholds;
29 glm::uvec3 resolution;
30 bool dataAttached;
31 float densityWeight;
32 float boxFilterWidth;
33 uint32_t boxFilterIterations;
34 glm::vec3 extentMin;
35 glm::vec3 extentMax;
36
37 std::vector<float> rData;
38 std::vector<glm::vec3> rPositions;
39 float attachedDataScale = 1.f;
40 float attachedDataOffset = 0.f;
41
42 Memory::TypedBuffer<float> densityField;
43 Memory::TypedBuffer<float> densityFieldOut;
45 Memory::TypedBuffer<float> dataFieldOut;
46 std::vector<Point> points;
47
48 MeshHandle mesh;
49
50 void update(Context * context,
51 DensityFieldComponent &fieldComp,
52 DensityFieldData& fieldData,
53 BufferView<glm::vec3> positions,
55 };
56
58 {
59 std::shared_ptr<DensityFieldTaskData> persistentData;
60 void operator()();
61 };
62}
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
BufferView provides a typed, reference-counted, span of an underlying buffer resource.
Definition: Buffer.h:118