Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::TetraMeshBuffers Struct Reference

#include <tetrameshbuffers.h>

Public Member Functions

void bind () const
 
void unbind () const
 
void upload (const TetraMesh &mesh)
 
void upload (const std::vector< vec4 > &nodes, const std::vector< ivec4 > &nodeIds, const std::vector< ivec4 > &opposingFaces)
 

Public Attributes

BufferObject nodesBuffer
 
BufferObject nodeIdsBuffer
 
BufferObject opposingFaceIdsBuffer
 

Detailed Description

This is an OpenGL representation of the data required for rendering tetrahedral meshes on the GPU using GLSL shaders. The data is stored in Shader Storage Buffers.

Member Function Documentation

◆ bind()

void inviwo::TetraMeshBuffers::bind ( ) const

Bind the Shader Storage Buffers and tie them to specific layout locations. They can then be accessed in the shader as follows:

struct VertexPosition {
vec3 pos;
float scalar;
};
layout(std430, binding=0) readonly buffer nodeBuffer {
VertexPosition vertexPositions[];
};
layout(std430, binding=1) readonly buffer nodeIdsBuffer {
ivec4 vertexIds[];
};
layout(std430, binding=2) readonly buffer opposingFaceIdsBuffer {
ivec4 faceIds[];
};
BufferObject nodeIdsBuffer
Definition tetrameshbuffers.h:99
BufferObject opposingFaceIdsBuffer
Definition tetrameshbuffers.h:105
See also
glBindBufferBase

◆ unbind()

void inviwo::TetraMeshBuffers::unbind ( ) const

Unbind the Shader Storage Buffer.

◆ upload() [1/2]

void inviwo::TetraMeshBuffers::upload ( const std::vector< vec4 > & nodes,
const std::vector< ivec4 > & nodeIds,
const std::vector< ivec4 > & opposingFaces )

Update the buffer contents of the Shader Storage Buffers on the GPU.

See also
upload(const TetraMesh&)

◆ upload() [2/2]

void inviwo::TetraMeshBuffers::upload ( const TetraMesh & mesh)

Update the buffer contents of the Shader Storage Buffers on the GPU.

Member Data Documentation

◆ nodeIdsBuffer

BufferObject inviwo::TetraMeshBuffers::nodeIdsBuffer

A list of node/vertex IDs for each tetrahedron (ivec4). The faces opposite of each node are implicitly encoded.

◆ nodesBuffer

BufferObject inviwo::TetraMeshBuffers::nodesBuffer

The nodes buffer holds the 3D coordinates of each node along with its scalar value (vec4). The scalar is stored in the w component.

◆ opposingFaceIdsBuffer

BufferObject inviwo::TetraMeshBuffers::opposingFaceIdsBuffer

The four IDs of the opposing half faces of a single tetrahedron are stored in an ivec4. The order matches the one of the nodeIds so that the corresponding node is the apex of the face. A negative index indicates a boundary face with no opposing half face.


The documentation for this struct was generated from the following file: