Path Tracing
Loading...
Searching...
No Matches
GPUVertex Struct Reference

#include <mesh.hpp>

Public Attributes

vec3 position
float _pad0
vec3 normal
float _pad1
vec2 texcoord
vec2 _pad2
vec4 tangent
glm::vec3 position
glm::vec3 normal
glm::vec2 texcoord
glm::vec2 _pad2
glm::vec4 tangent

Detailed Description

Warning
Adding tangent here increases GPUTriangle from 160 to 208 bytes. This will increase VRAM usage by ~30%.
Todo
Might as well use the pre-calculated size to warn if the GPU can't handle it.

Member Data Documentation

◆ _pad0

float GPUVertex::_pad0

◆ _pad1

float GPUVertex::_pad1

◆ _pad2 [1/2]

vec2 GPUVertex::_pad2

◆ _pad2 [2/2]

glm::vec2 GPUVertex::_pad2

◆ normal [1/2]

vec3 GPUVertex::normal

◆ normal [2/2]

glm::vec3 GPUVertex::normal

◆ position [1/2]

vec3 GPUVertex::position

◆ position [2/2]

glm::vec3 GPUVertex::position

◆ tangent [1/2]

vec4 GPUVertex::tangent

◆ tangent [2/2]

glm::vec4 GPUVertex::tangent

Stored vertex tangents, xyz = tangent direction, w = handedness sign for bitangent (= cross(normal, tan.xyz) * tan.w) Needed to shade correctly across mirrored UV islands

◆ texcoord [1/2]

vec2 GPUVertex::texcoord

◆ texcoord [2/2]

glm::vec2 GPUVertex::texcoord

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