PointCloudPoint
GPU point record, 16 bytes, read by PointCloud.hlsl as one uint4: x | y<<16 position, chunk-local, kPositionQuantum steps z | octX<<16 | octY<<24 octahedral normal birth | intensity<<16 | flags<<24 range:3 | material:4 | owner:3 | page:22 There is no colour. What a point looks like is derived in the shader from range, material, owner, intensity and age, so recolouring the cloud — a colour-blind palette, an owner tint — never touches a point.
- Module
- SceneTypes
- Header
#include "SceneTypes/Components/PointCloudComponent.h"- Namespace
Mowo
Properties
| Type | Name | Description |
|---|---|---|
uint16_t | x | Default 0. |
uint16_t | y | Default 0. |
uint16_t | z | Default 0. |
uint8_t | octX | Default 128. |
uint8_t | octY | Default 255. |
uint16_t | birth | Default 0. |
uint8_t | intensity | Default 255. |
uint8_t | flags | Default 0. |
uint32_t | bits | Default 0. |
Public functions
| Returns | Name | Description |
|---|---|---|
uint32_t | GetRange | |
uint32_t | GetMaterial | |
uint32_t | GetOwner | |
uint32_t | GetPage | |
void | SetRange | |
void | SetMaterial | |
void | SetOwner | |
void | SetPage | |
bool | HasFlag | |
PointCloudPoint | WithoutPage | The page says where a record sits in this machine's GPU pool, which two machines holding the same cloud assign differently; everything else is the point itself. |
bool | SameContent | |
uint16_t | QuantizeAxis | In double, from the world coordinate and the chunk corner, against the exact step count: a float subtraction across the origin (-0.3 - -8) and a float divide by the rounded quantum each push the error past the half-step bound by a fraction of a percent. |
float | DequantizeAxis | |
Vec3 | LocalPosition | |
void | EncodeOctahedral | Octahedral: the unit sphere folded onto a square, eight bits a side. |
Vec3 | DecodeOctahedral | |
Vec3 | Normal |
Function details
GetRange
uint32_t GetRange() constGetMaterial
uint32_t GetMaterial() constGetOwner
uint32_t GetOwner() constGetPage
uint32_t GetPage() constSetRange
void SetRange(uint32_t value)SetMaterial
void SetMaterial(uint32_t value)SetOwner
void SetOwner(uint32_t value)SetPage
void SetPage(uint32_t value)HasFlag
bool HasFlag(EPointCloudFlag flag) constWithoutPage
PointCloudPoint WithoutPage() constThe page says where a record sits in this machine's GPU pool, which two machines holding the same cloud assign differently; everything else is the point itself.
SameContent
bool SameContent(const PointCloudPoint& other) constQuantizeAxis
static uint16_t QuantizeAxis(float world, float origin)In double, from the world coordinate and the chunk corner, against the exact step count: a float subtraction across the origin (-0.3 - -8) and a float divide by the rounded quantum each push the error past the half-step bound by a fraction of a percent.
DequantizeAxis
static float DequantizeAxis(uint16_t steps)LocalPosition
Vec3 LocalPosition() constEncodeOctahedral
static void EncodeOctahedral(const Vec3& normal, uint8_t& outX, uint8_t& outY)Octahedral: the unit sphere folded onto a square, eight bits a side. A point needs its normal only for direction (the displacement along it, the eye-dome term), and at this size the worst-case error is about a degree and a half.
DecodeOctahedral
static Vec3 DecodeOctahedral(uint8_t encodedX, uint8_t encodedY)Normal
Vec3 Normal() const