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
51
53{
57 // Math::bbox boundingBox; TODO: ADD THIS
58
59 uint firstMeshlet; // Offset to first meshlet (optional)
60 uint numMeshlets; // Number of meshlets for this primitive group
61};
62
69
70
78
79namespace Nvx3
80{
81 void FillNvx3Elements(char* basePointer, Nvx3Header* header, Nvx3Elements& OutElements);
82};
83
84#pragma pack(pop)
85
86
87
88namespace Nvx3
89{
90
91//------------------------------------------------------------------------------
94inline void
95FillNvx3Elements(char* basePointer, Nvx3Header* header, Nvx3Elements& OutElements)
96{
97 n_assert(header != nullptr);
98 OutElements.ranges = (CoreGraphics::Nvx3VertexRange*)(basePointer + header->meshDataOffset);
99 OutElements.vertexData = (ubyte*)(basePointer + header->vertexDataOffset);
100 OutElements.indexData = (ubyte*)(basePointer + header->indexDataOffset);
101 OutElements.meshlets = (CoreGraphics::Nvx3Meshlet*)(basePointer + header->meshletDataOffset);
102}
103
104} // namespace Nvx3
105
106} // namespace CoreGraphics
Code
index types enum
Definition indextype.h:22
#define n_assert(exp)
Definition debug.h:50
Definition nvx3fileformatstructs.h:80
void FillNvx3Elements(char *basePointer, Nvx3Header *header, Nvx3Elements &OutElements)
Definition nvx3fileformatstructs.h:95
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:72
ubyte * vertexData
Definition nvx3fileformatstructs.h:74
CoreGraphics::Nvx3VertexRange * ranges
Definition nvx3fileformatstructs.h:73
ubyte * indexData
Definition nvx3fileformatstructs.h:75
CoreGraphics::Nvx3Meshlet * meshlets
Definition nvx3fileformatstructs.h:76
Definition nvx3fileformatstructs.h:53
uint numMeshlets
Definition nvx3fileformatstructs.h:60
uint firstIndex
Definition nvx3fileformatstructs.h:55
uint numIndices
Definition nvx3fileformatstructs.h:56
uint firstMeshlet
Definition nvx3fileformatstructs.h:59
uint primType
Definition nvx3fileformatstructs.h:54
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:64
uint firstIndex
Definition nvx3fileformatstructs.h:66
uint indexOffset
Definition nvx3fileformatstructs.h:65
uint numIndices
Definition nvx3fileformatstructs.h:67
Definition nvx3fileformatstructs.h:41
uint firstGroupOffset
Definition nvx3fileformatstructs.h:45
CoreGraphics::VertexLayoutType layout
Definition nvx3fileformatstructs.h:49
uint numGroups
Definition nvx3fileformatstructs.h:46
uint baseVertexByteOffset
Definition nvx3fileformatstructs.h:43
uint attributesVertexByteOffset
Definition nvx3fileformatstructs.h:44
CoreGraphics::IndexType::Code indexType
Definition nvx3fileformatstructs.h:48
uint indexByteOffset
Definition nvx3fileformatstructs.h:42
unsigned char ubyte
Definition types.h:36
unsigned int uint
Definition types.h:33