Inviwo 0.9.12-pre
Inviwo documentation
|
#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 |
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.
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:
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.
void inviwo::TetraMeshBuffers::upload | ( | const TetraMesh & | mesh | ) |
Update the buffer contents of the Shader Storage Buffers on the GPU.
BufferObject inviwo::TetraMeshBuffers::nodeIdsBuffer |
A list of node/vertex IDs for each tetrahedron (ivec4). The faces opposite of each node are implicitly encoded.
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.
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.