Nebula
Loading...
Searching...
No Matches
nvx3fileformatstructs.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
11#include "core/types.h"
15
16namespace CoreGraphics
17{
18
19#define NEBULA_NVX_MAGICNUMBER 'NVX3'
20
21#pragma pack(push, 1)
22
23//------------------------------------------------------------------------------
28{
31 uint numMeshes; // The number of Nvx3Mesh structs
37 uint indexDataSize; // The total byte size of the index data for all meshes
38};
39
41{
42 float min[3];
43 float max[3];
44};
45
57
59{
64
65 uint firstMeshlet; // Offset to first meshlet (optional)
66 uint numMeshlets; // Number of meshlets for this primitive group
67};
68
75
76
84
85namespace Nvx3
86{
87 void FillNvx3Elements(char* basePointer, Nvx3Header* header, Nvx3Elements& OutElements);
88};
89
90#pragma pack(pop)
91
92
93
94namespace Nvx3
95{
96
97//------------------------------------------------------------------------------
100inline void
101FillNvx3Elements(char* basePointer, Nvx3Header* header, Nvx3Elements& OutElements)
102{
103 n_assert(header != nullptr);
104 OutElements.ranges = (CoreGraphics::Nvx3VertexRange*)(basePointer + header->meshDataOffset);
105 OutElements.vertexData = (ubyte*)(basePointer + header->vertexDataOffset);
106 OutElements.indexData = (ubyte*)(basePointer + header->indexDataOffset);
107 OutElements.meshlets = (CoreGraphics::Nvx3Meshlet*)(basePointer + header->meshletDataOffset);
108}
109
110} // namespace Nvx3
111
112} // namespace CoreGraphics
Code
index types enum
Definition indextype.h:22
#define n_assert(exp)
Definition debug.h:58
Definition nvx3fileformatstructs.h:86
void FillNvx3Elements(char *basePointer, Nvx3Header *header, Nvx3Elements &OutElements)
Definition nvx3fileformatstructs.h:101
Acceleration structures are used to enable ray tracing on the GPU by dividing the scene into a BVH.
Definition accelerationstructure.h:24
VertexLayoutType
Definition vertexlayout.h:49
Definition nvx3fileformatstructs.h:41
float min[3]
Definition nvx3fileformatstructs.h:42
float max[3]
Definition nvx3fileformatstructs.h:43
Definition nvx3fileformatstructs.h:78
ubyte * vertexData
Definition nvx3fileformatstructs.h:80
CoreGraphics::Nvx3VertexRange * ranges
Definition nvx3fileformatstructs.h:79
ubyte * indexData
Definition nvx3fileformatstructs.h:81
CoreGraphics::Nvx3Meshlet * meshlets
Definition nvx3fileformatstructs.h:82
Definition nvx3fileformatstructs.h:59
Nvx3BBox boundingBox
Definition nvx3fileformatstructs.h:63
uint numMeshlets
Definition nvx3fileformatstructs.h:66
uint firstIndex
Definition nvx3fileformatstructs.h:61
uint numIndices
Definition nvx3fileformatstructs.h:62
uint firstMeshlet
Definition nvx3fileformatstructs.h:65
uint primType
Definition nvx3fileformatstructs.h:60
NVX3 file format structs.
Definition nvx3fileformatstructs.h:28
uint numMeshlets
Definition nvx3fileformatstructs.h:33
uint vertexDataOffset
Definition nvx3fileformatstructs.h:34
uint indexDataOffset
Definition nvx3fileformatstructs.h:36
uint indexDataSize
Definition nvx3fileformatstructs.h:37
uint vertexDataSize
Definition nvx3fileformatstructs.h:35
uint magic
Definition nvx3fileformatstructs.h:29
uint meshDataOffset
Definition nvx3fileformatstructs.h:30
uint meshletDataOffset
Definition nvx3fileformatstructs.h:32
uint numMeshes
Definition nvx3fileformatstructs.h:31
Definition nvx3fileformatstructs.h:70
uint firstIndex
Definition nvx3fileformatstructs.h:72
uint indexOffset
Definition nvx3fileformatstructs.h:71
uint numIndices
Definition nvx3fileformatstructs.h:73
Definition nvx3fileformatstructs.h:47
uint firstGroupOffset
Definition nvx3fileformatstructs.h:51
CoreGraphics::VertexLayoutType layout
Definition nvx3fileformatstructs.h:55
uint numGroups
Definition nvx3fileformatstructs.h:52
uint baseVertexByteOffset
Definition nvx3fileformatstructs.h:49
uint attributesVertexByteOffset
Definition nvx3fileformatstructs.h:50
CoreGraphics::IndexType::Code indexType
Definition nvx3fileformatstructs.h:54
uint indexByteOffset
Definition nvx3fileformatstructs.h:48
unsigned char ubyte
Definition types.h:36
unsigned int uint
Definition types.h:33