|
SleakEngine 0.1.0
C++23 multi-backend game engine
|
#include <VertexLayout.hpp>
Public Attributes | |
| std::vector< VertexAttribute > | attributes |
| std::string | gbufferShaderStem |
| std::string | shaderStem |
| std::string | shadowShaderStem |
| uint32_t | stride = 0 |
| bool | transparentReadsScene = false |
| std::string | transparentShaderStem |
A complete custom vertex layout plus the shader stems that consume it. Register once at startup; the handle keys pipelines and mesh creation. Shader stems are consumed by the Vulkan backend; OpenGL instead binds the layout's attributes to its own fixed shader programs.
Fill one of these when your geometry does not fit the engine's built-in vertex type: packed voxel vertices, extra UV sets, per-vertex instance data, anything you want to define yourself. stride is the size of one vertex in bytes and each VertexAttribute gives a shader location, a component format, and a byte offset inside that vertex.
The four shader stems name the pipeline variants the format participates in. An empty stem skips that pass entirely, so a format with no shadowShaderStem casts no shadows and a format with no gbufferShaderStem is forward only. There is no fallback shader: if a named stem fails to load, the backend logs an error and skips that pass for this format.
Set transparentReadsScene for transparent geometry that refracts or reflects what lies behind it, such as water. The first transparent draw of the format in a frame snapshots the scene drawn so far, and its shaders can then read it:
Add Camera.xy * gl_Position.w to the clip position after the Vulkan Y flip so the draw lines up with the jittered opaque geometry.
On Vulkan, transparent draws set the HDR scene alpha to 0. TAA reads that as a reactive mask and trusts history less there, since animated or refracted content is not described by the depth buffer.
Definition at line 101 of file VertexLayout.hpp.
| std::vector<VertexAttribute> Sleak::VertexLayoutDesc::attributes |
Definition at line 103 of file VertexLayout.hpp.
| std::string Sleak::VertexLayoutDesc::gbufferShaderStem |
Definition at line 108 of file VertexLayout.hpp.
| std::string Sleak::VertexLayoutDesc::shaderStem |
Definition at line 104 of file VertexLayout.hpp.
| std::string Sleak::VertexLayoutDesc::shadowShaderStem |
Definition at line 106 of file VertexLayout.hpp.
| uint32_t Sleak::VertexLayoutDesc::stride = 0 |
Definition at line 102 of file VertexLayout.hpp.
| bool Sleak::VertexLayoutDesc::transparentReadsScene = false |
Definition at line 112 of file VertexLayout.hpp.
| std::string Sleak::VertexLayoutDesc::transparentShaderStem |
Definition at line 110 of file VertexLayout.hpp.