effect-format.resource.vertex-2d |
Vertex2D input layout |
ImGui, QuadSprite, and Primitive effects consume locations 0..3 from Vertex2D: vec3 position, normalized color, vec2 texture coordinate, and vec2 egg/auxiliary data. |
The non-model usages share one native vertex structure even when a shader ignores some inputs. |
Source/Frontend/Rendering.h, Resources/Core/Effects/2D_Default.fofx |
effect-format.resource.vertex-model |
Vertex3D input layout |
Model effects consume locations 0..8: position, normal, primary UV, base UV, tangent, bitangent, blend weights, blend indices, and color. |
All model shaders must match the fixed Vertex3D layout configured by every active backend. |
Source/Frontend/Rendering.h, Resources/Core/Effects/3D_Skinned.fofx |
effect-format.resource.native-descriptor-sets |
Native Vulkan descriptor convention |
Author native shader resources with uniform buffers in descriptor set 0 and combined image samplers in descriptor set 1. |
The native SPIR-V is consumed unchanged by Rendering-Vulkan and is the source for GLSL, GLSL ES, and HLSL cross-compilation. |
Source/Tools/EffectBaker.cpp, Resources/Core/Effects/2D_Default.fofx |
effect-format.resource.explicit-bindings |
Explicit bindings |
Every live sampler and uniform block must declare an explicit binding. Binding numbers must be unique within each shader stage and resource class. |
SDL_GPU slot assignment sorts authored bindings and remaps them to dense per-stage slots. |
Source/Tools/EffectBaker.cpp |
effect-format.resource.samplers |
Renderer-provided samplers |
The runtime has producers for MainTex, IndoorMaskTex, and BackgroundTex, plus ModelTex0 through ModelTexN-1 in 3D builds. BackgroundTex is a caller-supplied scene snapshot for refraction. Other reflected sampler names are not populated by RenderEffect. |
A shader may compile with another sampler name but receives no Engine-owned texture binding. |
Source/Tools/EffectBaker.cpp, Source/Frontend/Rendering.h |
effect-format.resource.general-buffers |
General uniform buffers |
Recognized general buffers are ProjBuf, MainTexBuf, EggBuf, SpriteBorderBuf, ParticleSamplingBuf, TimeBuf, RandomValueBuf, ScriptValueBuf, and CameraBuf. ParticleSamplingBuf is caller-defined per draw for particle texture sampling and distortion controls. Declarations must match the native std140-compatible layouts exactly. |
EffectBaker validates reflected byte sizes against RenderEffect buffer structures. |
Source/Tools/EffectBaker.cpp, Source/Frontend/Rendering.h |
effect-format.resource.model-buffers |
3D uniform buffers |
Recognized model buffers are ModelBuf, ModelTexBuf, and ModelAnimBuf, with MAX_BONES and MAX_TEXTURES supplied by the baker prelude. |
These layouts carry skinning, lighting, texture-atlas, and animation timing data for model effects. |
Source/Tools/EffectBaker.cpp, Source/Frontend/Rendering.h |
effect-format.resource.script-values |
ScriptValueBuf |
Declare ‘vec4 ScriptValue[MAX_SCRIPT_VALUES / 4]’ inside ScriptValueBuf. The flat script-facing index range is 0..EFFECT_SCRIPT_VALUES-1. |
The baker supplies MAX_SCRIPT_VALUES and the client API writes float ranges into the same native buffer. |
Source/Tools/EffectBaker.cpp, Source/Frontend/Rendering.h |
effect-format.resource.time-random |
Per-frame buffers |
TimeBuf exposes FrameTime.x and GameTime.x as session-relative seconds wrapped at 8192; RandomValueBuf exposes four independent [0,1] values refreshed each frame. |
These buffers are updated per loaded effect only when reflection reports that the effect needs them. |
Source/Client/EffectManager.cpp, Source/Frontend/Rendering.h |
effect-format.resource.camera |
CameraBuf affine bases |
CameraBuf contains MapAnchorScreenPos and ChunkScreenAnchor. Shaders evaluate either basis as ‘.xy + TexCoord * .zw’ for world-anchored or screen-anchored coordinates. |
The scale terms preserve continuity across padded/chunked render targets and zoom. |
Source/Frontend/Rendering.h |
effect-format.resource.unsupported |
Unsupported shader resources |
Unknown uniform blocks, storage buffers, and storage images are rejected. Dead declared descriptor resources are rejected during SDL SPIR-V patching. |
The renderer binds only its fixed buffer vocabulary and sampled textures. |
Source/Tools/EffectBaker.cpp |
effect-format.resource.sdl-limits |
SDL_GPU per-stage limits |
Each shader stage may use at most 16 samplers and 4 uniform buffers. Slots become dense independently for vertex samplers, vertex UBOs, fragment samplers, and fragment UBOs. |
SDL_CreateGPUShader requires per-stage counts and the backend descriptor convention differs from native Vulkan. |
Source/Tools/EffectBaker.cpp |