Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
esengine Namespace Reference

Namespaces

namespace  animation
namespace  aot
namespace  ecs
namespace  detail
namespace  physics
namespace  physics3d
namespace  physics3d_physx
namespace  core
namespace  hash
namespace  math
 Math constants and utility functions.
namespace  particle
namespace  billboard
namespace  resource
namespace  impostor
namespace  placement_bounds
namespace  rg
namespace  lod
namespace  text
namespace  tilemap
namespace  trail
namespace  gfx
namespace  ShaderEmbeds
namespace  webgpu
namespace  spine
namespace  springbone

Classes

class  EngineContext
 Legacy singleton wrapper around EstellaContext. More...
struct  EngineState
struct  EntityPose2D
class  EstellaContext
class  FrameProfiler
class  ScopeTimer
struct  LogEntry
class  Log
 Static logging interface. More...
struct  PackedId
 Index+generation packing into a u32, parameterized by the bit split. More...
class  RandomSource
struct  is_component
 Type trait to detect if a type is a reflected component. More...
class  ServiceRegistry
 Typed service locator for engine subsystems. More...
struct  Entity
 Entity identifier with packed index + generation. More...
struct  ComponentDomain
 Domain tags — each yields an independent, dense, 0-based TypeId sequence. Use the typed helpers below rather than the raw domain id. More...
struct  ServiceDomain
struct  World
 Context passed to every System::update call. More...
class  Connection
 RAII handle for signal connections. More...
class  ScopedConnection
 Scoped connection that auto-disconnects in a specific scope. More...
class  ConnectionHolder
 Container for managing multiple connections. More...
class  Signal
class  Sink
class  Signal< void(Args...)>
 Type-safe signal for event publishing. More...
class  Signal< Ret(Args...)>
 Specialization for signals with return values. More...
class  Sink< Signal< void(Args...)> >
 Connection interface for Signal<void(Args...)>. More...
class  Sink< Signal< Ret(Args...)> >
 Connection interface for Signal<Ret(Args...)>. More...
struct  BatchDrawKey
 Non-geometry attributes of a batch draw — everything needed to build the sort key + DrawCommand. More...
struct  BatchVertex
 One vertex of the shared batch stream. More...
class  ClipState
class  CustomGeometry
 Custom geometry for user-defined mesh rendering. More...
class  GeometryManager
 Manager for custom geometries. More...
struct  DrawCommand
class  DrawList
struct  DrawParamSlot
 One lifted uniform's slot in a shader's std140 DrawParams block. More...
struct  DrawParamsLayout
 A shader's DrawParams layout: lifted members + 16-aligned block size. More...
struct  DrawParamsRewrite
 Result of rewriteLooseUniforms; layout.empty() ⇒ sources unchanged. More...
class  ImmediateDraw
 Immediate mode 2D drawing API. More...
struct  LodLevels
struct  ScissorRect
struct  RetainedTextBatch
struct  RetainedText
class  RetainedTextStore
 The retained geometry of every label, by entity. Ordered: a frame submits in entity order, not in whatever order a hash left them. More...
struct  RetainedTextClip
 Where the quads a view keeps are copied to, reused across batches and frames. More...
struct  SpriteDrawChoice
struct  ResolvedMask
 A SpriteMask's own place in the frame, how far it reaches, and the ref it stamps. More...
struct  DynamicGIParams
struct  DynamicGIScene
struct  DynamicGIStats
class  DynamicGI
struct  DrawCallRecord
class  FrameCapture
struct  FrameConstants
 CPU mirror of the GLSL FrameConstants block (std140). More...
struct  TimeConstants
 CPU mirror of the injected TimeConstants block (std140). More...
struct  Plane
struct  Frustum
class  GpuParticles
class  OcclusionView
 The depths this view is blocked at, and the test a bound asks it. More...
struct  PlanarReflectionCamera
struct  PostProcessPass
 Post-processing pass configuration. More...
class  PostProcessPipeline
 Post-processing effects pipeline. More...
struct  QualityValueSpec
class  QualityValues
class  RenderContext
class  GpuTimer
class  RenderFrame
class  RenderThread
struct  SkinCacheSettings
 The project's skin cache settings. More...
class  SkinCache
struct  WeightTarget
 The one skinned entity a view colours by a joint's weights, and which joint. More...
class  ViewShading
 The mode each view asked for. A view that never asked is Shaded, which is why a frame with nothing set costs a hash lookup per collect and nothing else. More...
struct  VoxelGIParams
class  VoxelGI
class  BatchPlugin
class  MeshPlugin
 Scene-level 2D mesh renderer (MeshRenderer component). More...
class  ParticlePlugin
class  ShapePlugin
class  SpritePlugin
class  TextPlugin
class  TilemapRenderPlugin
struct  TrailCenter
 One centerline sample: world position + normalized age (0 head, 1 tail). More...
class  TrailPlugin
 Motion-trail renderer (TrailRenderer component). More...
class  UIElementPlugin
struct  RenderFrameContext
struct  CameraView
 What every plugin needs to know about the camera, derived once per collect from the inverse view-projection — the single source for parallax, world-rect culling and the depth draws are sorted by (each previously re-derived, or in the depth's case assumed, inside the plugins). More...
struct  ParallaxAnchor
 Where parallax is measured from, when it is not the camera drawing the frame. More...
struct  MeshDocumentRecord
 What a renderable's program key is made of, with no say in where the facts came from — a live entity's components, or a PREPARED cell's document. One combination, so the two can be shown to agree. More...
struct  MeshProgramFacts
struct  RenderPrewarmResult
 What readying a set of renderables' programs found. Counts, not JSON: this crosses no boundary and pays for no encoding. More...
struct  RenderCollectContext
class  RenderTypePlugin
struct  VertexAttribute
 Describes a single vertex attribute. More...
class  VertexLayout
 Describes the layout of vertex data in a buffer. More...
class  VertexBuffer
 GPU buffer for vertex data, static or dynamic; all GPU work goes through the device. More...
class  IndexBuffer
 GPU buffer for index data. More...
struct  FramebufferSpec
 Framebuffer creation parameters. More...
class  Framebuffer
 Off-screen rendering target. More...
class  GfxContent
 A content policy. provider names who refills a Sourced object and key what it refills; both are the provider's own vocabulary. More...
struct  GfxLiveObjects
 GPU objects the device has created and not yet destroyed. More...
class  GfxDevice
 Abstract graphics device interface. More...
struct  GfxVertexAttribute
struct  VertexLayoutDesc
 Describes how vertex-buffer bytes map to shader attributes. More...
struct  GfxBlockInfo
 Block footprint of a compressed format, the single source both backends use to size each mip level's upload. BC1/ETC2_RGB are 4x4x8B, the RGBA block formats 4x4x16B, ASTC's block matches its name. More...
struct  BufferDesc
 Immutable creation parameters of a GPU buffer. More...
struct  TextureDesc
 Immutable creation parameters of a 2D texture or 2D texture array. More...
struct  FramebufferDesc
 Attachments of an offscreen render target. The attach point of depthStencil follows its texture's pixel format. More...
struct  RenderPassDesc
 One render pass: a target, which attachments to clear on entry, and the clear values — full load-op semantics, no sticky device clear state. More...
struct  GfxDeviceIdentity
 Everything a human needs to know about one device loss. More...
struct  GfxDeviceLostInfo
struct  GfxShaderSource
 A program's source pair, tagged with the language it is written in. More...
struct  GfxComputeSource
 A compute program's source. Compute is WGSL only: GLSL ES 3.00 has no compute stage. More...
struct  GfxComputeBinding
 One resource a compute dispatch binds, at @group(0) @binding(binding). More...
struct  GfxAttribBinding
 Vertex attribute location binding applied before a program is linked. More...
struct  GfxUniformInfo
struct  GfxUniformValue
 The last value a program was given for one uniform, replayed after a relink. More...
struct  GfxBufferRecord
struct  GfxTextureRecord
struct  GfxProgramRecord
struct  GfxComputeRecord
struct  GfxFramebufferRecord
struct  GfxLayoutRecord
struct  GfxPipelineRecord
struct  GfxTimerQueryRecord
class  GfxRecordTable
 One kind of object, by id, in creation order. More...
struct  PipelineDescHash
struct  GfxOwedContent
 A Sourced object that has storage again and is waiting for its contents. More...
class  GfxResourceRegistry
class  GLDevice
 OpenGL ES 3.0 / WebGL 2.0 implementation of GfxDevice. More...
class  PerDrawBlocks
struct  PerDrawBlockSet
 The uniform blocks a draw rewrites immediately before it. More...
struct  PipelineDesc
 Immutable description of a draw pipeline. Equality keys the pipeline cache, so two draws with the same description share one PipelineHandle. More...
class  RenderTarget
class  RenderTargetManager
struct  AttribBinding
struct  ShaderCompileOutcome
 Result returned by Shader::createEx when you need the raw driver log. More...
class  Shader
 GPU shader program for rendering. More...
struct  TextureSpecification
 Texture creation parameters. More...
class  Texture
 2D texture for GPU rendering More...
class  TransientBufferPool
struct  HdrFormatDecision
 The format decision one frame committed to. More...
struct  InstanceConstants
 Where one draw's entry is: a texel of the record texture. More...
struct  GpuLight
 One 2D light, std140-packed (six vec4s, 96 bytes, 16-aligned). More...
struct  LightConstants
 CPU mirror of the GLSL LightConstants block (std140). More...
struct  LightGrant
 One light that asked to be in the frame, and what it was told. More...
struct  LightCapReport
 What the frame's light cap came to. More...
class  LightStore
 Holds the per-frame 2D lights and their GPU UBO. Mirrors MaterialStore's UBO lifecycle (lazy create, dirty upload, device-owned free). More...
struct  MaterialParamSlot
 One scalar/vector param's slot in a shader's std140 MaterialConstants block. More...
struct  MaterialTextureSlot
 A texture param's sampler unit (>= MATERIAL_TEXTURE_UNIT_BASE, above the batch's 0..7). More...
struct  MaterialTextureBinding
 A material's bound texture at a sampler unit. More...
struct  MaterialUniformLayout
 A shader's layout: std140 block (scalar/vector params) + texture sampler slots. More...
struct  MaterialRecord
 A material's resolved render state (P0) plus its packed std140 constants (P1). More...
class  MaterialStore
 Maps a material handle to its resolved record. Owned by RenderContext so it is reachable from both the SDK binding (push) and the render collect path (read). More...
struct  MorphConstants
 One draw's shapes, laid out as the texels they are written as. More...
struct  PlanarConstants
struct  ProbeConstants
 The indirect light one instance stands in — both halves of it. More...
class  ProbeStore
 The frame's probe volumes, and the trilinear read through them. More...
class  ReflectionStore
 The frame's reflection probes, and the lookup that picks one. More...
struct  ShadowTile
 One tile's square, in atlas texels. More...
class  ShadowAtlas
 A square texture divided into a grid of cells, handed out as square blocks. More...
struct  ShadowMaskLight
 One light as the channel assignment sees it: where its shadows are read and where they can land. More...
struct  ShadowGrant
 One caster's claim on the atlas: what it wanted, what it kept, and why the difference. More...
struct  ShadowPlanReport
 The frame's whole shadow allocation, as numbers something outside it can check. More...
struct  SkinConstants
 std140 mirror of the block. One mat4 per joint, MESH_MAX_BONES of them. More...
class  MetalComputeQueue
class  WebGPUDevice
class  Environment
 The two halves of an image-based light, as the importer baked them. More...
struct  MeshMorphSource
 The shapes handed to a realization: the deltas, and how to read them. More...
struct  MeshSkinLayout
 Where a skinned mesh's vertex holds what the skin cache reads and writes: byte offsets in one vertex, -1 for a channel it does not have. Positions, normals and tangents are floats; joints a byte or two, weights a normalized byte (0), a normalized short (1) or a float (2). More...
struct  MeshSkinChunk
 One piece a skinned mesh is drawn in, when its bones are more than one draw can carry. More...
class  Mesh
 Buffers, the layout that describes them, and the bounds culling reads. More...
class  ProbeVolume
 Irradiance at a grid of points — an Environment sampled, not held. More...
struct  Padding
struct  Dimension
 A CSS-style length: value interpreted per unit. More...

Typedefs

using LogSink = std::function<void(const LogEntry&)>
using u8 = std::uint8_t
 Unsigned 8-bit integer.
using u16 = std::uint16_t
 Unsigned 16-bit integer.
using u32 = std::uint32_t
 Unsigned 32-bit integer.
using u64 = std::uint64_t
 Unsigned 64-bit integer.
using i8 = std::int8_t
 Signed 8-bit integer.
using i16 = std::int16_t
 Signed 16-bit integer.
using i32 = std::int32_t
 Signed 32-bit integer.
using i64 = std::int64_t
 Signed 64-bit integer.
using f32 = float
 32-bit floating point
using f64 = double
 64-bit floating point
using usize = std::size_t
 Size type for indexing and sizes.
template<typename T>
using Unique = std::unique_ptr<T>
 Unique ownership smart pointer.
template<typename T>
using Shared = std::shared_ptr<T>
 Shared ownership smart pointer.
template<typename T>
using Weak = std::weak_ptr<T>
 Weak reference smart pointer.
using TypeId = u32
 Runtime type identifier.
template<typename T>
using ConstSpan = std::span<const T>
using CallbackId = u64
using AsyncComputeFence = i32

Enumerations

enum class  LogLevel : u8 {
  Trace = 0 , Debug = 1 , Info = 2 , Warn = 3 ,
  Error = 4 , Fatal = 5
}
 Logging severity levels. More...
enum class  BlendMode : u8 {
  Normal = 0 , Additive = 1 , Multiply = 2 , Screen = 3 ,
  PremultipliedAlpha = 4 , PmaAdditive = 5 , Lighten = 6 , Darken = 7 ,
  Overlay = 8 , None = 9
}
 Predefined blend modes for rendering. More...
enum class  BatchBreak : u8 {
  None = 0 , RunStart , Instanced , Shader ,
  Blend , Layout , Material , Depth ,
  Cull , State , Scissor , Stencil ,
  IndexGap , TextureSlots , Count
}
enum class  DrawParamType : u8 {
  Float , Int , Vec2 , Vec3 ,
  Vec4 , Mat3 , Mat4
}
 GLSL type of one lifted uniform (the subset the rewriter supports). More...
enum class  RenderType : u8 {
  Sprite = 0 , Skeletal = 1 , Mesh = 2 , ExternalMesh = 3 ,
  Text = 4 , Shape = 6 , UIElement = 7 , Trail = 8
}
enum class  RetainedTextKept { None , All , Subset }
 What a view keeps of a batch: nothing, all of it (read the batch itself), or a subset copied into scratch. More...
enum class  TextGlyphMode : u8 { Color = 0 , Sdf = 1 , Mask = 2 , Fill = 3 }
enum class  CapturePass : u8 { Scene = 0 , Overlay = 1 }
enum class  OutputTransform : u8 { None = 0 , ACES = 1 , Neutral = 2 }
 What the last pass of a chain does to scene values on the way out. More...
enum class  QualityValue : u32 { LoopLights , TiledLights , ShadowTiles , Count }
enum class  ShadowShape : u8 { Box , Cone , Cube }
 The shape a light's map has to cover — the one thing a shadow pass differs by. More...
enum class  BatchVariant : u8 {
  Plain , Lit , AlphaClip , PremultipliedColor ,
  DisplayOutput , Count
}
enum class  RenderStage : u8 { Background = 0 , Opaque = 1 , Transparent = 2 , Overlay = 3 }
enum class  SkinCacheBehavior : u8 { Inclusive = 0 , Exclusive = 1 }
 Which skinned meshes go through the cache when their own MeshSkin says Auto. More...
enum class  SkinCacheUsage : u8 { Auto = 0 , Disabled = 1 , Enabled = 2 }
 A mesh's own word on the cache (MeshSkin::skinCache). More...
enum class  ShadingMode : u8 {
  Shaded = 0 , Clay = 1 , Albedo = 2 , Wireframe = 3 ,
  DirectLighting = 4 , IndirectLighting = 5 , Clusters = 6
}
 What a mesh is drawn WITH in a view, whatever its own material says. More...
enum class  RenderPurpose : u8 { Scene , ShadowDepth , ScreenOverlay , Motion }
 What a collect is FOR — the phase, not a feature the geometry has. More...
enum class  CasterSplit : u8 { All , Held , Movers }
enum class  ShaderDataType {
  None = 0 , Float , Float2 , Float3 ,
  Float4 , Int , Int2 , Int3 ,
  Int4 , Bool , UByte4N
}
 Vertex attribute data types. More...
enum class  GfxContentKind : u8 { Transient , Retained , Sourced }
enum class  AsyncComputePriority { Default , High }
enum class  BufferHandle : u32 { Invalid = 0 }
enum class  TextureHandle : u32 { Invalid = 0 }
enum class  ShaderHandle : u32 { Invalid = 0 }
enum class  ComputeHandle : u32 { Invalid = 0 }
 A compute program (GfxDevice::createCompute); only a device that supportsCompute() issues one. More...
enum class  FramebufferHandle : u32 { Default = 0 }
 Handle 0 is the default framebuffer (backbuffer); it cannot be created or deleted. More...
enum class  ReadbackHandle : u32 { Invalid = 0 }
 An in-flight framebuffer readback (GfxDevice::requestReadback). More...
enum class  GfxReadbackStatus : u8 { Pending = 0 , Ready = 1 , Failed = 2 }
 State of an in-flight readback. GL completes at request time (first poll reports Ready); WebGPU resolves when its staging-buffer map lands. More...
enum class  TextureFilter : u8 { Nearest , Linear }
enum class  TextureWrap : u8 { Repeat , ClampToEdge , MirroredRepeat }
enum class  GfxBufferUsage : u8 { Vertex , Index , Uniform , Storage }
enum class  LayoutId : u8 {
  Batch = 0 , ParticleInstance = 1 , Shape = 2 , MeshInstance = 3 ,
  Sky = 4
}
 Identifies a transient vertex stream / vertex format. Each layout has its own VBO+EBO+VAO in TransientBufferPool and is part of a pipeline's identity. More...
enum class  MeshChannel : u8 {
  Position = 0 , Color = 1 , TexCoord0 = 2 , Normal = 3 ,
  Tangent = 4 , Joints = 5 , Weights = 6 , TexCoord1 = 7
}
 What a mesh vertex channel MEANS, and the attribute location it binds to. More...
enum class  MeshChannelType : u8 {
  Float32 = 0 , UNorm8 = 1 , UInt16 = 2 , UInt8 = 3 ,
  UNorm16 = 4
}
 How a channel's components are stored, as the file spells it. More...
enum class  GfxDataType : u8 {
  Float , Int , UnsignedByte , UnsignedShort ,
  UnsignedInt
}
enum class  VertexLayoutHandle : u32 { Invalid = 0 }
enum class  GfxStencilFunc : u8 {
  Never , Less , Equal , LEqual ,
  Greater , NotEqual , GEqual , Always
}
enum class  GfxStencilOp : u8 {
  Keep , Zero , Replace , Incr ,
  Decr , Invert , IncrWrap , DecrWrap
}
enum class  GfxPixelFormat : u8 {
  RGB8 , RGBA8 , SRGB8_ALPHA8 , RGBA16F ,
  RGBA32F , DepthComponent24 , Depth24Stencil8
}
enum class  GfxCompressedFormat : u8 {
  ETC2_RGB8 , ETC2_RGBA8 , ASTC_4x4 , ASTC_8x8 ,
  S3TC_DXT1 , S3TC_DXT5 , ETC2_RGBA8_SRGB , ASTC_4x4_SRGB ,
  S3TC_DXT5_SRGB
}
 GPU-compressed texture internal formats for createCompressedTexture. More...
enum class  GfxStringName : u8 { Version , Renderer , Vendor , ShadingLanguageVersion }
 Backend identification strings. More...
enum class  GfxIntParam : u8 { MaxTextureSize , MaxTextureImageUnits , MaxVertexAttribs }
 Backend integer capabilities/limits. More...
enum class  GfxDeviceStatus : u8 { Live , Lost , Recovering , Dead }
 Whether the device can still be drawn to. More...
enum class  GfxDeviceLostReason : u8 {
  Unknown , ContextLost , OutOfMemory , Reset ,
  Removed , Destroyed , Validation , Internal
}
 Why the device was lost. The report leads with this. More...
enum class  ClipDepthRange : u8 { MinusOneToOne , ZeroToOne }
 What a device's clip volume does with depth. More...
enum class  GfxShaderLanguage : u8 { GLSL_ES300 = 0 , WGSL = 1 }
 Shader source language a backend consumes. More...
enum class  GfxShaderStage : u8 { None , Vertex , Fragment , Link }
 Which pipeline stage rejected a program during createProgram(). More...
enum class  GfxUniformType : u8 {
  Unknown , Float , Vec2 , Vec3 ,
  Vec4 , Int , IVec2 , IVec3 ,
  IVec4 , Bool , Mat2 , Mat3 ,
  Mat4 , Sampler2D , SamplerCube , Sampler2DArray
}
enum class  GfxStencilMode : u8 {
  Off , Write , Test , TestOutside ,
  Increment , Decrement , Zero
}
 Stencil behaviour baked into a pipeline. The reference value is dynamic (GfxDevice::setStencilReference), the compare/op/masks are pipeline state. More...
enum class  GfxTopology : u8 { Triangles , Lines }
 How a pipeline's indices assemble into primitives. Baked into the pipeline, as WebGPU bakes it, so a draw call never states it: whoever binds a pipeline has said it. More...
enum class  PipelineHandle : u32 { Invalid = 0 }
 Opaque handle to a cached pipeline; PipelineHandle{0} is the null/invalid handle. More...
enum class  ShaderStageFailure : u8 { None , Vertex , Fragment , Link }
 Which pipeline stage rejected a shader during compile/link. More...
enum class  TextureFormat {
  None = 0 , RGB8 , RGBA8 , SRGB8A8 ,
  RGBA16F , RGBA32F , Depth24
}
 Texture pixel format. More...
enum class  HdrRefusal : u8 { None = 0 , FloatTargetsUnsupported }
 Why the effective format is not the requested one. More...
enum class  LightRefusal : u8 { None = 0 , Capacity , NoEnvironmentSun }
 Why a light did not reach the frame. More...
enum class  CullMode : u8 { None = 0 , Back = 1 , Front = 2 }
 Triangle culling mode baked into a material's pipeline. More...
enum class  MaterialDefaultTexture : u8 { White , Black , FlatNormal , Ripples }
 Which built-in texture a param falls back to when a material leaves it unset. More...
enum class  AtlasRefusal : u8 { None = 0 , TileBudget , TooLarge , NoSpace }
 Why a claim was turned down. Three different answers on purpose: raising the atlas size fixes NoSpace and neither of the others. More...
enum class  ShadowClaim : u8 { AllOrNothing , AllowFewer }
enum class  MeshRecovery : u8 { SourceReplayable , HostOnly }
 How a mesh's geometry comes back after a device generation ends. More...

Functions

EstellaContext & activeCtx ()
 The engine context every binding routes through — single source of truth.
bool startRenderThread (EstellaContext &context, const char *canvas=nullptr)
static EstellaContext & ctx ()
u32 anim_createTween (ecs::Registry &registry, u32 entity, u32 targetProp, f32 from, f32 to, f32 duration, u32 easing, f32 delay, u32 loopMode, i32 loopCount)
void anim_cancelTween (ecs::Registry &registry, u32 tweenEntity)
void anim_cancelAllTweens (ecs::Registry &registry, u32 targetEntity)
void anim_pauseTween (ecs::Registry &registry, u32 tweenEntity)
void anim_resumeTween (ecs::Registry &registry, u32 tweenEntity)
void anim_setTweenBezier (ecs::Registry &registry, u32 tweenEntity, f32 p1x, f32 p1y, f32 p2x, f32 p2y)
void anim_setSequenceNext (ecs::Registry &registry, u32 tweenEntity, u32 nextEntity)
void anim_updateTweens (ecs::Registry &registry, f32 deltaTime)
i32 anim_getTweenState (ecs::Registry &registry, u32 tweenEntity)
void setBoundaryRegion (uintptr_t base, usize size)
 Declare the region a native host lets JS address (its heap arena).
template<typename T>
const T * boundarySpan (uintptr_t ptr, u64 count, const char *what)
 Validates a JS-supplied pointer to count elements of T and returns it typed.
template<typename T>
T * boundarySpanMut (uintptr_t ptr, u64 count, const char *what)
 Mutable variant of boundarySpan, for entry points that WRITE into a JS buffer.
static EstellaContext & ctx ()
static void flushImmediateDrawIfActive ()
static void drawGeometry (GfxDevice &device, CustomGeometry &geom)
static void applyMeshPipeline (GfxDevice &device, const Shader &shader, const CustomGeometry &geom)
u32 geometry_create ()
void geometry_init (u32 handle, uintptr_t verticesPtr, u32 vertexCount, uintptr_t layoutPtr, u32 layoutCount, bool dynamic)
void geometry_setIndices16 (u32 handle, uintptr_t indicesPtr, u32 indexCount)
void geometry_setIndices32 (u32 handle, uintptr_t indicesPtr, u32 indexCount)
void geometry_updateVertices (u32 handle, uintptr_t verticesPtr, u32 vertexCount, u32 offset)
void geometry_release (u32 handle)
bool geometry_isValid (u32 handle)
void draw_mesh (u32 geometryHandle, u32 shaderHandle, uintptr_t transformPtr)
bool draw_meshWithMaterial (u32 geometryHandle, u32 materialId)
void draw_meshWithUniforms (u32 geometryHandle, u32 shaderHandle, uintptr_t transformPtr, uintptr_t uniformsPtr, u32 uniformCount)
static EstellaContext & ctx ()
static void flushImmediateDrawIfActive ()
void draw_begin (uintptr_t matrixPtr, i32 viewportWidth, i32 viewportHeight)
void draw_end ()
void draw_deferEnd ()
void draw_deferBegin ()
void draw_line (f32 fromX, f32 fromY, f32 toX, f32 toY, f32 r, f32 g, f32 b, f32 a, f32 thickness)
void draw_line3D (f32 fromX, f32 fromY, f32 fromZ, f32 toX, f32 toY, f32 toZ, f32 r, f32 g, f32 b, f32 a, f32 thickness)
void draw_line3DScreen (f32 fromX, f32 fromY, f32 fromZ, f32 toX, f32 toY, f32 toZ, f32 r, f32 g, f32 b, f32 a, f32 thickness)
void draw_line3DScreenOffset (f32 anchorX, f32 anchorY, f32 anchorZ, f32 fromX, f32 fromY, f32 toX, f32 toY, f32 r, f32 g, f32 b, f32 a, f32 thickness)
void draw_rect (f32 x, f32 y, f32 width, f32 height, f32 r, f32 g, f32 b, f32 a, bool filled)
void draw_rectOutline (f32 x, f32 y, f32 width, f32 height, f32 r, f32 g, f32 b, f32 a, f32 thickness)
void draw_circle (f32 centerX, f32 centerY, f32 radius, f32 r, f32 g, f32 b, f32 a, bool filled, i32 segments)
void draw_circleOutline (f32 centerX, f32 centerY, f32 radius, f32 r, f32 g, f32 b, f32 a, f32 thickness, i32 segments)
void draw_triangles (uintptr_t positionsPtr, u32 vertexCount, uintptr_t colorsPtr, uintptr_t indicesPtr, u32 indexCount, f32 r, f32 g, f32 b, f32 a, f32 xx, f32 xy, f32 yx, f32 yy, f32 tx, f32 ty)
u32 draw_createTriangleMesh (uintptr_t positionsPtr, u32 vertexCount, uintptr_t colorsPtr, uintptr_t indicesPtr, u32 indexCount)
void draw_destroyTriangleMesh (u32 id)
void draw_triangleMesh (u32 id, f32 r, f32 g, f32 b, f32 a, f32 xx, f32 xy, f32 yx, f32 yy, f32 tx, f32 ty)
void draw_triangleMeshMany (u32 id, uintptr_t recordsPtr, u32 count)
void draw_texture (f32 x, f32 y, f32 width, f32 height, u32 textureId, f32 r, f32 g, f32 b, f32 a)
void draw_textureRotated (f32 x, f32 y, f32 width, f32 height, f32 rotation, u32 textureId, f32 r, f32 g, f32 b, f32 a)
void draw_setLayer (i32 layer)
void draw_setDepth (f32 depth)
u32 draw_getDrawCallCount ()
u32 draw_getPrimitiveCount ()
void draw_setBlendMode (i32 mode)
void draw_setDepthTest (bool enabled)
u32 draw_getDepthState ()
void draw_setDepthState (u32 flags)
static EstellaContext & ctx ()
u32 material_compileEsshader (const std::string &source, const std::string &featuresCsv)
void material_define (u32 materialId, u32 shaderHandle, u32 blendMode, u32 flags, i32 depthBias)
void material_setUniform (u32 materialId, const std::string &name, u32 arity, f32 v0, f32 v1, f32 v2, f32 v3)
void material_setTexture (u32 materialId, const std::string &name, u32 textureHandle)
void material_undefine (u32 materialId)
bool postprocess_init (u32 width, u32 height)
void postprocess_shutdown ()
void postprocess_resize (u32 width, u32 height)
u32 postprocess_addPass (const std::string &name, u32 shaderHandle)
u32 postprocess_addComputePass (const std::string &name, const std::string &wgsl, const std::string &params, u32 workgroupX, u32 workgroupY)
 Adds a pass that is a WGSL compute shader over the picture (see PostProcessPipeline::addComputePass).
bool postprocess_supportsCompute ()
 Whether compute passes run on this device: WebGPU yes, WebGL2 no.
u32 postprocess_addNativePass (const std::string &name, const std::string &kind)
 Adds a pass the engine implements itself ("voxelGI"); its parameters are set by name like any pass's.
bool postprocess_setGIScene (uintptr_t headerPtr, u32 headerCount, uintptr_t sdfPtr, u32 sdfCount, uintptr_t instancesPtr, u32 instanceCount, uintptr_t pixelsPtr, u32 pixelCount)
 Hands the dynamic GI the scene it traces: the header, the distance field, the instances and the card pixels, laid out as sdk/src/gi/gpuScene.ts writes them (see DynamicGI.hpp). The engine copies them; the pointers are free after the call.
bool postprocess_updateGIField (uintptr_t headerPtr, u32 headerCount, uintptr_t sdfPtr, u32 sdfOffset, u32 sdfCount)
 Updates the scene the dynamic GI traces after the camera moved: the header, and sdfCount floats of the field from float sdfOffset on.
void postprocess_setMsaaSamples (u32 samples)
u32 postprocess_effectiveMsaaSamples ()
u32 postprocess_maxMsaaSamples ()
i32 postprocess_hdrFormat (uintptr_t outPtr)
 The format decision the last frame COMMITTED to, into four floats at outPtr: requested, effective, refusal, linear.
std::string postprocess_hdrFormatNames ()
 The last committed decision as words: "requested|effective|reason". Empty before a frame has committed one. The names come from the engine so no reader has to hold a second spelling of the format enum's order.
void postprocess_setPassScale (const std::string &passName, f32 scale)
void postprocess_setPassContinuesEffect (const std::string &passName)
void postprocess_requestSkyCapture (const std::string &passName, u32 width, u32 height)
i32 postprocess_pollSkyCapture ()
bool postprocess_takeSkyCapture (uintptr_t dst, u32 bytes)
u32 postprocess_giStats (uintptr_t dst, u32 capacity)
void postprocess_setUniformFloat (const std::string &passName, const std::string &uniform, f32 value)
void postprocess_setPassTexture (const std::string &passName, const std::string &uniform, u32 textureHandle)
void postprocess_setUniformVec4 (const std::string &passName, const std::string &uniform, f32 x, f32 y, f32 z, f32 w)
void postprocess_begin ()
void postprocess_end ()
bool postprocess_isInitialized ()
void postprocess_setBypass (bool bypass)
void postprocess_setOutputTransform (u32 transform)
void postprocess_setDisplayLut (u32 textureHandle, f32 amount)
void postprocess_setViewExposure (f32 ev)
void postprocess_clearPasses ()
void postprocess_setOutputViewport (u32 x, u32 y, u32 w, u32 h)
void postprocess_setPresentRequired (bool required)
void postprocess_beginScreenCapture ()
void postprocess_endScreenCapture ()
void postprocess_executeScreenPasses ()
u32 postprocess_addScreenPass (const std::string &name, u32 shaderHandle)
void postprocess_clearScreenPasses ()
void postprocess_setScreenUniformFloat (const std::string &passName, const std::string &uniform, f32 value)
void postprocess_setScreenUniformVec4 (const std::string &passName, const std::string &uniform, f32 x, f32 y, f32 z, f32 w)
static EstellaContext & ctx ()
static u32 checkGLErrors (const char *context)
void renderer_submitSkeletalBatchByEntity (ecs::Registry &registry, uintptr_t verticesPtr, i32 vertexCount, uintptr_t indicesPtr, i32 indexCount, u32 textureId, i32 blendMode, u32 entity, f32 skelScale, bool flipX, bool flipY, i32 layer, f32 depth, u32 materialId)
void renderer_submitSkeletalBatchByEntityEx (ecs::Registry &registry, uintptr_t verticesPtr, i32 vertexCount, uintptr_t indicesPtr, i32 indexCount, u32 textureId, i32 blendMode, u32 entity, f32 skelScale, bool flipX, bool flipY, i32 layer, f32 depth, u32 materialId, bool premultipliedColor)
void renderer_entityVisibleToCamera (ecs::Registry &registry, u32 entity, i32 layer, f32 minX, f32 minY, f32 maxX, f32 maxY, uintptr_t outVisiblePtr)
void renderer_submitTextBatch (uintptr_t verticesPtr, i32 vertexCount, uintptr_t indicesPtr, i32 indexCount, u32 textureId, uintptr_t transformPtr, u32 entity, i32 layer, f32 depth, i32 glyphMode, u32 cullBit)
void renderer_setRetainedTextCollected (bool collected)
 The frame draws the retained labels in its own collects from now on, and renderer_retainedTextSubmit draws nothing.
void meshRenderer_setGeometry (ecs::Registry &registry, u32 entity, uintptr_t posUvPtr, u32 vertexCount, uintptr_t colorsPtr, uintptr_t indicesPtr, u32 indexCount)
void meshInstances_set (ecs::Registry &registry, u32 entity, uintptr_t dataPtr, u32 count)
 The placements of a MeshInstances: sixteen f32 an instance (see the component). Empty clears the set.
u32 mesh_createFromChannels (uintptr_t channelsPtr, u32 channelCount, u32 vertexStride, uintptr_t vertexPtr, u32 vertexBytes, uintptr_t indexPtr, u32 indexCount, f32 minX, f32 minY, f32 minZ, f32 maxX, f32 maxY, f32 maxZ, uintptr_t bindPtr, u32 bindFloats, uintptr_t morphPtr, u32 morphFloats, u32 morphTargets, u32 morphNormals)
 Geometry from an .esmesh channel table; returns its handle, 0 on failure.
u32 mesh_rematerializeFromChannels (u32 targetHandle, uintptr_t channelsPtr, u32 channelCount, u32 vertexStride, uintptr_t vertexPtr, u32 vertexBytes, uintptr_t indexPtr, u32 indexCount, f32 minX, f32 minY, f32 minZ, f32 maxX, f32 maxY, f32 maxZ, uintptr_t bindPtr, u32 bindFloats, uintptr_t morphPtr, u32 morphFloats, u32 morphTargets, u32 morphNormals)
 Releases a mesh and the buffers it owns.
u32 mesh_setSkinChunks (u32 meshHandle, uintptr_t chunksPtr, u32 chunkCount, uintptr_t bonesPtr, u32 boneCount)
 Gives a skinned mesh the chunks it is drawn in: chunkCount records of three u32 (first index, index count, bones named) and every chunk's bones in turn as u16 indices into the bind matrices. Returns 1, or 0 where the engine refused them and a mesh bound to more joints than one draw carries is drawn static.
u32 mesh_setClusters (u32 meshHandle, uintptr_t clustersPtr, u32 clusterCount, uintptr_t indexPtr, u32 indexCount)
 Releases a mesh and the buffers it owns.
void mesh_release (u32 meshHandle)
u32 environment_create (uintptr_t shPtr, u32 specularHandle, f32 faceSize, u32 mipCount, f32 maxRange, u32 columns)
 Registers a baked environment: nine irradiance coefficients and the prefiltered reflection an ambient light casts.
void renderer_setSkyEnvironment (u32 environmentHandle)
 The environment the sky lights the scene with, 0 for none: an Ambient light that names no environment of its own lights with it (the Sky Atmosphere's Light the Scene).
void environment_setSky (u32 environmentHandle, u32 skyHandle)
 Gives an environment the panorama its sky is drawn from.
void environment_setSun (u32 environmentHandle, uintptr_t skyShPtr, f32 dx, f32 dy, f32 dz, f32 r, f32 g, f32 b)
 Gives an environment the sun its importer separated from the sky.
void environment_release (u32 environmentHandle)
 Releases an environment. Its atlas is an ordinary texture and outlives it.
u32 probe_volume_create (i32 resX, i32 resY, i32 resZ, uintptr_t shPtr)
 Registers a grid of baked irradiance — an environment sampled at points.
u32 probe_volume_createBricks (i32 resX, i32 resY, i32 resZ, i32 brickCount, uintptr_t bricksPtr, uintptr_t shPtr)
 Registers a sparse grid of baked irradiance: brickCount bricks of four ints (first finest-brick cell x, y, z and span) at bricksPtr, and brickCount*125*27 floats at shPtr, brick after brick.
void probe_volume_setSkyVisibility (u32 volumeHandle, uintptr_t visibilityPtr)
 Releases a probe volume.
bool probe_volume_getResolution (u32 volumeHandle, uintptr_t outPtr)
 The finest grid's probes along x, y and z, as three ints at outPtr. False for no such volume.
i32 probe_volume_getBricks (u32 volumeHandle, uintptr_t outPtr, i32 maxBricks)
 A sparse volume's bricks, four ints each (first finest-brick cell x, y, z and span), up to maxBricks of them at outPtr. Returns how many it has: 0 for a dense volume or none, more than maxBricks when cut short.
void probe_volume_release (u32 volumeHandle)
 Releases a probe volume.
u32 meshRenderer_setMeshAll (ecs::Registry &registry, u32 meshHandle)
 Points every MeshRenderer at one resident mesh; returns how many.
u32 meshRenderer_setMaterialAll (ecs::Registry &registry, u32 materialId)
 Points every MeshRenderer at one material; returns how many.
u32 meshRenderer_makeAllResident (ecs::Registry &registry)
 Freezes every MeshRenderer in the world; returns how many were frozen.
void renderer_init (u32 width, u32 height)
 Points a MeshRenderer at resident geometry; 0 returns it to its inline payload.
void renderer_resize (u32 width, u32 height)
void renderer_setOrigin (f64 x, f64 y, f64 z)
 The point the next frames are drawn relative to (RenderOrigin.hpp); the view-projection they are begun with is built for the same one.
void renderer_setParallaxAnchor (bool set, f64 x, f64 y)
bool renderThread_enabled ()
f64 renderThread_fence ()
bool renderThread_complete (f64 fence)
void renderThread_flush ()
void renderer_beginFrame (f32 elapsedSec)
void renderer_begin (uintptr_t matrixPtr, u32 targetHandle, i32 clearFlags, f32 r, f32 g, f32 b, f32 a, i32 clearX, i32 clearY, u32 clearW, u32 clearH)
void renderer_flush ()
void renderer_end ()
void renderer_endFrame ()
static void ensureTransformsUpdated (ecs::Registry &registry)
void renderer_updateTransforms (ecs::Registry &registry)
void renderer_setEntityDrawOrder (ecs::Registry &registry, uintptr_t entitiesPtr, u32 count)
static const std::unordered_set< u32 > * screenDomain ()
void renderer_beginScreenOverlay (uintptr_t projectionPtr, i32 vpX, i32 vpY, u32 vpW, u32 vpH)
void renderer_submitScreenOverlay (ecs::Registry &registry)
bool renderer_keepScreenOverlay (ecs::Registry &registry, bool hostStill)
void renderer_setScreenOverlayEffect (u32 material)
void renderer_endScreenOverlay (u32 targetHandle)
void renderer_drawOverScreen (i32 vpX, i32 vpY, u32 vpW, u32 vpH, u32 targetHandle)
void renderer_submitAll (ecs::Registry &registry, i32 vpX, i32 vpY, i32 vpW, i32 vpH)
void trail_update (ecs::Registry &registry, f32 dt)
void trail_clear (ecs::Registry &registry, u32 entity)
void springbone_update (ecs::Registry &registry, f32 dt)
void springbone_reset (ecs::Registry &registry, u32 entity)
void springbone_release (ecs::Registry &registry, u32 entity)
static std::vector< f32 > & springBoneSnapshot ()
u32 springbone_snapshot (ecs::Registry &registry, u32 entity)
u32 springbone_snapshotCount ()
uintptr_t springbone_snapshotData ()
void renderer_setStage (i32 stage)
u32 renderer_createTarget (u32 width, u32 height, i32 flags)
u32 renderer_getTargetDepthTexture (u32 handle)
void renderer_releaseTarget (u32 handle)
u32 renderer_getTargetTexture (u32 handle)
u32 renderer_queueMaterialBake (u32 material, u32 shader, u32 target, u32 x, u32 y, u32 w, u32 h, f32 a0, f32 a1, f32 a2, f32 a3, f32 b0, f32 b1, f32 b2, f32 b3)
bool renderer_projectMaterialBake (u32 ticket, u32 material, u32 target, u32 instances)
 Attach an additive, instanced projection to the just-queued material bake. Both run before the scene.
i32 renderer_materialBakeState (u32 ticket)
 0 waiting, 1 drawn, -1 not drawable; a drawn or failed ticket is forgotten once asked.
u32 renderer_getDrawCalls ()
std::string renderer_getPendingProgramLabels ()
 What each program still compiling in the background is, one per line: its id and what it was made for.
u32 renderer_getDrawsWaitingForProgram ()
 Scene draws the last frame left out because a program they use was still compiling in the background.
u32 renderer_getGpuDrawCalls ()
 Every draw the GPU was asked for in the last frame, every pass included (shadows, prepass, reflections, post-processing).
u32 renderer_getTriangles ()
u32 renderer_getSprites ()
u32 renderer_getSkeletal ()
u32 renderer_getText ()
u32 renderer_getMeshes ()
u32 renderer_getCulled ()
f32 renderer_getGpuTimeMs ()
void engine_setCpuProfiling (bool on)
void engine_setRandomSeed (u32 seed)
std::string engine_getCpuScopes ()
void engine_prepareMeshPrograms (u32 rowsPtr, u32 count, u32 outPtr)
 Readies the mesh programs a prepared cell requires, and reports what a readiness claim must record (layout in the .cpp).
std::string engine_getCounters ()
std::string engine_getGpuScopes ()
f64 renderer_getTextureBytes ()
f64 renderer_getEstimatedGpuBytes ()
f64 renderer_programEpoch ()
 The renderer's current program-readiness epoch. A readiness record stamped with an older one names programs that may be gone.
f64 renderer_deviceGeneration ()
 Which generation of the GPU device is current. Not part of a readiness claim — the guard that says the claim was taken on one device.
void renderer_setClearColor (f32 r, f32 g, f32 b, f32 a)
void renderer_setViewport (i32 x, i32 y, i32 w, i32 h)
void renderer_setAsyncComputeEnabled (bool enabled)
bool renderer_getAsyncComputeEnabled ()
bool renderer_supportsAsyncCompute ()
void renderer_setSkinCache (i32 enabled, i32 behavior, f32 maxMegabytes)
 The project's skin cache: on or off, which meshes go through it when their MeshSkin says Auto (0 every one, 1 only those that say Enabled), and the memory it may hold in megabytes. A device without compute poses every skin in the vertex stage.
f64 renderer_getSkinCacheStat (i32 which)
 The skin cache's state: 0 active, 1 meshes held, 2 bytes held, 3 refused this frame by the budget, 4 posed this frame, 5 draws this frame that read a posed copy.
void renderer_setYSortLayers (u32 mask)
void renderer_setTreeSortLayers (u32 mask)
void renderer_setQualityBudgets (u32 atlasSize, u32 cellSize, u32 cascades, u32 particleLimit)
void renderer_setDepthLayers (u32 mask)
void renderer_setViewLighting (u32 mode, f32 rotationDegrees, f32 keyIntensity, f32 fillIntensity, f32 skyIntensity, bool showSky)
void renderer_setPlanarReflectionQuality (f32 scale, u32 maxSize, f32 updatesPerSecond, bool capAuthored)
void renderer_setParticleDepthGrid (u32 texels)
void renderer_setQualityConstants (f32 x, f32 y, f32 z, f32 w)
std::string renderer_getPlanarReflectionStatus (u32 view, u32 entity)
void renderer_setShadowDistance (f32 distance)
void renderer_setShadow2DSoftSamples (u32 samples)
bool renderer_setQualityValue (const std::string &name, f32 value)
void renderer_setLightingDirect (bool on)
void renderer_setDepthPrepass (bool on)
void renderer_setProbesPerPixel (bool on)
 Whether meshes read their probe volume per pixel (true, the default) or per object, holding no probe atlas.
f64 renderer_getProbeAtlasBytes ()
 What the frame's probe atlas takes on the GPU, in bytes (0 while nothing reads per pixel).
u32 renderer_getProbeDraws (bool perPixel)
 Draws that read a probe volume last frame: per pixel when perPixel, else per object.
void renderer_setLodDistanceScale (f32 scale)
void renderer_setOcclusionGridSize (u32 size)
void renderer_setTargetPoolIdleBudget (u32 megabytes)
void renderer_setAsyncShaderCompile (bool on)
u32 renderer_getPendingShaders ()
void renderer_setCullingMask (u32 mask)
void renderer_setViewId (u32 view)
i32 renderer_framePending ()
 1 while the GPU is still working on the frame last ended (GfxDevice::framePending); asks without waiting.
i32 renderer_clusterInspect (u32 entity, uintptr_t outPtr)
 What the last frames drew of entity's Cluster LOD mesh: triangles and clusters, two u32 at outPtr; 0 when it has none drawn lately.
i32 renderer_lodInspect (u32 view, u32 entity, uintptr_t outPtr)
 What view decided about entity's LOD, into four floats at outPtr: level, the level the bare thresholds ask for, how many stand-ins are reachable, and the screen size measured.
std::string renderer_takeTextureWants ()
 What size each texture was asked for since the last call, as handle:side pairs joined by commas, and the record starts again.
void renderer_setImpostorAtlas (u32 entity, u32 texture, u32 frames)
 Hand entity's Impostor the atlas it draws from: texture holds frames x frames pictures.
void renderer_setLodPreview (u32 view, u32 entity, i32 level)
 Draw level for entity in view instead of the chosen one; a negative level goes back to the view's own choice.
void renderer_requestProbeCapture (f32 x, f32 y, f32 z, u32 face)
i32 renderer_pollProbeCapture ()
bool renderer_takeProbeCapture (uintptr_t dst, u32 bytes)
void renderer_setProbeVolumeReflection (u32 entity, u32 environmentHandle, u32 slot)
void renderer_setProbeVolumeOverride (u32 entity, u32 volumeHandle)
void renderer_setWorldUnitsPerMeter (f32 units)
void renderer_setViewShading (u32 view, i32 mode)
 Shade a view's meshes as authored (0), as neutral clay (1), as flat albedo (2), as wireframe (3), or as clay lit by the lights alone (4) or by everything that is not a light (5).
void renderer_setViewSelection (u32 view, uintptr_t idsPtr, u32 count)
 The editor's selection in view, outlined on screen: count entity ids at idsPtr; zero clears it.
void renderer_setViewSkinWeights (u32 view, u32 entity, i32 joint)
 Colour one skinned entity in a view by how much a joint moves each vertex.
void renderer_setMeshEdgeBuffers (bool enabled)
 Give meshes realized from now on an edge buffer, for a wireframe view.
i32 renderer_lightStatus (u32 entity, uintptr_t outPtr)
 What the light cap did to entity last frame, into nine floats at outPtr: accepted, refusal, limit, requested, refusedCount, then whether a light cast the environment's sun and the aim it took.
i32 renderer_shadowStatus (u32 entity, uintptr_t outPtr)
 What the shadow atlas gave entity last frame, into five floats at outPtr: requested, granted, refusal, deniedCasters, reducedCasters.
void renderer_setColorSpace (u32 linear)
void renderer_diagnose ()
void gl_enableErrorCheck (bool enabled)
u32 gl_checkErrors (const std::string &context)
i32 registry_getCanvasEntity (ecs::Registry &registry)
u32 registry_getGeneration (ecs::Registry &registry, u32 entity)
u32 registry_watchEntityChanges (ecs::Registry &registry)
void registry_unwatchEntityChanges (ecs::Registry &registry, u32 reader)
double registry_entityChangeSequence (ecs::Registry &registry)
double registry_entityChangeResetEpoch (ecs::Registry &registry)
double registry_componentMutationRevision (ecs::Registry &registry, u32 component, bool topology)
int registry_readEntityChanges (ecs::Registry &registry, double after, uintptr_t outputPtr, int capacity)
int registry_readWorldPoses2D (ecs::Registry &registry, uintptr_t entitiesPtr, int count, uintptr_t outputPtr)
void registry_batchSyncPhysicsTransforms (ecs::Registry &registry, uintptr_t bufferPtr, int count, float ppu)
void registry_markComponentsChanged (ecs::Registry &registry, uintptr_t pairsPtr, int count)
void renderer_captureNextFrame ()
u32 renderer_getCapturedFrameSize ()
uintptr_t renderer_getCapturedFrameData ()
uintptr_t renderer_getCapturedEntities ()
u32 renderer_getCapturedEntityCount ()
uintptr_t renderer_getCapturedTextures ()
u32 renderer_getCapturedTextureCount ()
u32 renderer_getCapturedPassCount ()
bool renderer_hasCapturedData ()
void renderer_replayToDrawCall (i32 drawCallIndex)
bool renderer_snapshotMatchesCapture ()
i32 renderer_pollSnapshotReadback ()
bool renderer_copyCapturedRecords (uintptr_t dest, u32 destSize)
bool renderer_copyCapturedEntities (uintptr_t dest, u32 destSize)
bool renderer_copyCapturedTextures (uintptr_t dest, u32 destSize)
bool renderer_copySnapshot (uintptr_t dest, u32 destSize)
uintptr_t renderer_getSnapshotPtr ()
u32 renderer_getSnapshotSize ()
u32 renderer_getSnapshotWidth ()
u32 renderer_getSnapshotHeight ()
u32 renderer_captureFrame (u32 w, u32 h)
u32 renderer_captureTarget (u32 target, u32 w, u32 h)
bool renderer_takeTargetCapture (u32 handle, uintptr_t dest, u32 destSize)
i32 renderer_pollFrameCapture (u32 handle)
bool renderer_takeFrameCapture (u32 handle, uintptr_t dest, u32 destSize)
u32 renderer_createSkeletalPreview (i32 w, i32 h)
i32 renderer_submitSkeletalPreviewBatch (u32 preview, uintptr_t verticesPtr, i32 vertexCount, uintptr_t indicesPtr, i32 indexCount, u32 textureId, i32 blendMode, uintptr_t transformPtr, i32 layer, f32 depth, u32 materialId)
i32 renderer_submitSkeletalPreviewBatchEx (u32 preview, uintptr_t verticesPtr, i32 vertexCount, uintptr_t indicesPtr, i32 indexCount, u32 textureId, i32 blendMode, uintptr_t transformPtr, i32 layer, f32 depth, u32 materialId, bool premultipliedColor)
i32 renderer_renderSkeletalPreview (u32 preview, uintptr_t viewProjectionPtr)
i32 renderer_pollSkeletalPreview (u32 preview)
uintptr_t renderer_getSkeletalPreviewPtr (u32 preview)
u32 renderer_getSkeletalPreviewSize (u32 preview)
u32 renderer_getSkeletalPreviewWidth (u32 preview)
u32 renderer_getSkeletalPreviewHeight (u32 preview)
void renderer_destroySkeletalPreview (u32 preview)
void renderer_setPreviewOrbit (f32 yawDegrees, f32 pitchDegrees)
 The angle the next mesh or material preview is seen from, degrees: yaw about up, pitch above the horizon.
void renderer_renderMaterialPreview (u32 materialId, i32 w, i32 h, u32 meshId, u32 textureId)
void renderer_renderMeshPreview (u32 meshId, i32 w, i32 h)
i32 renderer_pollPreviewReadback ()
uintptr_t renderer_getPreviewPtr ()
u32 renderer_getPreviewSize ()
u32 renderer_getPreviewWidth ()
u32 renderer_getPreviewHeight ()
void renderer_setTextureParams (u32 textureId, i32 minFilter, i32 magFilter, i32 wrapS, i32 wrapT)
u32 rm_createTexture (resource::ResourceManager &rm, u32 width, u32 height, uintptr_t pixelsPtr, u32 pixelsLen, i32 format, bool flipY, u32 content)
u32 rm_createTextureEx (resource::ResourceManager &rm, u32 width, u32 height, uintptr_t pixelsPtr, u32 pixelsLen, i32 format, bool flipY, i32 filterMode, i32 wrapMode, u32 content)
u32 rm_createTextureArray (resource::ResourceManager &rm, u32 width, u32 height, u32 layers, uintptr_t pixelsPtr, u32 pixelsLen, i32 format, i32 filterMode, i32 wrapMode, u32 content)
bool rm_supportsCompressedFormat (resource::ResourceManager &rm, i32 format)
u32 rm_createCompressedTexture (resource::ResourceManager &rm, u32 width, u32 height, i32 format, uintptr_t dataPtr, u32 dataLen, u32 mipLevels, u32 content)
u32 rm_createShader (resource::ResourceManager &rm, const std::string &vertSrc, const std::string &fragSrc)
u32 rm_registerExternalTexture (resource::ResourceManager &rm, u32 glTextureId, u32 width, u32 height, u32 content)
u32 rm_wrapDeviceTexture (resource::ResourceManager &rm, u32 textureId, u32 width, u32 height)
 A resource handle for a device texture another owner keeps (a render target's colour).
void rm_forgoTextureContent (resource::ResourceManager &rm, u32 handle)
 Gives up on an owed texture's content; it keeps blank storage.
void rm_restoreTextureContent (resource::ResourceManager &rm, u32 handle)
u32 rm_getTextureNativeId (resource::ResourceManager &rm, u32 handle)
bool rm_adoptTextureContent (resource::ResourceManager &rm, u32 target, u32 source)
 Moves a freshly loaded texture's pixels behind an owed handle.
std::string rm_texturesAwaitingReupload (resource::ResourceManager &rm)
 The textures the device is waiting for content for, as handle|content|path lines.
std::string rm_meshesAwaitingRemat (resource::ResourceManager &rm)
 Replayable meshes still owed their geometry, as comma-separated handle ids. No path: the engine never knew one, and the asset layer holds it.
std::string rm_meshRealizations (resource::ResourceManager &rm)
 Every live mesh as handle:realized.
u32 rm_registerExternalTextureSized (resource::ResourceManager &rm, u32 glTextureId, u32 width, u32 height, u32 bytes, u32 content)
void rm_releaseTexture (resource::ResourceManager &rm, u32 handleId)
u32 rm_getTextureRefCount (resource::ResourceManager &rm, u32 handleId)
void rm_registerTextureWithPath (resource::ResourceManager &rm, u32 handleId, const std::string &path)
void rm_setTextureBudget (resource::ResourceManager &rm, u32 bytes)
void rm_setRetainedBudget (resource::ResourceManager &rm, u32 bytes)
u32 rm_acquireTextureByPath (resource::ResourceManager &rm, const std::string &path)
bool rm_invalidateTexturePath (resource::ResourceManager &rm, const std::string &path)
u32 rm_trimTextureCache (resource::ResourceManager &rm)
void rm_releaseShader (resource::ResourceManager &rm, u32 handleId)
u32 rm_getShaderRefCount (resource::ResourceManager &rm, u32 handleId)
u32 rm_getTextureGLId (resource::ResourceManager &rm, u32 handleId)
void rm_updateTextureSubregion (resource::ResourceManager &rm, u32 handleId, u32 x, u32 y, u32 width, u32 height, uintptr_t pixelsPtr, u32 pixelsLen)
void rm_setTextureMetadata (resource::ResourceManager &rm, u32 handleId, f32 left, f32 right, f32 top, f32 bottom)
static EstellaContext & ctx ()
bool uiLayout_update (ecs::Registry &registry, f32 boxLeft, f32 boxBottom, f32 boxRight, f32 boxTop, bool propertyDirty)
bool uiHitTest_inputsChanged (ecs::Registry &registry)
void uiHitTest_update (ecs::Registry &registry, f32 originX, f32 originY, f32 originZ, f32 dirX, f32 dirY, f32 dirZ)
void uiHitTest_updateDomains (ecs::Registry &registry, f32 worldOriginX, f32 worldOriginY, f32 worldOriginZ, f32 worldDirX, f32 worldDirY, f32 worldDirZ, f32 screenOriginX, f32 screenOriginY, f32 screenOriginZ, f32 screenDirX, f32 screenDirY, f32 screenDirZ)
 The hit test with a ray per domain — world content and world-space UI answer the first, screen UI the second.
u32 uiHitTest_getHitEntity ()
u32 uiHitTest_pick (ecs::Registry &registry, f32 worldX, f32 worldY)
u32 uiHitTest_pickAll (ecs::Registry &registry, f32 worldX, f32 worldY)
u32 uiHitTest_pickResult (u32 index)
f32 uiNode_computedWidth (ecs::Registry &r, u32 e)
f32 uiNode_computedHeight (ecs::Registry &r, u32 e)
const std::unordered_map< u32, i32 > * uiTreeLayers ()
void uiRenderOrder_update (ecs::Registry &registry)
i32 ui_getRenderOrder (ecs::Registry &registry, u32 entity)
u32 ui_getCullBit (ecs::Registry &registry, u32 entity)
bool ui_isScreenDomain (ecs::Registry &registry, u32 entity)
 Whether entity belongs to the SCREEN rather than to the world.
bool getUINodeHiddenInTree (ecs::Registry &registry, u32 entity)
f32 getUINodeAlphaInTree (ecs::Registry &registry, u32 entity)
f32 getUINodeComputedWidth (ecs::Registry &registry, u32 entity)
f32 getUINodeComputedHeight (ecs::Registry &registry, u32 entity)
bool transform_copyFlatRenderMatrix (ecs::Registry &registry, u32 entity, uintptr_t outputPtr)
void transform_update (ecs::Registry &registry)
static EngineContext & legacyCtx ()
static EstellaContext & ctx ()
f64 es_getMallocBytes ()
emscripten::val esshader_cookInfo (const std::string &source, const std::string &featuresCsv)
bool initRendererInternal (const char *canvasSelector)
bool initRendererWebGPU (const std::string &canvasSelector, u32 width, u32 height, bool readback, bool preferBGRA)
bool initRendererThreaded (bool preferGPU, const std::string &features, bool readback)
i32 renderThread_bootStatus ()
void renderThread_resizeSurface (u32 width, u32 height)
bool initRenderer ()
bool initRendererWithContext (int contextHandle)
void shutdownRenderer ()
resource::ResourceManager * getResourceManager ()
u32 deviceStatus ()
 The device's status (see GfxDeviceStatus). Live when no device exists yet.
std::string deviceLostReport ()
 The formatted loss report; empty while the device is live.
std::string deviceIdentity ()
 Who the device is, as backend|vendor|renderer|version.
bool provideReplacementDevice ()
 Hands the backend a replacement device the page acquired.
bool recoverDevice ()
 Rebuilds the device and everything it issued; see GfxDevice::recoverDevice.
void notifyDeviceLost (u32 reason, const std::string &message)
 Reports a loss the page observed.
double registryLayoutEpoch (ecs::Registry &r)
double es_profile_now_ms ()
u16 packHalf (f32 value)
 IEEE binary32 to binary16.
void setPendingRandomSeed (u32 seed)
bool takePendingRandomSeed (u32 &out)
template<typename T>
constexpr const char * component_name ()
 Get the script name for a component type.
u64 nextRevision ()
 A revision no content has had before. Never 0, which reads as "none".
template<typename T, typename... Args>
constexpr Unique< T > makeUnique (Args &&... args)
 Creates a Unique pointer with the given arguments.
template<typename T, typename... Args>
constexpr Shared< T > makeShared (Args &&... args)
 Creates a Shared pointer with the given arguments.
template<typename T>
TypeId componentTypeId ()
 Dense 0-based runtime id for a component type (ECS pool index + mask bit).
template<typename T>
TypeId serviceTypeId ()
 Dense 0-based runtime id for a service type (ServiceRegistry key).
template<typename SignalType>
auto sink (SignalType &signal)
 Create a sink for a signal.
bool batchEntityVisible (const DrawList &drawList, const ClipState &clips, Entity entity, i32 layer, u32 cullBit)
void pushBatchDraw (DrawList &drawList, const ClipState &clips, u32 vertexByteOffset, u32 vertexCount, u32 indexOffset, u32 indexCount, const BatchDrawKey &key)
 Atomic primitive: assemble + clip + push one DrawCommand for an index range ALREADY written into (or, for instanced draws, static in) the key's stream.
void pushBatchCommand (TransientBufferPool &pool, DrawList &drawList, const ClipState &clips, u32 vertexByteOffset, u32 vertexCount, const u32 *localIndices, u32 indexCount, const BatchDrawKey &key)
 Pushes a DrawCommand for vertices ALREADY resident in the Batch stream at vertexByteOffset.
void pushBatchCommand (TransientBufferPool &pool, DrawList &drawList, const ClipState &clips, u32 vertexByteOffset, u32 vertexCount, const u16 *localIndices, u32 indexCount, const BatchDrawKey &key)
void appendIndexedDraw (TransientBufferPool &pool, DrawList &drawList, const ClipState &clips, const void *verts, u32 vertexCount, const u32 *localIndices, u32 indexCount, const BatchDrawKey &key)
 Copies raw vertices into the key's stream, then pushes one DrawCommand spanning them.
void appendIndexedBatch (TransientBufferPool &pool, DrawList &drawList, const ClipState &clips, const BatchVertex *verts, u32 vertexCount, const u32 *localIndices, u32 indexCount, const BatchDrawKey &key)
 Copies verts into the Batch stream, then pushes one DrawCommand spanning them.
void appendQuads (TransientBufferPool &pool, DrawList &drawList, const ClipState &clips, const BatchVertex *quads, u32 quadCount, const BatchDrawKey &key)
glm::vec3 rotatePoint (const glm::vec3 &center, f32 px, f32 py, f32 cosA, f32 sinA)
 Rotates a point around center in the XY plane, carrying the center's z through untouched — the rotation a 2D renderer means is about z.
void appendQuad (TransientBufferPool &pool, DrawList &drawList, const ClipState &clips, const BatchVertex quad[4], const BatchDrawKey &key)
i32 batchGlyphModeBits (TextGlyphMode mode)
f32 withTextureSlot (f32 texIndex, i32 slot)
u32 packColor (f32 r, f32 g, f32 b, f32 a)
u32 packColor (const glm::vec4 &c)
GfxStencilMode stencilModeOf (u16 stateFlags)
 The stencil mode a draw's state flags mean.
const char * batchBreakCounter (BatchBreak r)
static bool isBlendedStage (RenderStage stage)
static bool takesPartInPrepass (const DrawCommand &cmd)
 A draw the prepass takes in: opaque and depth-writing, with a program of its own for it, and nothing that changes where it lands (a stencil).
void drawParamSizeAlign (DrawParamType t, u32 &size, u32 &align)
 std140 size/base-alignment of a supported param type.
DrawParamsRewrite rewriteLooseUniforms (const std::string &vertexSrc, const std::string &fragmentSrc)
 Lifts loose non-sampler uniform declarations out of both stages into one shared std140 DrawParams block.
bool gatherLodLevels (resource::ResourceManager &resources, const ecs::LODGroup &group, const Mesh &base, LodLevels &out)
const Mesh * placementCoarseMesh (resource::ResourceManager &resources, const Mesh &base, const ecs::MeshInstances &placements)
void meshLocalBounds (const Mesh &base, const Mesh *coarse, f32 displacement, glm::vec3 &lo, glm::vec3 &hi)
bool retainedTextAutoIsSdf (f32 worldScaleX)
bool retainedTextClipPlanes (double *out, const f32 *view, const f32 *model)
int retainedTextClassify (const double *planes, double left, double bottom, double right, double top)
 0 outside, 1 inside, 2 crossing a clip plane. Non-finite bounds stay visible.
RetainedTextKept retainedTextClip (const RetainedTextBatch &batch, const double *planes, RetainedTextClip &scratch)
constexpr SpriteDrawChoice resolveSpriteDraw (ecs::SpriteDrawMode mode, bool hasTileSize, bool hasSliceBorder)
 Resolve the geometry from the author's mode and what the data offers.
bool maskReaches (const ResolvedMask &mask, const DrawList::SortIdentity &where)
 Whether mask still covers a draw sitting at where.
const ResolvedMask * nearestReachingMask (const ResolvedMask *masks, u32 count, const DrawList::SortIdentity &where)
 The mask whose ref the stencil still holds at where, or null.
TextGlyphMode textGlyphModeFromRaw (i32 raw)
 The mode a raw script-side value names; anything out of range is Color, the draw that cannot be wrong about a page it does not understand.
DynamicGIScene & dynamicGIScene ()
const DynamicGIStats & dynamicGIStats ()
glm::vec4 cameraFromViewProjection (const glm::mat4 &viewProjection)
 Where the frame is seen from, read out of the matrix that projects it.
glm::mat4 toClipDepthRange (const glm::mat4 &p, ClipDepthRange range)
 The projection p as a device keeping range wants it.
bool planarReflectionCamera (const glm::mat4 &source, const glm::vec3 &origin, glm::vec3 normal, f32 offset, PlanarReflectionCamera &out)
constexpr bool qualitySpecsInOrder ()
constexpr f32 qualityCap (QualityValue id)
glm::vec3 srgbToLinearCpu (const glm::vec3 &c)
static glm::vec3 lightForward (ecs::Transform *transform)
static glm::vec3 environmentToWorld (const glm::vec3 &d, f32 yawDegrees)
static void neutralSkyIrradiance (std::array< glm::vec3, 9 > &sh)
static void frustumCorners (const glm::mat4 &invVP, glm::vec3 out[8])
static f32 splitFraction (u32 i, u32 count, f32 nearDist, f32 farDist, f32 lambda)
static glm::mat4 spotProjection (f32 fovDegrees, f32 nearDist, f32 farDist)
static glm::vec3 shadowUp (const glm::vec3 &dir)
 An up that cannot be parallel to dir, whichever way it points.
static glm::mat4 coneShadow (const glm::vec3 &pos, const glm::vec3 &dir, f32 fovDegrees, f32 reach)
static glm::vec3 cubeFace (u32 index)
std::vector< u8 > buildRippleNormals ()
 RGBA8, RIPPLE_NORMALS_SIZE square. A texel's rg (and ba) is the xy of a unit normal whose z is up: the slope there is xy / z.
bool shadesAsClay (ShadingMode mode)
 Whether a mode draws meshes as clay (the lit neutral surface).
static bool isRadialMethod (ecs::UIFillMethod m)
static f32 radialStartAngle (ecs::UIFillOrigin origin)
static f32 radialMaxSweep (ecs::UIFillMethod m)
glm::dvec3 & renderOrigin ()
 The origin, in world units. A double, as the world positions it is taken from are far from zero.
void setRenderOrigin (const glm::dvec3 &origin)
glm::vec3 rebased (const glm::vec3 &world)
 A world position as the frame draws it: from the origin.
glm::mat4 viewProjectionFromOrigin (const glm::mat4 &viewProjection, const glm::dvec3 &origin)
 A view-projection made for origin, for a point given from the origin now: the point from the old origin is the new one's plus the step between them.
glm::mat4 modelFromOrigin (const glm::mat4 &model, const glm::dvec3 &origin)
 A model placed from origin, as it is placed from the origin now.
ParallaxAnchor & parallaxAnchor ()
CameraView computeCameraView (const glm::mat4 &viewProjection)
glm::vec3 towardViewer (const glm::vec3 &worldPos, const CameraView &camera)
 Decomposes transform and returns its world position shifted toward the camera by (1 - parallax); factor 1 = no shift, 0 = screen-pinned. Applied before the frustum cull so a parallaxed renderable is culled where drawn.
glm::vec3 ribbonSide (const glm::vec3 &tangent, const glm::vec3 &worldPos, const CameraView &camera, const glm::vec3 &lastSide)
 The side vector a ribbon widens along: perpendicular to both its path and the viewer, so the strip faces the eye instead of lying in one plane.
glm::vec3 parallaxedWorldPosition (ecs::Transform &transform, const glm::vec2 &parallax, const CameraView &camera)
glm::vec2 flatTurnZ (const glm::quat &rotation)
 The cos/sin of the turn a plane renderable draws with: its entity's rotation about Z, which is the only part a flat quad uses.
void orientedWorldAabb (const glm::vec3 &position, const glm::quat &rotation, const glm::vec3 &scale, const glm::vec3 &localMin, const glm::vec3 &localMax, glm::vec3 &outCentre, glm::vec3 &outHalf)
 The world AABB of a turned box: its centre and half-extents, from a local box and the position, rotation and scale that place it.
glm::vec3 flatHalfExtents (const glm::vec2 &turn, const glm::vec3 &half)
 World AABB half-extents of a flat box turned by turn (from flatTurnZ). |R| * half, exact for a box. An unturned entity gets half back, so the result is never narrower than the box itself.
u32 shaderDataTypeSize (ShaderDataType type)
 Gets the size in bytes of a shader data type.
u32 shaderDataTypeComponentCount (ShaderDataType type)
 Gets the component count of a shader data type.
constexpr bool meshShaderReads (MeshChannel c)
 Whether the mesh shaders READ a channel, as opposed to the file carrying it.
u32 gfxBytesPerPixel (GfxPixelFormat fmt)
 Bytes one pixel occupies in the CALLER's upload buffer — the single source both backends size a read of caller-owned pixels with. A backend's own texel size may differ (RGB8 widens to RGBA8 on WebGPU). Depth formats are attachment-only and never uploaded.
GfxBlockInfo gfxCompressedBlockInfo (GfxCompressedFormat fmt)
u32 gfxWholeBlockLevels (GfxCompressedFormat fmt, u32 width, u32 height, u32 mipLevels)
 How many mip levels of a width x height image are WHOLE blocks, counting from the base — the levels a compressed copy may write, since a copy whose size is not a multiple of the block is refused. 72x72 has two (72, 36; 18 stops it) and 70x70 has none, which is what makes an image uncompressible rather than merely short of mips.
u32 gfxCompressedPyramidBytes (GfxCompressedFormat fmt, u32 width, u32 height, u32 mipLevels)
 Total bytes of a full mip pyramid (levels 0..mipLevels-1) for a base-size compressed texture — the block-aligned sum both the transcoder (packing) and the device (uploading) agree on.
std::string gfxFormatDeviceLost (const GfxDeviceLostInfo &info)
 The whole report as one line, for a log or a crash report.
const char * gfxDeviceLostReasonName (GfxDeviceLostReason reason)
 Human-readable reason, for logs and diagnostics reports.
bool writesStencil (GfxStencilMode mode)
void stageTextureRows (u8 *dst, const u8 *src, u32 width, u32 height, u32 srcBpp, u32 dstBpp, bool reverseRows)
constexpr u32 textureBindingForUnit (u32 unit)
 Group-1 binding of a texture unit. Units 0-7 are the batch stream and take bindings 0-7; a material's own units start at 8 and take 16 upward, leaving 8-15 for the samplers underneath the first eight.
constexpr u32 samplerBindingForUnit (u32 unit)
 Group-1 binding of a texture unit's sampler (see textureBindingForUnit).
u64 scanWGSLBindingMask (const char *source, u32 group)
 Bit mask of the @group(N) @binding(i) indices a WGSL source declares.
void scanWGSLReachedUnits (const char *source, u32 &textures, u32 &samplers)
 The tN / sN names a WGSL source REACHES, by unit.
const char * hdrRefusalName (HdrRefusal why)
 The refusal as a word, for a log line and for a reader.
const char * pixelFormatName (GfxPixelFormat format)
 A pixel format as a word.
HdrFormatDecision decideHdrFormat (bool linearOutput, bool supportsFloatTargets)
 What a linear project asks for, and what supportsFloatTargets grants.
bool & glslMultiDraw ()
 Whether this process's GLSL mesh programs count through a run's entries by gl_DrawID.
f32 packShadowBias (f32 texels, f32 slopeFloor)
f32 packLightLayerRange (i32 layerMin, i32 layerMax)
 The range of sprite layers a light reaches, as the number that rides in shadowMap.y above the tile count. 0 is every layer.
u32 lightReachMask2D (const GpuLight *lights, u32 count, const glm::vec2 &lo, const glm::vec2 &hi)
 Bit i set when loop light i can put any light on the box lo .. hi (the plane's XY, the space the vertices are in).
f32 packSpriteLightLane (i32 layer, u32 reachMask)
 The lane a lit quad carries: its layer and the lights that reach it (lightReachMask2D).
const char * lightRefusalName (LightRefusal why)
 The refusal as a word, for a log line and for a reader.
MaterialDefaultTexture materialDefaultByName (const std::string &name)
 Maps a shader's declared default(<name>) to the built-in it names.
const char * refusalName (AtlasRefusal why)
 The refusal as a word, for a log line and, later, for a reader.
bool shadowMasksCollide (const ShadowMaskLight &a, const ShadowMaskLight &b)
 Whether two lights cannot share a channel: one reads where the other writes.
u32 assignShadowChannels (const ShadowMaskLight *lights, u32 count, u32 channels, i32 *out)
 Gives each light the first channel none of its collisions hold, in the order the lights are given.
ShadowGrant claimTiles (ShadowAtlas &atlas, Entity light, u32 want, u32 cells, i32 &outFirst, ShadowClaim policy=ShadowClaim::AllOrNothing)
 Claim a complete shadow map, or explicitly allow fewer cascades.
void markLightTiles (const glm::mat4 &viewProjection, const glm::vec3 &center, f32 radius, u32 index, u32(*masks)[4])
static bool isSrgbFormat (WGPUTextureFormat f)
std::vector< u32 > distinctMeshEdges (ConstSpan< u32 > indices)
 Index pairs, one per distinct edge, in ascending order of (low, high) vertex.
Retained text

Glyph quads handed over once and submitted by the engine each frame (see RetainedText.hpp).

void renderer_retainedTextBegin (u32 entity, i32 sdf, i32 screen, i32 hasBox, i32 layer, f32 boxWidth, f32 boxHeight, i32 autoKind)
void renderer_retainedTextBatch (u32 entity, uintptr_t verticesPtr, i32 vertexCount, uintptr_t indicesPtr, i32 indexCount, u32 pageId, i32 glyphMode)
void renderer_retainedTextClear (u32 entity)
 Forgets an entity's retained text.
i32 renderer_retainedTextStale (ecs::Registry &registry, uintptr_t outPtr, i32 capacity)
 The entities whose retained text no longer matches the world, written to outPtr as u32s.
void renderer_retainedTextSubmit (ecs::Registry &registry, i32 screen, uintptr_t projectionPtr)

Variables

EstellaContext * g_activeContext = nullptr
 The explicitly-installed active engine context (or null if none).
static ecs::UITreeOrder g_uiTreeOrder
static constexpr const char * kEstellaBuildProvenance
static std::atomic< int > threadedBoot {0}
static constexpr u32 ENTITY_POSE_2D_WORDS = 4
template<typename T>
constexpr bool is_component_v = is_component<T>::value
 Helper variable template for is_component.
constexpr Entity INVALID_ENTITY {}
 Invalid entity sentinel value.
constexpr u32 INVALID_DENSE_INDEX = std::numeric_limits<u32>::max()
 Sentinel for empty sparse set slots.
constexpr CallbackId INVALID_CALLBACK_ID = 0
constexpr glm::vec4 BATCH_QUAD_POSITIONS [4]
 Canonical centered unit-quad corner positions (CCW).
constexpr glm::vec2 BATCH_QUAD_TEX_COORDS [4]
 Unit-quad texture coordinates matching BATCH_QUAD_POSITIONS.
constexpr u32 BATCH_QUAD_INDICES [6] = { 0, 1, 2, 2, 3, 0 }
 Canonical two-triangle quad winding shared by every batch path.
constexpr i32 BATCH_SLOT_BITS = 3
constexpr i32 BATCH_DITHER_BIT = 1 << 8
constexpr i32 BATCH_DITHER_PHASE_BIT = 1 << 9
static constexpr u32 MAX_CMD_TEXTURE_SLOTS = 8
static constexpr u16 CMD_STATE_SCISSOR = 0x01
static constexpr u16 CMD_STATE_STENCIL_WRITE = 0x02
static constexpr u16 CMD_STATE_UI_STENCIL = 0x20
static constexpr u16 CMD_STATE_STENCIL_INCREMENT = 0x40
static constexpr u16 CMD_STATE_STENCIL_DECREMENT = 0x80
static constexpr u16 CMD_STATE_STENCIL_ZERO = 0x100
static constexpr u16 CMD_STATE_STENCIL_TEST = 0x04
static constexpr u16 CMD_STATE_CUSTOM_DRAW = 0x08
static constexpr u16 CMD_STATE_STENCIL_OUT = 0x10
constexpr u32 DRAW_PARAMS_BINDING = 4
 Indexed UBO binding point for the per-draw DrawParams block. (0 = FrameConstants, 1 = MaterialConstants, 2 = LightConstants, 3 = TimeConstants.).
constexpr const char * DRAW_PARAMS_BLOCK = "DrawParams"
 GLSL block name; must match the rewriter's generated block + Shader::compile lookup.
constexpr u32 DRAW_PARAMS_FALLBACK_SIZE = 4096
 Size of the zeroed fallback UBO RenderContext binds at DRAW_PARAMS_BINDING each frame.
constexpr u32 RETAINED_TEXT_BLOCK_QUADS = 64
 Quads in one bounds block: a view that misses the whole block does not look at its quads.
constexpr u32 RETAINED_TEXT_QUAD_FLOATS = 4 * TEXT_VERTEX_FLOATS
constexpr i32 TEXT_VERTEX_FLOATS = 9
constexpr u32 kDynamicGIStatFloats = 16
constexpr u32 FRAME_CONSTANTS_BINDING = 0
 Indexed uniform binding point the FrameConstants block is bound to.
constexpr const char * FRAME_CONSTANTS_BLOCK = "FrameConstants"
 GLSL block name; must match the shader declarations and Shader::compile lookup.
constexpr u32 TIME_CONSTANTS_BINDING = 3
constexpr const char * TIME_CONSTANTS_BLOCK = "TimeConstants"
constexpr QualityValueSpec QUALITY_VALUE_SPECS []
constexpr u32 QUALITY_VALUE_COUNT = static_cast<u32>(QualityValue::Count)
constexpr u32 kShadowAtlasSize = 2048
constexpr u32 kShadowCellSize = 512
constexpr u32 kShadowCascadeCells = 2
constexpr u32 RIPPLE_NORMALS_SIZE = 256
constexpr u32 RIPPLE_NORMALS_LONGEST = 2
 The longest wave in a field runs this many times across the texture, the shortest twenty: a field read at one size holds a decade of lengths.
constexpr u8 kShadingModeCount = 7
constexpr f32 kClusterPixelError = 1.0f
 The error a clustered mesh may show, in pixels of the scene view, before a finer cluster is drawn.
constexpr u64 kClusterCutIdleCollects = 2048
 Collects a cut may go undrawn before its buffer is given back. A frame has several: the scene's, each shadow map's.
constexpr u64 kClusterCutFreshCollects = 64
static constexpr u32 GFX_INVALID_UNIFORM_BLOCK = 0xFFFFFFFFu
 Sentinel returned by getUniformBlockIndex when a program has no such block (GL_INVALID_INDEX).
static constexpr u32 GFX_UNIFORM_OFFSET_ALIGNMENT = 256
 What a uniform binding's offset must be a multiple of: the largest either API may ask.
constexpr AsyncComputeFence kNoAsyncComputeFence = -1
static constexpr u32 LAYOUT_COUNT = 5
static constexpr u32 MESH_INSTANCE_TEXELS = 8
static constexpr u32 MESH_INSTANCE_TEXEL_MODEL = 0
static constexpr u32 MESH_INSTANCE_TEXEL_TINT = 3
static constexpr u32 MESH_INSTANCE_TEXEL_NORMAL = 4
static constexpr u32 MESH_INSTANCE_TEXEL_LIGHTMAP = 7
static constexpr u32 MESH_INSTANCE_STRIDE = MESH_INSTANCE_TEXELS * 16
static constexpr u32 PARTICLE_INSTANCE_STRIDE = 60
static constexpr u32 MESH_INSTANCE_TEXTURE_WIDTH = 2048
static constexpr u32 MESH_INSTANCE_MAX_RECORDS
static constexpr u32 MESH_INSTANCE_TEXTURE_UNIT = 15
static constexpr u32 MESH_MAX_BONES = 256
static constexpr u32 MESH_MAX_ACTIVE_MORPHS = 64
static constexpr u32 MORPH_TEXTURE_WIDTH = 2048
static constexpr u32 MORPH_MAX_TEXELS = MORPH_TEXTURE_WIDTH * MORPH_TEXTURE_WIDTH
static constexpr u32 MESH_VARIANTS = 4096
static constexpr u32 MAX_VERTEX_ATTRIBUTES = 16
static constexpr u32 MAX_VERTEX_BUFFER_SLOTS = 2
constexpr u32 GFX_UNBOUND_BLOCK = 0xFFFFFFFFu
constexpr u32 WGSL_MAX_TEXTURE_UNITS = 17
 Units a tN / sN name can carry — the batch stream and a material's own.
constexpr const char * SHADOW_MAP_SAMPLER = "u_shadowMap"
 The injected shadow-map sampler, and the texture unit Shader::compile pins it to.
constexpr u32 SHADOW_MAP_TEXTURE_UNIT = 2
constexpr const char * ENV_MAP_SAMPLER = "u_envMap"
 The injected reflection sampler, one unit past the shadow map's.
constexpr u32 ENV_MAP_TEXTURE_UNIT = 3
constexpr const char * MORPH_DELTA_SAMPLER = "u_morphDeltas"
 The sampler a mesh's morph deltas arrive through, and the unit it is pinned to.
constexpr u32 MORPH_DELTA_TEXTURE_UNIT = 4
constexpr const char * LIGHTMAP_SAMPLER = "u_lightmap"
 The baked-light atlas, and the unit a lightmapped mesh samples it from.
constexpr u32 LIGHTMAP_TEXTURE_UNIT = 5
constexpr const char * PROBE_GRID_SAMPLER = "u_probeGrid"
 The frame's probe atlas, read per pixel, on the bake's unit.
constexpr const char * SHAPE_2D_SAMPLER = "u_lightShape2D"
 The 2D light-shape mask, and the unit below the shadow mask's.
constexpr u32 SHAPE_2D_TEXTURE_UNIT = 6
constexpr const char * SHADOW_2D_SAMPLER = "u_shadow2D"
 The 2D shadow mask, and the texture unit every Lit shader samples it from.
constexpr u32 SHADOW_2D_TEXTURE_UNIT = 7
constexpr const char * WATER_SUN_SAMPLER = "u_waterSunField"
constexpr u32 WATER_SUN_TEXTURE_UNIT = 16
constexpr u32 INSTANCE_CONSTANTS_BINDING = 8
 Indexed UBO binding point for the per-draw InstanceConstants block. Nine and not four: slot 4 is DRAW_PARAMS_BINDING, which every shader whose loose uniforms were lifted declares — two blocks on one binding is a pipeline the device refuses without naming either.
constexpr const char * INSTANCE_CONSTANTS_BLOCK = "InstanceConstants"
 GLSL block name; must match the injected mesh header + Shader::compile lookup.
constexpr const char * INSTANCE_DATA_SAMPLER = "u_instanceData"
 GLSL name of the record texture; pinned to its unit by Shader::compile.
constexpr u32 MULTI_DRAW_MAX = 64
 The most draws one call may carry where the device draws runs (WEBGL_multi_draw).
constexpr u32 LIGHT_CONSTANTS_BINDING = 2
 Indexed UBO binding point for the per-frame LightConstants block.
constexpr const char * LIGHT_CONSTANTS_BLOCK = "LightConstants"
 GLSL block name; must match ShaderParser's injected block + Shader::compile lookup.
constexpr u32 MAX_LIGHTS = 16
 Max simultaneous 2D lights packed into the UBO. The injected fragment loop is a fixed bound; inactive slots are zeroed (intensity 0) so they contribute nothing. Must match the u_lights[..] array size in ShaderParser's injected GLSL.
constexpr u32 MAX_SHAPE_2D_LIGHTS = 4
 Lights whose SHAPE one frame can carry — the shape mask's four channels.
constexpr u32 SHADOW_2D_MASK_CHANNELS = 4
 Channels one 2D shadow mask carries: an RGBA8 target has four.
constexpr u32 MAX_SHADOW_2D_LIGHTS = 8
 Channels of the 2D shadow mask: the lights that MEET one another and cast at once (see ShadowChannels2D.hpp).
constexpr u32 MAX_SHADOW_CASCADES = 4
 Slices one directional shadow map is split into, each covering a stretch of the view — so the near one spends its texels on what is near instead of on the whole scene. Where they LAND is the atlas's answer, not this number's: a cascade claims a tile like anything else that casts.
constexpr u32 SHADOW_CUBE_FACES = 6
 Faces a point light's map is rendered as. Six cones at right angles cover every direction from a point, and each is a tile like any other — which is what spares the pass a projection nothing else in it understands.
constexpr u32 MAX_SHADOW_TILES = 16
 Max shadow tiles one frame's atlas hands out — the shader's array bound.
constexpr u32 MAX_REFLECTION_PROBES = 15
 Columns of the reflection atlas one frame can address — column 0 the environment's, so fifteen probes and a sky.
constexpr f32 LIGHT_TILE_BITS = 8.0f
 The sprite layers a light reaches ride in GpuLight::shadowMap.y above the atlas tile count: tiles + 8 * range.
constexpr f32 SPRITE_LAYER_BIAS = 129.0f
 What a sprite's layer is written as in the vertex lane the lit fragment reads: the layer plus 129, so 0 is "no layer to test".
constexpr f32 SPRITE_LIGHT_REACH_STEP = 512.0f
 Which of the loop's lights can reach a lit quad rides in the same vertex lane as its layer: -(layer + 129 + 512 * reach).
constexpr u32 SPRITE_LIGHT_REACH_BITS = 15
constexpr u32 MATERIAL_CONSTANTS_BINDING = 1
 Indexed UBO binding point for the per-material MaterialConstants block.
constexpr const char * MATERIAL_CONSTANTS_BLOCK = "MaterialConstants"
 GLSL block name; must match ShaderParser's generated block + Shader::compile lookup.
constexpr u32 MATERIAL_TEXTURE_UNIT_BASE = 8
 First sampler unit a material texture parameter may use (batch owns units 0..7).
constexpr u32 kSceneDepthUnit = 7
 The unit a PostProcess pass reads the scene's DEPTH at.
constexpr u32 kGBufferUnit = 6
 The unit a PostProcess pass reads the scene's surface record at: what a surface IS — octahedral normal in rg, roughness in b, metalness in a (0 = nothing wrote here).
constexpr u32 PLANAR_CONSTANTS_BINDING = 9
constexpr const char * PLANAR_CONSTANTS_BLOCK = "PlanarConstants"
constexpr u32 PROBE_CONSTANTS_BINDING = 7
 Indexed UBO binding point for the per-draw ProbeConstants block.
constexpr const char * PROBE_CONSTANTS_BLOCK = "ProbeConstants"
 GLSL block name; must match the injected Lit header + Shader::compile lookup.
constexpr u32 PROBE_MAX_INSTANCES = 100
 How many instances of one merged draw carry their own irradiance.
constexpr u32 PROBE_TEXELS = 10
 Texels one instance's indirect light occupies in that block.
constexpr u32 PROBE_BLOCK_BYTES
 Bytes the block is declared with: every run, then one vec4 that is not data.
constexpr u32 SKIN_CONSTANTS_BINDING = 5
 Indexed UBO binding point for the per-draw SkinConstants block.
constexpr const char * SKIN_CONSTANTS_BLOCK = "SkinConstants"
 GLSL block name; must match the shader's declaration + Shader::compile lookup.
constexpr u32 TILE_COLUMNS = 16
constexpr u32 TILE_ROWS = 12
constexpr u32 MAX_TILED_LIGHTS = 96
 Lights a frame can carry through tiles, past the sixteen the loop reads directly. Three words of mask: the fourth is spare.
constexpr char WATER_SUN_GLSL []
constexpr char WATER_SUN_WGSL []

Typedef Documentation

◆ AsyncComputeFence

Definition at line 24 of file GfxEnums.hpp.

◆ CallbackId

Definition at line 33 of file Connection.hpp.

◆ ConstSpan

template<typename T>
using esengine::ConstSpan = std::span<const T>

Definition at line 242 of file Types.hpp.

◆ f32

using esengine::f32 = float

32-bit floating point

Definition at line 59 of file Types.hpp.

◆ f64

using esengine::f64 = double

64-bit floating point

Definition at line 61 of file Types.hpp.

◆ i16

using esengine::i16 = std::int16_t

Signed 16-bit integer.

Definition at line 52 of file Types.hpp.

◆ i32

using esengine::i32 = std::int32_t

Signed 32-bit integer.

Definition at line 54 of file Types.hpp.

◆ i64

using esengine::i64 = std::int64_t

Signed 64-bit integer.

Definition at line 56 of file Types.hpp.

◆ i8

using esengine::i8 = std::int8_t

Signed 8-bit integer.

Definition at line 50 of file Types.hpp.

◆ LogSink

using esengine::LogSink = std::function<void(const LogEntry&)>

Definition at line 62 of file Log.hpp.

◆ Shared

template<typename T>
using esengine::Shared = std::shared_ptr<T>

Shared ownership smart pointer.

Template Parameters
TThe managed object type

Definition at line 82 of file Types.hpp.

◆ TypeId

Runtime type identifier.

Used internally by the ECS to identify component types

Definition at line 187 of file Types.hpp.

◆ u16

using esengine::u16 = std::uint16_t

Unsigned 16-bit integer.

Definition at line 43 of file Types.hpp.

◆ u32

using esengine::u32 = std::uint32_t

Unsigned 32-bit integer.

Definition at line 45 of file Types.hpp.

◆ u64

using esengine::u64 = std::uint64_t

Unsigned 64-bit integer.

Definition at line 47 of file Types.hpp.

◆ u8

using esengine::u8 = std::uint8_t

Unsigned 8-bit integer.

Definition at line 41 of file Types.hpp.

◆ Unique

template<typename T>
using esengine::Unique = std::unique_ptr<T>

Unique ownership smart pointer.

Template Parameters
TThe managed object type

Definition at line 75 of file Types.hpp.

◆ usize

using esengine::usize = std::size_t

Size type for indexing and sizes.

Definition at line 64 of file Types.hpp.

◆ Weak

template<typename T>
using esengine::Weak = std::weak_ptr<T>

Weak reference smart pointer.

Template Parameters
TThe managed object type

Definition at line 89 of file Types.hpp.

Enumeration Type Documentation

◆ AsyncComputePriority

enum class esengine::AsyncComputePriority
strong
Enumerator
Default 
High 

Definition at line 23 of file GfxEnums.hpp.

◆ AtlasRefusal

enum class esengine::AtlasRefusal : u8
strong

Why a claim was turned down. Three different answers on purpose: raising the atlas size fixes NoSpace and neither of the others.

Enumerator
None 
TileBudget 

More tiles than the shader's arrays are sized for (MAX_SHADOW_TILES).

TooLarge 

One tile is wider than the whole atlas — the request cannot fit at any size.

NoSpace 

The atlas has no free block that size left. The one raising the size fixes.

Definition at line 30 of file ShadowAtlas.hpp.

◆ BatchBreak

enum class esengine::BatchBreak : u8
strong

Why a draw call had to start rather than join the one before it. Every member is a condition the merge itself tests, so the list cannot drift from the rule.

Enumerator
None 
RunStart 
Instanced 
Shader 
Blend 
Layout 
Material 
Depth 
Cull 
State 
Scissor 
Stencil 
IndexGap 
TextureSlots 
Count 

Definition at line 57 of file DrawCommand.hpp.

◆ BatchVariant

enum class esengine::BatchVariant : u8
strong
Enumerator
Plain 
Lit 
AlphaClip 
PremultipliedColor 
DisplayOutput 
Count 

Definition at line 93 of file RenderFrame.hpp.

◆ BlendMode

enum class esengine::BlendMode : u8
strong

Predefined blend modes for rendering.

Enumerator
Normal 
Additive 
Multiply 
Screen 
PremultipliedAlpha 
PmaAdditive 
Lighten 
Darken 
Overlay 
None 

Definition at line 22 of file BlendMode.hpp.

◆ BufferHandle

enum class esengine::BufferHandle : u32
strong
Enumerator
Invalid 

Definition at line 35 of file GfxEnums.hpp.

◆ CapturePass

enum class esengine::CapturePass : u8
strong

What a pass of the frame draws: a camera's scene, or the screen-space overlay.

Enumerator
Scene 
Overlay 

Definition at line 22 of file FrameCapture.hpp.

◆ CasterSplit

enum class esengine::CasterSplit : u8
strong
Enumerator
All 
Held 
Movers 

Definition at line 276 of file RenderTypePlugin.hpp.

◆ ClipDepthRange

enum class esengine::ClipDepthRange : u8
strong

What a device's clip volume does with depth.

The engine builds every projection for [-1, 1], which its frustum extraction and its published frustum-corner API also speak. A device keeping [0, 1] is handed the same projection in its own terms by RenderContext::updateCameraConstants, the only place that happens.

Enumerator
MinusOneToOne 

OpenGL / OpenGL ES / WebGL.

ZeroToOne 

WebGPU, and every native API behind it.

Definition at line 562 of file GfxEnums.hpp.

◆ ComputeHandle

enum class esengine::ComputeHandle : u32
strong

A compute program (GfxDevice::createCompute); only a device that supportsCompute() issues one.

Enumerator
Invalid 

Definition at line 39 of file GfxEnums.hpp.

◆ CullMode

enum class esengine::CullMode : u8
strong

Triangle culling mode baked into a material's pipeline.

Enumerator
None 
Back 
Front 

Definition at line 49 of file MaterialStore.hpp.

◆ DrawParamType

enum class esengine::DrawParamType : u8
strong

GLSL type of one lifted uniform (the subset the rewriter supports).

Enumerator
Float 
Int 
Vec2 
Vec3 
Vec4 
Mat3 
Mat4 

Definition at line 53 of file DrawParams.hpp.

◆ FramebufferHandle

enum class esengine::FramebufferHandle : u32
strong

Handle 0 is the default framebuffer (backbuffer); it cannot be created or deleted.

Enumerator
Default 

Definition at line 41 of file GfxEnums.hpp.

◆ GfxBufferUsage

enum class esengine::GfxBufferUsage : u8
strong
Enumerator
Vertex 
Index 
Uniform 
Storage 

Read and written by compute shaders (var<storage, read_write>), and readable back. Needs a device that supportsCompute().

Definition at line 72 of file GfxEnums.hpp.

◆ GfxCompressedFormat

enum class esengine::GfxCompressedFormat : u8
strong

GPU-compressed texture internal formats for createCompressedTexture.

Decoded textures stay compressed in VRAM (4–8× smaller than RGBA8), the key constraint on mobile. Tiering:

  • ETC2/EAC — core in the WebGL2 / GLES3 spec; available wherever WebGL2 is, no extension. The safe baseline.
  • ASTC — WEBGL_compressed_texture_astc (iOS A8+, most modern Android); best quality/size. Query before use.
  • S3TC/DXT — WEBGL_compressed_texture_s3tc (desktop GPUs).

Always gate ASTC/S3TC behind GfxDevice::supportsCompressedFormat and fall back to the uncompressed RGBA8 path.

Enumerator
ETC2_RGB8 

GL_COMPRESSED_RGB8_ETC2 (core).

ETC2_RGBA8 

GL_COMPRESSED_RGBA8_ETC2_EAC (core).

ASTC_4x4 

GL_COMPRESSED_RGBA_ASTC_4x4_KHR (extension).

ASTC_8x8 

GL_COMPRESSED_RGBA_ASTC_8x8_KHR (extension).

S3TC_DXT1 

GL_COMPRESSED_RGBA_S3TC_DXT1_EXT (extension).

S3TC_DXT5 

GL_COMPRESSED_RGBA_S3TC_DXT5_EXT (extension).

ETC2_RGBA8_SRGB 

GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC (core).

ASTC_4x4_SRGB 

GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR (extension).

S3TC_DXT5_SRGB 

GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT (extension).

Definition at line 326 of file GfxEnums.hpp.

◆ GfxContentKind

enum class esengine::GfxContentKind : u8
strong
Enumerator
Transient 

Rewritten before every use. Recovery recreates the storage zero-filled.

Retained 

The device keeps the last bytes it was given and uploads them again.

Sourced 

A provider outside the device refills it; until then it is owed.

Definition at line 17 of file GfxContent.hpp.

◆ GfxDataType

enum class esengine::GfxDataType : u8
strong
Enumerator
Float 
Int 
UnsignedByte 
UnsignedShort 
UnsignedInt 

Definition at line 202 of file GfxEnums.hpp.

◆ GfxDeviceLostReason

enum class esengine::GfxDeviceLostReason : u8
strong

Why the device was lost. The report leads with this.

Enumerator
Unknown 
ContextLost 

The host took the context away (web webglcontextlost, surface teardown).

OutOfMemory 

An allocation the backend could not satisfy.

Reset 

Driver/GPU reset — a hang watchdog (TDR) or a peer process's fault.

Removed 

The adapter itself is gone: driver update, eGPU unplugged.

Destroyed 

We destroyed it. A loss report that is not a failure.

Validation 

The backend rejected our commands fatally.

Internal 

The backend failed inside itself and said no more than that.

Definition at line 543 of file GfxEnums.hpp.

◆ GfxDeviceStatus

enum class esengine::GfxDeviceStatus : u8
strong

Whether the device can still be drawn to.

Every backend can lose its device: WebGL fires webglcontextlost, WebGPU resolves its lost future, a native driver resets under us. The states make "lost" a value the renderer branches on, not a condition it discovers by drawing into a dead device.

Enumerator
Live 

Normal operation.

Lost 

Every handle issued before is dead; submission has stopped.

Recovering 

A replacement device is being built; old handles stay dead.

Dead 

Unrecoverable — the renderer will not draw again this run.

Definition at line 535 of file GfxEnums.hpp.

◆ GfxIntParam

enum class esengine::GfxIntParam : u8
strong

Backend integer capabilities/limits.

Enumerator
MaxTextureSize 
MaxTextureImageUnits 
MaxVertexAttribs 

Definition at line 517 of file GfxEnums.hpp.

◆ GfxPixelFormat

enum class esengine::GfxPixelFormat : u8
strong
Enumerator
RGB8 
RGBA8 
SRGB8_ALPHA8 

sRGB-encoded storage: hardware EOTF on sample, OETF on write, and blending in linear space — the 8-bit backbone of the linear pipeline.

RGBA16F 

Half-float HDR target; gate render-target use on GfxDevice::supportsFloatTargets (EXT_color_buffer_float on WebGL2).

RGBA32F 

Full-float storage, for values a half cannot hold — a world-space translation is one. Fetched by texel index only: filtering full floats is an optional device feature.

DepthComponent24 
Depth24Stencil8 

Definition at line 278 of file GfxEnums.hpp.

◆ GfxReadbackStatus

enum class esengine::GfxReadbackStatus : u8
strong

State of an in-flight readback. GL completes at request time (first poll reports Ready); WebGPU resolves when its staging-buffer map lands.

Enumerator
Pending 
Ready 
Failed 

Definition at line 47 of file GfxEnums.hpp.

◆ GfxShaderLanguage

enum class esengine::GfxShaderLanguage : u8
strong

Shader source language a backend consumes.

GLDevice accepts GLSL ES 300; a WebGPU backend accepts WGSL. Queried via GfxDevice::supportsShaderLanguage, so the RHI itself is language-neutral and a caller fails fast instead of feeding a backend text it cannot compile (REARCH_WGSL Phase 1 seam).

Enumerator
GLSL_ES300 
WGSL 

Definition at line 654 of file GfxEnums.hpp.

◆ GfxShaderStage

enum class esengine::GfxShaderStage : u8
strong

Which pipeline stage rejected a program during createProgram().

Enumerator
None 
Vertex 
Fragment 
Link 

Definition at line 736 of file GfxEnums.hpp.

◆ GfxStencilFunc

enum class esengine::GfxStencilFunc : u8
strong
Enumerator
Never 
Less 
Equal 
LEqual 
Greater 
NotEqual 
GEqual 
Always 

Definition at line 248 of file GfxEnums.hpp.

◆ GfxStencilMode

enum class esengine::GfxStencilMode : u8
strong

Stencil behaviour baked into a pipeline. The reference value is dynamic (GfxDevice::setStencilReference), the compare/op/masks are pipeline state.

Enumerator
Off 

No stencil test; full color write.

Write 

Write the reference where drawn (mask fill): func Always, op Replace, color write off.

Test 

Draw only INSIDE the mask: func Equal, op Keep.

TestOutside 

Draw only OUTSIDE it: func NotEqual, op Keep — a hole, not a window.

Increment 

Enter a nested mask only where the parent reference matches.

Decrement 

Restore the parent reference on leaving a nested mask.

Zero 

Retire a root mask without writing color.

Definition at line 33 of file PipelineState.hpp.

◆ GfxStencilOp

enum class esengine::GfxStencilOp : u8
strong
Enumerator
Keep 
Zero 
Replace 
Incr 
Decr 
Invert 
IncrWrap 
DecrWrap 

Definition at line 263 of file GfxEnums.hpp.

◆ GfxStringName

enum class esengine::GfxStringName : u8
strong

Backend identification strings.

Enumerator
Version 
Renderer 
Vendor 
ShadingLanguageVersion 

Definition at line 509 of file GfxEnums.hpp.

◆ GfxTopology

enum class esengine::GfxTopology : u8
strong

How a pipeline's indices assemble into primitives. Baked into the pipeline, as WebGPU bakes it, so a draw call never states it: whoever binds a pipeline has said it.

Enumerator
Triangles 

Every three indices a triangle: all geometry the engine draws.

Lines 

Every two indices a line segment: a mesh's edges, for a diagnostic view.

Definition at line 52 of file PipelineState.hpp.

◆ GfxUniformType

enum class esengine::GfxUniformType : u8
strong
Enumerator
Unknown 
Float 
Vec2 
Vec3 
Vec4 
Int 
IVec2 
IVec3 
IVec4 
Bool 
Mat2 
Mat3 
Mat4 
Sampler2D 
SamplerCube 
Sampler2DArray 

Definition at line 747 of file GfxEnums.hpp.

◆ HdrRefusal

enum class esengine::HdrRefusal : u8
strong

Why the effective format is not the requested one.

Enumerator
None 
FloatTargetsUnsupported 

The device cannot render to a float target (WebGL2 without EXT_color_buffer_float). sRGB-encoded 8-bit keeps the linear pipeline correct and takes its over-range headroom away.

Definition at line 22 of file HdrFormat.hpp.

◆ LayoutId

enum class esengine::LayoutId : u8
strong

Identifies a transient vertex stream / vertex format. Each layout has its own VBO+EBO+VAO in TransientBufferPool and is part of a pipeline's identity.

Enumerator
Batch 
ParticleInstance 

Instanced: a static unit quad + a per-particle instance stream.

Shape 
MeshInstance 

Per-object transforms for GPU-resident meshes. Only the stream is the pool's; the layout belongs to the mesh, which is the one that knows what its own vertices look like.

Sky 

The background quad: a world position and nothing else. Its own stream because the Batch one spends every sampler slot on a per-vertex merge, and the sky has to reach the environment atlas on the slot the shaders pin it to.

Definition at line 88 of file GfxEnums.hpp.

◆ LightRefusal

enum class esengine::LightRefusal : u8
strong

Why a light did not reach the frame.

Enumerator
None 
Capacity 

More lights in view than the shader's arrays hold; the dimmest gave way.

NoEnvironmentSun 

Follows the environment's sun, and the frame's environment has none.

Definition at line 25 of file LightPlan.hpp.

◆ LogLevel

enum class esengine::LogLevel : u8
strong

Logging severity levels.

Messages with a level below the current threshold are filtered out. Levels are ordered from most verbose (Trace) to most severe (Fatal).

Enumerator
Trace 

Detailed debugging information.

Debug 

Debug information.

Info 

General information.

Warn 

Warning messages.

Error 

Error messages.

Fatal 

Fatal errors (application cannot continue).

Definition at line 47 of file Log.hpp.

◆ MaterialDefaultTexture

enum class esengine::MaterialDefaultTexture : u8
strong

Which built-in texture a param falls back to when a material leaves it unset.

Enumerator
White 
Black 
FlatNormal 
Ripples 

Definition at line 65 of file MaterialStore.hpp.

◆ MeshChannel

enum class esengine::MeshChannel : u8
strong

What a mesh vertex channel MEANS, and the attribute location it binds to.

One vocabulary for the file format, the layout and the shaders: a channel's semantic IS its location. The first three match the 2D batch layout exactly, so one attribute vocabulary serves both vertex sources. Values are serialized in .esmesh — append only.

Enumerator
Position 
Color 
TexCoord0 
Normal 
Tangent 
Joints 
Weights 
TexCoord1 

A second UV set — what a bake is read through, laid out so no two of a model's surfaces overlap.

Definition at line 158 of file GfxEnums.hpp.

◆ MeshChannelType

enum class esengine::MeshChannelType : u8
strong

How a channel's components are stored, as the file spells it.

The asset layer's vocabulary rather than the device's: these are the codes written into a .esmesh, and one of them (UInt16) exists because a joint index is neither a float nor a byte. Append only — serialized.

Enumerator
Float32 
UNorm8 
UInt16 
UInt8 

Joint indices of a skin or chunk of at most 256 bones: a byte each.

UNorm16 

Skin weights at high precision.

Definition at line 188 of file GfxEnums.hpp.

◆ MeshRecovery

enum class esengine::MeshRecovery : u8
strong

How a mesh's geometry comes back after a device generation ends.

Declared by the producer that mints the handle, because nothing downstream can work it out — by the time recovery runs, all that is left of a mesh is a number. tools/meshProducers.mjs is the census that keeps every producer's answer here and its declaration in step.

Enumerator
SourceReplayable 

Replayable from an asset the loader can load again.

HostOnly 

Built in this process; the device keeps its bytes.

Definition at line 28 of file Mesh.hpp.

◆ OutputTransform

enum class esengine::OutputTransform : u8
strong

What the last pass of a chain does to scene values on the way out.

A tonemap is the OUTPUT transform, not an effect: it runs exactly once and last — after the effects, which want scene values, and before the OETF, which is a transfer function. None by default: a flat frame in linear light wants an exact round trip, and a filmic curve is not one.

Enumerator
None 

Encode only. Values above 1 clip, which is what LDR content means.

ACES 

Narkowicz ACES filmic curve, for a scene that carries HDR radiance.

Neutral 

Khronos PBR Neutral: hue and saturation survive, highlights roll off.

Definition at line 50 of file PostProcessPipeline.hpp.

◆ PipelineHandle

enum class esengine::PipelineHandle : u32
strong

Opaque handle to a cached pipeline; PipelineHandle{0} is the null/invalid handle.

Enumerator
Invalid 

Definition at line 97 of file PipelineState.hpp.

◆ QualityValue

enum class esengine::QualityValue : u32
strong
Enumerator
LoopLights 
TiledLights 
ShadowTiles 
Count 

Definition at line 14 of file QualityValues.hpp.

◆ ReadbackHandle

enum class esengine::ReadbackHandle : u32
strong

An in-flight framebuffer readback (GfxDevice::requestReadback).

Enumerator
Invalid 

Definition at line 43 of file GfxEnums.hpp.

◆ RenderPurpose

enum class esengine::RenderPurpose : u8
strong

What a collect is FOR — the phase, not a feature the geometry has.

A shadow collect draws the scene's meshes from somewhere else for a different answer: depth only, no material, no light. A bool per phase would multiply as the frame gains passes, and two could be set at once — which no phase ever is.

Enumerator
Scene 
ShadowDepth 
ScreenOverlay 

The frame's screen-space overlay: one pass after every camera and after post, drawing what belongs to the screen rather than the world. It has no camera — the projection it is given comes from the layout domain.

Motion 

The pass that writes how far each moving surface travelled since last frame, for the temporal effects: the scene's meshes again, only those that moved, through a program that writes motion.

Definition at line 51 of file RenderTypePlugin.hpp.

◆ RenderStage

enum class esengine::RenderStage : u8
strong
Enumerator
Background 
Opaque 
Transparent 
Overlay 

Definition at line 9 of file RenderStage.hpp.

◆ RenderType

enum class esengine::RenderType : u8
strong
Enumerator
Sprite 
Skeletal 

Posed geometry from a skeletal runtime — Spine or DragonBones. Neither is linked here: both are side modules that hand over batch vertices.

Mesh 
ExternalMesh 
Text 
Shape 
UIElement 
Trail 

Definition at line 17 of file RenderItem.hpp.

◆ RetainedTextKept

enum class esengine::RetainedTextKept
strong

What a view keeps of a batch: nothing, all of it (read the batch itself), or a subset copied into scratch.

Enumerator
None 
All 
Subset 

Definition at line 193 of file RetainedText.hpp.

◆ ShaderDataType

enum class esengine::ShaderDataType
strong

Vertex attribute data types.

Used to describe the data type of each vertex attribute in the vertex layout. Maps to OpenGL/WebGL types.

Enumerator
None 
Float 

Single 32-bit float.

Float2 

vec2 (2 floats)

Float3 

vec3 (3 floats)

Float4 

vec4 (4 floats)

Int 

Single 32-bit integer.

Int2 

ivec2 (2 ints)

Int3 

ivec3 (3 ints)

Int4 

ivec4 (4 ints)

Bool 

Boolean (1 byte).

UByte4N 

4 unsigned bytes, normalized to [0,1] vec4

Definition at line 45 of file Buffer.hpp.

◆ ShaderHandle

enum class esengine::ShaderHandle : u32
strong
Enumerator
Invalid 

Definition at line 37 of file GfxEnums.hpp.

◆ ShaderStageFailure

enum class esengine::ShaderStageFailure : u8
strong

Which pipeline stage rejected a shader during compile/link.

Enumerator
None 
Vertex 
Fragment 
Link 

Definition at line 44 of file Shader.hpp.

◆ ShadingMode

enum class esengine::ShadingMode : u8
strong

What a mesh is drawn WITH in a view, whatever its own material says.

A debugging question, not a style: shape is asked of clay, texture of albedo. View state, so a camera preview drawn in the same frame keeps the authored look. Only the camera collect reads it; a shadow map draws depth either way.

Enumerator
Shaded 

Each mesh as authored: its material, its textures, its light.

Clay 

One neutral matte surface, lit: form and silhouette without anyone's colours.

Albedo 

Base colour and texture with no light and no material: what was painted.

Wireframe 

A dark surface with every triangle edge drawn on it, hidden edges hidden.

DirectLighting 

Clay lit by the lights alone: no ambient, environment, reflection, probe or bake: the lighting components with Indirect off; with IndirectLighting it splits what Clay shows into the two halves.

IndirectLighting 

Clay lit by what is NOT a light: the ambient, the environment and sky, reflections, probe volumes and bakes. What fills a shadow, on its own.

Clusters 

Clay, with every cluster of a clustered mesh in a colour of its own: which level of detail each part of a surface is drawn at, and where one level meets the next. A mesh without clusters is plain clay.

Definition at line 22 of file ViewShading.hpp.

◆ ShadowClaim

enum class esengine::ShadowClaim : u8
strong
Enumerator
AllOrNothing 
AllowFewer 

Definition at line 89 of file ShadowPlan.hpp.

◆ ShadowShape

enum class esengine::ShadowShape : u8
strong

The shape a light's map has to cover — the one thing a shadow pass differs by.

A box of the world for a sun, one cone for a spot, and for a point light six cones at right angles, because a point lights every direction and no single projection covers that. Each face is a tile like any other, so the atlas, the collect, the vertex stage and the depth packing are shared by all three.

Enumerator
Box 
Cone 
Cube 

Definition at line 71 of file RenderFrame.hpp.

◆ SkinCacheBehavior

enum class esengine::SkinCacheBehavior : u8
strong

Which skinned meshes go through the cache when their own MeshSkin says Auto.

Enumerator
Inclusive 

Every one, unless it says Disabled.

Exclusive 

None, unless it says Enabled.

Definition at line 35 of file SkinCache.hpp.

◆ SkinCacheUsage

enum class esengine::SkinCacheUsage : u8
strong

A mesh's own word on the cache (MeshSkin::skinCache).

Enumerator
Auto 
Disabled 
Enabled 

Definition at line 43 of file SkinCache.hpp.

◆ TextGlyphMode

enum class esengine::TextGlyphMode : u8
strong

How a glyph page's pixels become coverage. The numbers are what crosses the script boundary: 0 and 1 are what the sdf flag it replaced was (false, true), so a caller that has never heard of the others means what it always did.

Enumerator
Color 

The page's RGBA, tinted: a rasterized atlas that carries native-AA coverage in alpha, or a font drawn in colour.

Sdf 

Alpha is a signed distance; coverage is derived from it, and sdfBias grows the glyph (an outline pass).

Mask 

Alpha alone is coverage and the page's colour is ignored: the silhouette of a glyph whose outline is baked into the page.

Fill 

Red x alpha is coverage: the glyph proper of that page. Mask underneath and Fill on top is the outlined glyph, ring in any colour.

Definition at line 15 of file TextVertexFormat.hpp.

◆ TextureFilter

enum class esengine::TextureFilter : u8
strong
Enumerator
Nearest 

No interpolation (pixelated look).

Linear 

Bilinear interpolation (smooth).

Definition at line 57 of file GfxEnums.hpp.

◆ TextureFormat

enum class esengine::TextureFormat
strong

Texture pixel format.

Enumerator
None 
RGB8 

3 channels, 8 bits each (24 bpp)

RGBA8 

4 channels, 8 bits each (32 bpp)

SRGB8A8 

sRGB-encoded RGBA8: hardware-linearized on sample (32 bpp)

RGBA16F 

Half-float HDR (64 bpp); render use gated on supportsFloatTargets.

RGBA32F 

Full-float storage (128 bpp); fetched by texel, never filtered.

Depth24 

Depth buffer format (24 bits).

Definition at line 45 of file Texture.hpp.

◆ TextureHandle

enum class esengine::TextureHandle : u32
strong
Enumerator
Invalid 

Definition at line 36 of file GfxEnums.hpp.

◆ TextureWrap

enum class esengine::TextureWrap : u8
strong
Enumerator
Repeat 

Tile the texture.

ClampToEdge 

Clamp to edge pixels.

MirroredRepeat 

Tile with mirroring.

Definition at line 62 of file GfxEnums.hpp.

◆ VertexLayoutHandle

enum class esengine::VertexLayoutHandle : u32
strong
Enumerator
Invalid 

Definition at line 242 of file GfxEnums.hpp.

Function Documentation

◆ activeCtx()

EstellaContext & esengine::activeCtx ( )
inline

The engine context every binding routes through — single source of truth.

Returns the explicitly-installed context when present; otherwise falls back to the process default context (EngineContext::instance), whose constructor registers the GPU-independent logic systems, so headless tooling/tests that never call initRenderer can still run UI layout / hit-test instead of dereferencing nullptr. The default is just the unset fallback, not a privileged singleton — real Apps install their own context via setActiveContext.

Putting the fallback here (rather than in each binding file's local ctx()) makes headless-vs-rendered behavior uniform: before, only WebSDKEntry's ctx() had the fallback and the other binding files dereferenced g_activeContext bare → null deref when headless.

Definition at line 37 of file ActiveContext.hpp.

References esengine::EngineContext::context(), g_activeContext, and esengine::EngineContext::instance().

Referenced by ctx().

◆ anim_cancelAllTweens()

void esengine::anim_cancelAllTweens ( ecs::Registry & registry,
u32 targetEntity )

Definition at line 56 of file AnimationBindings.cpp.

References ctx(), and esengine::Entity::fromRaw().

Referenced by EMSCRIPTEN_BINDINGS().

◆ anim_cancelTween()

void esengine::anim_cancelTween ( ecs::Registry & registry,
u32 tweenEntity )

Definition at line 50 of file AnimationBindings.cpp.

References ctx(), and esengine::Entity::fromRaw().

Referenced by EMSCRIPTEN_BINDINGS().

◆ anim_createTween()

u32 esengine::anim_createTween ( ecs::Registry & registry,
u32 entity,
u32 targetProp,
f32 from,
f32 to,
f32 duration,
u32 easing,
f32 delay,
u32 loopMode,
i32 loopCount )

Create a tween entity animating targetProp of entity. Returns the tween entity's raw id (the invalid id when no tween system is installed).

Definition at line 28 of file AnimationBindings.cpp.

References esengine::animation::TweenSystem::createTween(), ctx(), esengine::animation::TweenData::delay, esengine::Entity::fromRaw(), esengine::ecs::Registry::get(), INVALID_ENTITY, and esengine::EstellaContext::tryGet().

Referenced by EMSCRIPTEN_BINDINGS().

◆ anim_getTweenState()

i32 esengine::anim_getTweenState ( ecs::Registry & registry,
u32 tweenEntity )

The tween's animation::TweenState, or Completed when it no longer exists.

Definition at line 97 of file AnimationBindings.cpp.

References esengine::animation::Completed, esengine::Entity::fromRaw(), and esengine::ecs::Registry::tryGet().

Referenced by EMSCRIPTEN_BINDINGS().

◆ anim_pauseTween()

void esengine::anim_pauseTween ( ecs::Registry & registry,
u32 tweenEntity )

Definition at line 62 of file AnimationBindings.cpp.

References ctx(), and esengine::Entity::fromRaw().

Referenced by EMSCRIPTEN_BINDINGS().

◆ anim_resumeTween()

void esengine::anim_resumeTween ( ecs::Registry & registry,
u32 tweenEntity )

Definition at line 68 of file AnimationBindings.cpp.

References ctx(), and esengine::Entity::fromRaw().

Referenced by EMSCRIPTEN_BINDINGS().

◆ anim_setSequenceNext()

void esengine::anim_setSequenceNext ( ecs::Registry & registry,
u32 tweenEntity,
u32 nextEntity )

Chain nextEntity to run when tweenEntity completes.

Definition at line 85 of file AnimationBindings.cpp.

References esengine::Entity::fromRaw(), and esengine::ecs::Registry::tryGet().

Referenced by EMSCRIPTEN_BINDINGS().

◆ anim_setTweenBezier()

void esengine::anim_setTweenBezier ( ecs::Registry & registry,
u32 tweenEntity,
f32 p1x,
f32 p1y,
f32 p2x,
f32 p2y )

◆ anim_updateTweens()

void esengine::anim_updateTweens ( ecs::Registry & registry,
f32 deltaTime )

Definition at line 91 of file AnimationBindings.cpp.

References ctx().

Referenced by EMSCRIPTEN_BINDINGS().

◆ appendIndexedBatch()

void esengine::appendIndexedBatch ( TransientBufferPool & pool,
DrawList & drawList,
const ClipState & clips,
const BatchVertex * verts,
u32 vertexCount,
const u32 * localIndices,
u32 indexCount,
const BatchDrawKey & key )

Copies verts into the Batch stream, then pushes one DrawCommand spanning them.

Typed convenience over appendIndexedDraw for the shared BatchVertex format (tilemap chunk, single tile); the key must target the Batch stream.

Definition at line 216 of file BatchBuilder.cpp.

References appendIndexedDraw().

Referenced by esengine::MeshPlugin::collect(), esengine::ParticlePlugin::collect(), esengine::TextPlugin::collect(), esengine::TilemapRenderPlugin::collect(), esengine::TrailPlugin::collect(), and esengine::BatchPlugin::emitRadialFill().

◆ appendIndexedDraw()

void esengine::appendIndexedDraw ( TransientBufferPool & pool,
DrawList & drawList,
const ClipState & clips,
const void * verts,
u32 vertexCount,
const u32 * localIndices,
u32 indexCount,
const BatchDrawKey & key )

Copies raw vertices into the key's stream, then pushes one DrawCommand spanning them.

The layout-generic bulk form: verts must be vertexCount records of the stream's vertex stride (TransientBufferPool::vertexStride). This is the whole face a renderer with its own vertex format needs (shape today; any future trail/mesh2d stream).

Definition at line 205 of file BatchBuilder.cpp.

References esengine::TransientBufferPool::appendVertices(), batchEntityVisible(), esengine::BatchDrawKey::cullBit, esengine::BatchDrawKey::entity, esengine::BatchDrawKey::layer, esengine::BatchDrawKey::layoutId, and esengine::TransientBufferPool::vertexStride().

Referenced by appendIndexedBatch(), and esengine::ShapePlugin::collect().

◆ appendQuad()

void esengine::appendQuad ( TransientBufferPool & pool,
DrawList & drawList,
const ClipState & clips,
const BatchVertex quad[4],
const BatchDrawKey & key )
inline

◆ appendQuads()

◆ applyMeshPipeline()

◆ assignShadowChannels()

u32 esengine::assignShadowChannels ( const ShadowMaskLight * lights,
u32 count,
u32 channels,
i32 * out )
inline

Gives each light the first channel none of its collisions hold, in the order the lights are given.

Parameters
channelsHow many channels the mask has.
outOne entry per light: its channel, or -1 where every channel holds a light it collides with.
Returns
How many lights got none. A light with no channel still lights; it only casts no 2D shadow.

Definition at line 45 of file ShadowChannels2D.hpp.

References shadowMasksCollide().

◆ batchBreakCounter()

const char * esengine::batchBreakCounter ( BatchBreak r)
inline

The profiler counter each reason publishes under. String LITERALS: FrameProfiler keys entries by the pointer's contents and never copies, so a built-up buffer would dangle the moment the frame ended.

Definition at line 80 of file DrawCommand.hpp.

References Blend, Cull, Depth, IndexGap, Instanced, Layout, Material, RunStart, Scissor, Shader, State, Stencil, and TextureSlots.

◆ batchEntityVisible()

bool esengine::batchEntityVisible ( const DrawList & drawList,
const ClipState & clips,
Entity entity,
i32 layer,
u32 cullBit = 0 )

◆ batchGlyphModeBits()

i32 esengine::batchGlyphModeBits ( TextGlyphMode mode)
inline

Definition at line 17 of file BatchVertex.hpp.

References BATCH_SLOT_BITS.

Referenced by esengine::RenderFrame::submitTextBatch().

◆ boundarySpan()

template<typename T>
const T * esengine::boundarySpan ( uintptr_t ptr,
u64 count,
const char * what )
inline

Validates a JS-supplied pointer to count elements of T and returns it typed.

Returns
The typed pointer, or nullptr (after an always-on error log) when the pointer is null, the byte size overflows, or the span leaves the wasm heap.
Note
Errors go straight to stderr (→ the module's printErr → console), not the engine Log: this gate is shared by side modules (physics) that do not link the Log implementation, so the header must stay dependency-free.

Definition at line 85 of file BoundarySpan.hpp.

References esengine::detail::boundaryContains().

Referenced by boundarySpanMut(), draw_begin(), draw_mesh(), draw_meshWithUniforms(), environment_create(), environment_setSun(), geometry_init(), geometry_setIndices16(), geometry_setIndices32(), geometry_updateVertices(), mesh_setClusters(), mesh_setSkinChunks(), meshInstances_set(), meshRenderer_setGeometry(), physics_addChainShape(), physics_addPolygonShape(), physics_setBodyTransforms(), probe_volume_create(), probe_volume_createBricks(), probe_volume_setSkyVisibility(), registry_batchSyncPhysicsTransforms(), registry_markComponentsChanged(), registry_readWorldPoses2D(), renderer_begin(), renderer_beginScreenOverlay(), renderer_renderSkeletalPreview(), renderer_retainedTextBatch(), renderer_retainedTextSubmit(), renderer_setEntityDrawOrder(), renderer_setViewSelection(), renderer_submitSkeletalBatchByEntityEx(), renderer_submitSkeletalPreviewBatchEx(), renderer_submitTextBatch(), rm_createCompressedTexture(), rm_createTexture(), rm_createTextureArray(), rm_createTextureEx(), and rm_updateTextureSubregion().

◆ boundarySpanMut()

template<typename T>
T * esengine::boundarySpanMut ( uintptr_t ptr,
u64 count,
const char * what )
inline

◆ buildRippleNormals()

std::vector< u8 > esengine::buildRippleNormals ( )

RGBA8, RIPPLE_NORMALS_SIZE square. A texel's rg (and ba) is the xy of a unit normal whose z is up: the slope there is xy / z.

Definition at line 72 of file RippleNormals.cpp.

References RIPPLE_NORMALS_SIZE.

Referenced by esengine::RenderContext::restoreBuiltinContent().

◆ cameraFromViewProjection()

glm::vec4 esengine::cameraFromViewProjection ( const glm::mat4 & viewProjection)
inline

Where the frame is seen from, read out of the matrix that projects it.

inverse(VP) on the clip z axis: a perspective divide brings it down to the eye POINT (w = 1); orthographic has none, so it stays a DIRECTION, negated to point at the viewer (w = 0). One answer for both the shaders' FrameConstants::camera and the CPU's draw ordering.

Definition at line 59 of file FrameConstants.hpp.

Referenced by computeCameraView(), planarReflectionCamera(), and esengine::RenderContext::prepareFrameConstants().

◆ checkGLErrors()

u32 esengine::checkGLErrors ( const char * context)
static

◆ claimTiles()

ShadowGrant esengine::claimTiles ( ShadowAtlas & atlas,
Entity light,
u32 want,
u32 cells,
i32 & outFirst,
ShadowClaim policy = ShadowClaim::AllOrNothing )
inline

Claim a complete shadow map, or explicitly allow fewer cascades.

A sun settles for fewer rather than costing a positional light the map it cannot shorten. Giving way and RECORDING what it gave way from are one function, so a caller cannot take the first without the second. A point light needs all six faces: a partial cube leaves directions unshadowed and consumes tiles that another complete map could use.

Definition at line 103 of file ShadowPlan.hpp.

References esengine::ShadowAtlas::allocate(), AllOrNothing, esengine::ShadowGrant::granted, None, and esengine::ShadowGrant::refusal.

◆ component_name()

template<typename T>
const char * esengine::component_name ( )
inlineconstexpr

Get the script name for a component type.

Returns the name used in JavaScript/TypeScript bindings. Specialized by the binding generator for each ES_COMPONENT type.

Template Parameters
TComponent type
Returns
Script name as string literal

Definition at line 192 of file Reflection.hpp.

◆ componentTypeId()

template<typename T>
TypeId esengine::componentTypeId ( )
inline

Dense 0-based runtime id for a component type (ECS pool index + mask bit).

Template Parameters
TThe component type
assert(posId != velId);
TypeId componentTypeId()
Dense 0-based runtime id for a component type (ECS pool index + mask bit).
Definition Types.hpp:231
u32 TypeId
Runtime type identifier.
Definition Types.hpp:187

Definition at line 231 of file Types.hpp.

References esengine::detail::domainTypeId().

Referenced by esengine::ecs::Registry::emplace(), esengine::ecs::Registry::emplaceOrReplace(), EMSCRIPTEN_BINDINGS(), esengine::ecs::Registry::getOrEmplace(), and esengine::ecs::Registry::remove().

◆ computeCameraView()

◆ coneShadow()

glm::mat4 esengine::coneShadow ( const glm::vec3 & pos,
const glm::vec3 & dir,
f32 fovDegrees,
f32 reach )
static

The map a light standing somewhere casts over one cone: the frustum it sees.

A spot's whole map and one face of a point light's cube are this same call. They differ by how wide the cone opens and which way it points, which is the only sense in which a point light is a new kind of caster at all.

Definition at line 2303 of file RenderFrame.cpp.

References shadowUp(), and spotProjection().

◆ ctx() [1/7]

EstellaContext & esengine::ctx ( )
static

Definition at line 26 of file AnimationBindings.cpp.

References activeCtx().

Referenced by anim_cancelAllTweens(), anim_cancelTween(), anim_createTween(), anim_pauseTween(), anim_resumeTween(), anim_updateTweens(), esengine::GLDevice::backendCreateTimerQuery(), esengine::GLDevice::backendProgramReady(), esengine::MeshPlugin::castInputs(), esengine::MeshPlugin::collect(), esengine::ParticlePlugin::collect(), esengine::RenderTypePlugin::collect(), esengine::ShapePlugin::collect(), esengine::SpritePlugin::collect(), esengine::TextPlugin::collect(), esengine::TilemapRenderPlugin::collect(), esengine::TrailPlugin::collect(), esengine::UIElementPlugin::collect(), esengine::RenderFrame::collectAll(), esengine::DynamicGI::declare(), esengine::VoxelGI::declare(), draw_begin(), draw_deferEnd(), draw_end(), esengine::PostProcessPipeline::drawCloudShadow(), EMSCRIPTEN_BINDINGS(), engine_prepareMeshPrograms(), engine_setRandomSeed(), environment_create(), environment_release(), environment_setSky(), environment_setSun(), esengine::rg::RenderGraph::execute(), geometry_init(), gl_checkErrors(), gl_enableErrorCheck(), esengine::BatchPlugin::init(), esengine::GLDevice::init(), esengine::MeshPlugin::init(), esengine::ParticlePlugin::init(), esengine::RenderTypePlugin::init(), esengine::ShapePlugin::init(), esengine::TilemapRenderPlugin::init(), initRendererWebGPU(), esengine::EngineContext::instance(), mesh_createFromChannels(), mesh_release(), mesh_rematerializeFromChannels(), mesh_setClusters(), mesh_setSkinChunks(), esengine::GLDevice::onDeviceLost(), esengine::GLDevice::pollDeviceLost(), esengine::MeshPlugin::prewarm(), esengine::RenderTypePlugin::prewarm(), esengine::MeshPlugin::prewarmDocument(), esengine::RenderFrame::prewarmDocument(), esengine::RenderTypePlugin::prewarmDocument(), esengine::MeshPlugin::prewarmFacts(), esengine::RenderFrame::prewarmPrograms(), probe_volume_create(), probe_volume_createBricks(), probe_volume_getBricks(), probe_volume_getResolution(), probe_volume_release(), probe_volume_setSkyVisibility(), esengine::GLDevice::recreateDevice(), renderer_beginFrame(), renderer_getProbeAtlasBytes(), renderer_getProbeDraws(), renderer_getTextureBytes(), renderer_init(), renderer_keepScreenOverlay(), renderer_programEpoch(), renderer_renderMaterialPreview(), renderer_renderMeshPreview(), renderer_resize(), renderer_retainedTextStale(), renderer_setClearColor(), renderer_setMeshEdgeBuffers(), renderer_setQualityConstants(), renderThread_complete(), renderThread_enabled(), renderThread_fence(), renderThread_flush(), renderThread_resizeSurface(), esengine::RenderTypePlugin::scheduleSkins(), screenDomain(), transform_update(), ui_isScreenDomain(), uiHitTest_getHitEntity(), uiHitTest_inputsChanged(), uiHitTest_pick(), uiHitTest_pickAll(), uiHitTest_pickResult(), uiHitTest_update(), uiHitTest_updateDomains(), and uiLayout_update().

◆ ctx() [2/7]

EstellaContext & esengine::ctx ( )
static

Definition at line 24 of file GeometryBindings.cpp.

References activeCtx().

◆ ctx() [3/7]

EstellaContext & esengine::ctx ( )
static

Definition at line 21 of file ImmediateDrawBindings.cpp.

References activeCtx().

◆ ctx() [4/7]

EstellaContext & esengine::ctx ( )
static

Definition at line 24 of file MaterialBindings.cpp.

References activeCtx().

◆ ctx() [5/7]

EstellaContext & esengine::ctx ( )
static

Definition at line 73 of file RendererBindings.cpp.

References activeCtx().

◆ ctx() [6/7]

EstellaContext & esengine::ctx ( )
static

Definition at line 32 of file UIBindings.cpp.

References activeCtx().

◆ ctx() [7/7]

EstellaContext & esengine::ctx ( )
static

Definition at line 86 of file WebSDKEntry.cpp.

References activeCtx().

◆ cubeFace()

glm::vec3 esengine::cubeFace ( u32 index)
static

Face index of a cube: the axis it looks down, positive first. Six of them cover every direction from a point, which is what lets a point light's map be six cones rather than a projection nothing else in the pass understands.

Definition at line 2317 of file RenderFrame.cpp.

◆ decideHdrFormat()

HdrFormatDecision esengine::decideHdrFormat ( bool linearOutput,
bool supportsFloatTargets )
inline

What a linear project asks for, and what supportsFloatTargets grants.

Pure, so the three cases hold without a device. Called once where the frame COMMITS: two targets in one frame disagreeing about their format is a chain sampling a texture that is not the one it wrote.

Definition at line 82 of file HdrFormat.hpp.

References FloatTargetsUnsupported, None, RGBA16F, RGBA8, and SRGB8_ALPHA8.

◆ deviceIdentity()

std::string esengine::deviceIdentity ( )

Who the device is, as backend|vendor|renderer|version.

Readable while the device is LIVE, which the loss report is not — a crash report needs the GPU it ran on, and by then the backend cannot be asked. Pipe-joined: one crossing, and these are driver strings rather than a schema.

Definition at line 465 of file WebSDKEntry.cpp.

References esengine::GfxDeviceIdentity::backend, and esengine::GfxDevice::deviceIdentity().

◆ deviceLostReport()

std::string esengine::deviceLostReport ( )

The formatted loss report; empty while the device is live.

Definition at line 451 of file WebSDKEntry.cpp.

References esengine::GfxDevice::deviceLostInfo(), and gfxFormatDeviceLost().

◆ deviceStatus()

u32 esengine::deviceStatus ( )

The device's status (see GfxDeviceStatus). Live when no device exists yet.

Definition at line 445 of file WebSDKEntry.cpp.

References esengine::GfxDevice::deviceStatus(), and Live.

◆ distinctMeshEdges()

std::vector< u32 > esengine::distinctMeshEdges ( ConstSpan< u32 > indices)
inline

Index pairs, one per distinct edge, in ascending order of (low, high) vertex.

An edge two triangles share is one line, not two: drawn twice a line is brighter, and a wireframe whose interior outshines its rim reads wrong. Edges are compared by vertex index, so a seam that splits one vertex in two stays two edges.

Definition at line 22 of file MeshEdges.hpp.

◆ draw_begin()

◆ draw_circle()

void esengine::draw_circle ( f32 centerX,
f32 centerY,
f32 radius,
f32 r,
f32 g,
f32 b,
f32 a,
bool filled,
i32 segments )

Definition at line 145 of file ImmediateDrawBindings.cpp.

References g_immediateDraw, and g_immediateDrawActive.

◆ draw_circleOutline()

void esengine::draw_circleOutline ( f32 centerX,
f32 centerY,
f32 radius,
f32 r,
f32 g,
f32 b,
f32 a,
f32 thickness,
i32 segments )

Definition at line 158 of file ImmediateDrawBindings.cpp.

References g_immediateDraw, and g_immediateDrawActive.

◆ draw_createTriangleMesh()

u32 esengine::draw_createTriangleMesh ( uintptr_t positionsPtr,
u32 vertexCount,
uintptr_t colorsPtr,
uintptr_t indicesPtr,
u32 indexCount )

Definition at line 184 of file ImmediateDrawBindings.cpp.

References g_immediateDraw.

◆ draw_deferBegin()

void esengine::draw_deferBegin ( )

Definition at line 66 of file ImmediateDrawBindings.cpp.

References g_immediateDraw, g_immediateDrawActive, and g_initialized.

◆ draw_deferEnd()

◆ draw_destroyTriangleMesh()

void esengine::draw_destroyTriangleMesh ( u32 id)

Definition at line 192 of file ImmediateDrawBindings.cpp.

References g_immediateDraw.

◆ draw_end()

◆ draw_getDepthState()

u32 esengine::draw_getDepthState ( )

Definition at line 263 of file ImmediateDrawBindings.cpp.

References g_immediateDraw.

◆ draw_getDrawCallCount()

u32 esengine::draw_getDrawCallCount ( )

Definition at line 243 of file ImmediateDrawBindings.cpp.

References g_immediateDraw.

◆ draw_getPrimitiveCount()

u32 esengine::draw_getPrimitiveCount ( )

Definition at line 248 of file ImmediateDrawBindings.cpp.

References g_immediateDraw.

◆ draw_line()

void esengine::draw_line ( f32 fromX,
f32 fromY,
f32 toX,
f32 toY,
f32 r,
f32 g,
f32 b,
f32 a,
f32 thickness )

Definition at line 71 of file ImmediateDrawBindings.cpp.

References g_immediateDraw, and g_immediateDrawActive.

◆ draw_line3D()

void esengine::draw_line3D ( f32 fromX,
f32 fromY,
f32 fromZ,
f32 toX,
f32 toY,
f32 toZ,
f32 r,
f32 g,
f32 b,
f32 a,
f32 thickness )

Definition at line 83 of file ImmediateDrawBindings.cpp.

References g_immediateDraw, and g_immediateDrawActive.

◆ draw_line3DScreen()

void esengine::draw_line3DScreen ( f32 fromX,
f32 fromY,
f32 fromZ,
f32 toX,
f32 toY,
f32 toZ,
f32 r,
f32 g,
f32 b,
f32 a,
f32 thickness )

Definition at line 95 of file ImmediateDrawBindings.cpp.

References g_immediateDraw, and g_immediateDrawActive.

◆ draw_line3DScreenOffset()

void esengine::draw_line3DScreenOffset ( f32 anchorX,
f32 anchorY,
f32 anchorZ,
f32 fromX,
f32 fromY,
f32 toX,
f32 toY,
f32 r,
f32 g,
f32 b,
f32 a,
f32 thickness )

Definition at line 107 of file ImmediateDrawBindings.cpp.

References g_immediateDraw, and g_immediateDrawActive.

◆ draw_mesh()

◆ draw_meshWithMaterial()

◆ draw_meshWithUniforms()

void esengine::draw_meshWithUniforms ( u32 geometryHandle,
u32 shaderHandle,
uintptr_t transformPtr,
uintptr_t uniformsPtr,
u32 uniformCount )

◆ draw_rect()

void esengine::draw_rect ( f32 x,
f32 y,
f32 width,
f32 height,
f32 r,
f32 g,
f32 b,
f32 a,
bool filled )

Definition at line 121 of file ImmediateDrawBindings.cpp.

References g_immediateDraw, and g_immediateDrawActive.

◆ draw_rectOutline()

void esengine::draw_rectOutline ( f32 x,
f32 y,
f32 width,
f32 height,
f32 r,
f32 g,
f32 b,
f32 a,
f32 thickness )

Definition at line 133 of file ImmediateDrawBindings.cpp.

References g_immediateDraw, and g_immediateDrawActive.

◆ draw_setBlendMode()

void esengine::draw_setBlendMode ( i32 mode)

Definition at line 253 of file ImmediateDrawBindings.cpp.

References g_immediateDraw.

◆ draw_setDepth()

void esengine::draw_setDepth ( f32 depth)

Definition at line 238 of file ImmediateDrawBindings.cpp.

References g_immediateDraw.

◆ draw_setDepthState()

void esengine::draw_setDepthState ( u32 flags)

Definition at line 271 of file ImmediateDrawBindings.cpp.

References g_immediateDraw.

◆ draw_setDepthTest()

void esengine::draw_setDepthTest ( bool enabled)

Definition at line 258 of file ImmediateDrawBindings.cpp.

References g_immediateDraw.

◆ draw_setLayer()

void esengine::draw_setLayer ( i32 layer)

Definition at line 233 of file ImmediateDrawBindings.cpp.

References g_immediateDraw.

◆ draw_texture()

void esengine::draw_texture ( f32 x,
f32 y,
f32 width,
f32 height,
u32 textureId,
f32 r,
f32 g,
f32 b,
f32 a )

Definition at line 208 of file ImmediateDrawBindings.cpp.

References g_immediateDraw, and g_immediateDrawActive.

◆ draw_textureRotated()

void esengine::draw_textureRotated ( f32 x,
f32 y,
f32 width,
f32 height,
f32 rotation,
u32 textureId,
f32 r,
f32 g,
f32 b,
f32 a )

Definition at line 220 of file ImmediateDrawBindings.cpp.

References g_immediateDraw, and g_immediateDrawActive.

◆ draw_triangleMesh()

void esengine::draw_triangleMesh ( u32 id,
f32 r,
f32 g,
f32 b,
f32 a,
f32 xx,
f32 xy,
f32 yx,
f32 yy,
f32 tx,
f32 ty )

Definition at line 197 of file ImmediateDrawBindings.cpp.

References g_immediateDraw, and g_immediateDrawActive.

◆ draw_triangleMeshMany()

void esengine::draw_triangleMeshMany ( u32 id,
uintptr_t recordsPtr,
u32 count )

Definition at line 203 of file ImmediateDrawBindings.cpp.

References g_immediateDraw, and g_immediateDrawActive.

◆ draw_triangles()

void esengine::draw_triangles ( uintptr_t positionsPtr,
u32 vertexCount,
uintptr_t colorsPtr,
uintptr_t indicesPtr,
u32 indexCount,
f32 r,
f32 g,
f32 b,
f32 a,
f32 xx,
f32 xy,
f32 yx,
f32 yy,
f32 tx,
f32 ty )

Definition at line 171 of file ImmediateDrawBindings.cpp.

References g_immediateDraw, and g_immediateDrawActive.

◆ drawGeometry()

◆ drawParamSizeAlign()

void esengine::drawParamSizeAlign ( DrawParamType t,
u32 & size,
u32 & align )

std140 size/base-alignment of a supported param type.

Definition at line 21 of file DrawParams.cpp.

References Float, Int, Mat3, Mat4, Vec2, Vec3, and Vec4.

Referenced by rewriteLooseUniforms().

◆ dynamicGIScene()

DynamicGIScene & esengine::dynamicGIScene ( )

The scene the next frame draws from; written by script through the bindings.

Definition at line 15 of file DynamicGI.cpp.

Referenced by esengine::DynamicGI::declare().

◆ dynamicGIStats()

const DynamicGIStats & esengine::dynamicGIStats ( )

The last frame's counters (zero before the first).

Definition at line 24 of file DynamicGI.cpp.

◆ engine_getCounters()

std::string esengine::engine_getCounters ( )

◆ engine_getCpuScopes()

std::string esengine::engine_getCpuScopes ( )

◆ engine_getGpuScopes()

std::string esengine::engine_getGpuScopes ( )

◆ engine_prepareMeshPrograms()

void esengine::engine_prepareMeshPrograms ( u32 rowsPtr,
u32 count,
u32 outPtr )

Readies the mesh programs a prepared cell requires, and reports what a readiness claim must record (layout in the .cpp).

A generation or epoch that moves underneath voids the claim: one assembled from two reads of different worlds is worse than none.

Definition at line 1298 of file RendererBindings.cpp.

References esengine::RenderPrewarmResult::asks, esengine::RenderPrewarmResult::compiles, ctx(), g_device, g_initialized, g_renderFrame, esengine::RenderPrewarmResult::materialAsks, esengine::RenderPrewarmResult::materialCompiles, esengine::RenderPrewarmResult::requirementDigest(), and esengine::EstellaContext::tryGet().

◆ engine_setCpuProfiling()

void esengine::engine_setCpuProfiling ( bool on)

◆ engine_setRandomSeed()

void esengine::engine_setRandomSeed ( u32 seed)

Reseed the engine's randomness (core/RandomSource.hpp) so a run reproduces. Unset, every run differs — which is what a player wants of particles.

Definition at line 1279 of file RendererBindings.cpp.

References ctx(), and setPendingRandomSeed().

◆ ensureTransformsUpdated()

void esengine::ensureTransformsUpdated ( ecs::Registry & registry)
static

Compose if a producer said the inputs moved. The renderer is a consumer of world transforms, not the authority over when they are computed.

Definition at line 900 of file RendererBindings.cpp.

References g_transformSystem.

Referenced by renderer_keepScreenOverlay(), renderer_submitAll(), renderer_submitScreenOverlay(), and renderer_updateTransforms().

◆ environment_create()

u32 esengine::environment_create ( uintptr_t shPtr,
u32 specularHandle,
f32 faceSize,
u32 mipCount,
f32 maxRange,
u32 columns )

Registers a baked environment: nine irradiance coefficients and the prefiltered reflection an ambient light casts.

Registers a baked environment (27 irradiance floats + a reflection atlas, which holds columns pyramids side by side).

Parameters
shPtr27 floats — nine RGB coefficients, already convolved and over pi.
specularHandleThe octahedral atlas, or 0 for a diffuse-only environment.

Definition at line 610 of file RendererBindings.cpp.

References boundarySpan(), ctx(), and esengine::EstellaContext::tryGet().

◆ environment_release()

void esengine::environment_release ( u32 environmentHandle)

Releases an environment. Its atlas is an ordinary texture and outlives it.

Releases an environment; its atlas is an ordinary texture and outlives it.

Definition at line 661 of file RendererBindings.cpp.

References ctx().

◆ environment_setSky()

void esengine::environment_setSky ( u32 environmentHandle,
u32 skyHandle )

Gives an environment the panorama its sky is drawn from.

Definition at line 627 of file RendererBindings.cpp.

References ctx(), and esengine::EstellaContext::tryGet().

◆ environment_setSun()

void esengine::environment_setSun ( u32 environmentHandle,
uintptr_t skyShPtr,
f32 dx,
f32 dy,
f32 dz,
f32 r,
f32 g,
f32 b )

Gives an environment the sun its importer separated from the sky.

Gives an environment its separated sun: the sky's irradiance without it (27 floats), the direction toward it and its irradiance over pi.

Parameters
skyShPtr27 floats — the irradiance with the sun taken out.
dx,dy,dzToward the sun, in the panorama's frame.
r,g,bThe sun's irradiance over pi.

Definition at line 641 of file RendererBindings.cpp.

References boundarySpan(), ctx(), esengine::Environment::hasSun, esengine::Environment::skyIrradiance, esengine::Environment::sunColor, esengine::Environment::sunDirection, and esengine::EstellaContext::tryGet().

◆ environmentToWorld()

glm::vec3 esengine::environmentToWorld ( const glm::vec3 & d,
f32 yawDegrees )
static

A direction in an environment's own frame, in the world's: the inverse of the shaders' envDirection, which turns a world direction by -yaw about +Y.

Definition at line 1827 of file RenderFrame.cpp.

◆ es_getMallocBytes()

f64 esengine::es_getMallocBytes ( )

Definition at line 98 of file WebSDKEntry.cpp.

Referenced by EMSCRIPTEN_BINDINGS().

◆ es_profile_now_ms()

double esengine::es_profile_now_ms ( )
inline

Milliseconds from a monotonic origin; only differences mean anything.

Off Emscripten this returned 0.0 until 2026-08-24, so render.collect, .submit, .graph and .finalize measured exactly zero on desktop, Android and iOS — a profiler reporting zero reads as one reporting a fast frame.

Definition at line 29 of file FrameProfiler.hpp.

Referenced by esengine::ScopeTimer::ScopeTimer(), esengine::ScopeTimer::~ScopeTimer(), and esengine::MeshPlugin::collect().

◆ esshader_cookInfo()

◆ flatHalfExtents()

glm::vec3 esengine::flatHalfExtents ( const glm::vec2 & turn,
const glm::vec3 & half )
inline

World AABB half-extents of a flat box turned by turn (from flatTurnZ). |R| * half, exact for a box. An unturned entity gets half back, so the result is never narrower than the box itself.

Definition at line 530 of file RenderTypePlugin.hpp.

Referenced by esengine::ShapePlugin::collect(), and esengine::UIElementPlugin::collect().

◆ flatTurnZ()

glm::vec2 esengine::flatTurnZ ( const glm::quat & rotation)
inline

The cos/sin of the turn a plane renderable draws with: its entity's rotation about Z, which is the only part a flat quad uses.

Definition at line 496 of file RenderTypePlugin.hpp.

Referenced by esengine::ShapePlugin::collect(), esengine::SpritePlugin::collect(), and esengine::UIElementPlugin::collect().

◆ flushImmediateDrawIfActive() [1/2]

void esengine::flushImmediateDrawIfActive ( )
static

◆ flushImmediateDrawIfActive() [2/2]

void esengine::flushImmediateDrawIfActive ( )
static

Definition at line 31 of file ImmediateDrawBindings.cpp.

References g_immediateDraw, and g_immediateDrawActive.

◆ frustumCorners()

void esengine::frustumCorners ( const glm::mat4 & invVP,
glm::vec3 out[8] )
static

The camera frustum's eight world corners, near plane first (GL clip z in [-1,1], which both backends' shared projection helpers write).

Definition at line 2252 of file RenderFrame.cpp.

◆ gatherLodLevels()

◆ geometry_create()

u32 esengine::geometry_create ( )

Definition at line 72 of file GeometryBindings.cpp.

References g_geometryManager.

◆ geometry_init()

void esengine::geometry_init ( u32 handle,
uintptr_t verticesPtr,
u32 vertexCount,
uintptr_t layoutPtr,
u32 layoutCount,
bool dynamic )

◆ geometry_isValid()

bool esengine::geometry_isValid ( u32 handle)

Definition at line 152 of file GeometryBindings.cpp.

References g_geometryManager.

◆ geometry_release()

void esengine::geometry_release ( u32 handle)

Definition at line 147 of file GeometryBindings.cpp.

References g_geometryManager.

◆ geometry_setIndices16()

void esengine::geometry_setIndices16 ( u32 handle,
uintptr_t indicesPtr,
u32 indexCount )

Definition at line 112 of file GeometryBindings.cpp.

References boundarySpan(), and g_geometryManager.

◆ geometry_setIndices32()

void esengine::geometry_setIndices32 ( u32 handle,
uintptr_t indicesPtr,
u32 indexCount )

Definition at line 123 of file GeometryBindings.cpp.

References boundarySpan(), and g_geometryManager.

◆ geometry_updateVertices()

void esengine::geometry_updateVertices ( u32 handle,
uintptr_t verticesPtr,
u32 vertexCount,
u32 offset )

Definition at line 134 of file GeometryBindings.cpp.

References boundarySpan(), and g_geometryManager.

◆ getResourceManager()

resource::ResourceManager * esengine::getResourceManager ( )

Definition at line 430 of file WebSDKEntry.cpp.

References g_resourceManager.

Referenced by EMSCRIPTEN_BINDINGS().

◆ getUINodeAlphaInTree()

f32 esengine::getUINodeAlphaInTree ( ecs::Registry & registry,
u32 entity )

Subtree opacity resolved by the layout pass (UINode.opacity multiplied down).

Definition at line 135 of file UIBindings.cpp.

References esengine::Entity::fromRaw(), esengine::ecs::GroupOpacityLookup::of(), and esengine::ecs::Registry::tryGet().

Referenced by EMSCRIPTEN_BINDINGS().

◆ getUINodeComputedHeight()

f32 esengine::getUINodeComputedHeight ( ecs::Registry & registry,
u32 entity )

◆ getUINodeComputedWidth()

f32 esengine::getUINodeComputedWidth ( ecs::Registry & registry,
u32 entity )

◆ getUINodeHiddenInTree()

bool esengine::getUINodeHiddenInTree ( ecs::Registry & registry,
u32 entity )

UINode computed state that is not embind-readable off the component.

Definition at line 127 of file UIBindings.cpp.

References esengine::Entity::fromRaw(), esengine::ecs::UINode::hidden_in_tree_, and esengine::ecs::Registry::tryGet().

Referenced by EMSCRIPTEN_BINDINGS().

◆ gfxBytesPerPixel()

u32 esengine::gfxBytesPerPixel ( GfxPixelFormat fmt)
inline

Bytes one pixel occupies in the CALLER's upload buffer — the single source both backends size a read of caller-owned pixels with. A backend's own texel size may differ (RGB8 widens to RGBA8 on WebGPU). Depth formats are attachment-only and never uploaded.

Definition at line 299 of file GfxEnums.hpp.

References RGB8, RGBA16F, and RGBA32F.

Referenced by esengine::GfxDevice::estimatedGpuBytes(), and esengine::GfxDevice::updateTexture().

◆ gfxCompressedBlockInfo()

◆ gfxCompressedPyramidBytes()

u32 esengine::gfxCompressedPyramidBytes ( GfxCompressedFormat fmt,
u32 width,
u32 height,
u32 mipLevels )
inline

Total bytes of a full mip pyramid (levels 0..mipLevels-1) for a base-size compressed texture — the block-aligned sum both the transcoder (packing) and the device (uploading) agree on.

Definition at line 381 of file GfxEnums.hpp.

References esengine::GfxBlockInfo::blockHeight, esengine::GfxBlockInfo::blockWidth, esengine::GfxBlockInfo::bytesPerBlock, and gfxCompressedBlockInfo().

◆ gfxDeviceLostReasonName()

const char * esengine::gfxDeviceLostReasonName ( GfxDeviceLostReason reason)
inline

Human-readable reason, for logs and diagnostics reports.

Definition at line 616 of file GfxEnums.hpp.

References ContextLost, Destroyed, Internal, OutOfMemory, Removed, Reset, Unknown, and Validation.

Referenced by gfxFormatDeviceLost().

◆ gfxFormatDeviceLost()

std::string esengine::gfxFormatDeviceLost ( const GfxDeviceLostInfo & info)
inline

The whole report as one line, for a log or a crash report.

Single formatter so the C++ log, the JS diagnostics record and a user-facing error all name the failure identically.

Definition at line 630 of file GfxEnums.hpp.

References esengine::GfxDeviceIdentity::backend, esengine::GfxDeviceLostInfo::context, esengine::GfxDeviceLostInfo::frame, gfxDeviceLostReasonName(), esengine::GfxDeviceLostInfo::identity, esengine::GfxDeviceLostInfo::message, esengine::GfxDeviceLostInfo::reason, esengine::GfxDeviceIdentity::renderer, esengine::GfxDeviceIdentity::vendor, and esengine::GfxDeviceIdentity::version.

Referenced by deviceLostReport().

◆ gfxWholeBlockLevels()

u32 esengine::gfxWholeBlockLevels ( GfxCompressedFormat fmt,
u32 width,
u32 height,
u32 mipLevels )
inline

How many mip levels of a width x height image are WHOLE blocks, counting from the base — the levels a compressed copy may write, since a copy whose size is not a multiple of the block is refused. 72x72 has two (72, 36; 18 stops it) and 70x70 has none, which is what makes an image uncompressible rather than merely short of mips.

Definition at line 366 of file GfxEnums.hpp.

References esengine::GfxBlockInfo::blockHeight, esengine::GfxBlockInfo::blockWidth, and gfxCompressedBlockInfo().

◆ gl_checkErrors()

u32 esengine::gl_checkErrors ( const std::string & context)

◆ gl_enableErrorCheck()

void esengine::gl_enableErrorCheck ( bool enabled)

◆ glslMultiDraw()

bool & esengine::glslMultiDraw ( )
inline

Whether this process's GLSL mesh programs count through a run's entries by gl_DrawID.

Set by the GL device when it enables WEBGL_multi_draw, before any program is assembled, and read by the shader assembly, which then enables the extension in a stage that reads an entry.

Definition at line 64 of file InstanceConstants.hpp.

Referenced by esengine::resource::ShaderParser::assembleStageEx(), and esengine::GLDevice::init().

◆ hdrRefusalName()

const char * esengine::hdrRefusalName ( HdrRefusal why)
inline

The refusal as a word, for a log line and for a reader.

Definition at line 31 of file HdrFormat.hpp.

References FloatTargetsUnsupported, and None.

◆ initRenderer()

bool esengine::initRenderer ( )

Definition at line 393 of file WebSDKEntry.cpp.

References initRendererInternal().

Referenced by EMSCRIPTEN_BINDINGS().

◆ initRendererInternal()

bool esengine::initRendererInternal ( const char * canvasSelector)

◆ initRendererThreaded()

bool esengine::initRendererThreaded ( bool preferGPU,
const std::string & features,
bool readback )

◆ initRendererWebGPU()

bool esengine::initRendererWebGPU ( const std::string & canvasSelector,
u32 width,
u32 height,
bool readback,
bool preferBGRA )

◆ initRendererWithContext()

bool esengine::initRendererWithContext ( int contextHandle)

◆ isBlendedStage()

bool esengine::isBlendedStage ( RenderStage stage)
static

Whether a draw is in a stage sorted back to front and drawn over what is there, as against the opaque scene: what a blend mode on an opaque draw (a lit material whose alpha is 1) cannot say, and what decides which side of the water a draw is drawn on.

Definition at line 527 of file DrawList.cpp.

References Overlay, and Transparent.

Referenced by esengine::DrawList::anyBlendedWithoutSceneColor(), and esengine::DrawList::execute().

◆ isRadialMethod()

bool esengine::isRadialMethod ( ecs::UIFillMethod m)
static

◆ isSrgbFormat()

bool esengine::isSrgbFormat ( WGPUTextureFormat f)
static

Whether a surface format makes the hardware encode on write.

Definition at line 480 of file WebGPUDevice.cpp.

◆ legacyCtx()

EngineContext & esengine::legacyCtx ( )
static

◆ lightForward()

glm::vec3 esengine::lightForward ( ecs::Transform * transform)
static

Where a light aims: the entity's forward, its rotation applied to -Z. A light without a Transform aims the way an unrotated one does, which is into the screen — where a 2D scene's light comes from.

Definition at line 1687 of file RenderFrame.cpp.

References esengine::ecs::Transform::ensureDecomposed(), and esengine::ecs::Transform::worldRotation.

◆ lightReachMask2D()

u32 esengine::lightReachMask2D ( const GpuLight * lights,
u32 count,
const glm::vec2 & lo,
const glm::vec2 & hi )
inline

Bit i set when loop light i can put any light on the box lo .. hi (the plane's XY, the space the vertices are in).

A light's ramp is zero from its radius outward whichever way it falls off (distanceFalloff), so a box wholly past the radius gets exactly nothing from it. A directional light reaches everything; a light of no intensity reaches nothing. The radius is taken a hair wide: the fragment measures from an interpolated position, not from the corners.

Definition at line 224 of file LightConstants.hpp.

References esengine::GpuLight::color, esengine::GpuLight::posDir, and SPRITE_LIGHT_REACH_BITS.

Referenced by esengine::SpritePlugin::collect().

◆ lightRefusalName()

const char * esengine::lightRefusalName ( LightRefusal why)
inline

The refusal as a word, for a log line and for a reader.

Definition at line 34 of file LightPlan.hpp.

References Capacity, NoEnvironmentSun, and None.

◆ makeShared()

template<typename T, typename... Args>
Shared< T > esengine::makeShared ( Args &&... args)
constexpr

Creates a Shared pointer with the given arguments.

Template Parameters
TThe type to construct
ArgsConstructor argument types
Parameters
argsArguments forwarded to T's constructor
Returns
A Shared<T> owning the new object

Definition at line 111 of file Types.hpp.

◆ makeUnique()

◆ markLightTiles()

void esengine::markLightTiles ( const glm::mat4 & viewProjection,
const glm::vec3 & center,
f32 radius,
u32 index,
u32(*) masks[4] )
inline

Sets bit index in every tile of masks that the sphere (center, radius), seen through viewProjection, can reach.

Conservative: the sphere is boxed, the box's eight corners projected, and the tiles the projected rectangle covers get the bit. A corner at or behind the eye makes the projection meaningless, so a light that straddles the camera plane marks every tile — wrongly lit tiles cost a loop iteration, wrongly unlit ones are a visible hole. A light wholly off the screen marks none.

Definition at line 42 of file TiledLights.hpp.

References TILE_COLUMNS, and TILE_ROWS.

Referenced by esengine::LightStore::markLoopLights().

◆ maskReaches()

bool esengine::maskReaches ( const ResolvedMask & mask,
const DrawList::SortIdentity & where )
inline

Whether mask still covers a draw sitting at where.

Strictly after: a mask and a sprite at the same place have no order between them, and a stencil written by a draw that may come second cuts nothing reliably.

Definition at line 34 of file SpriteMaskRange.hpp.

References esengine::ResolvedMask::at, esengine::ResolvedMask::limited, and esengine::ResolvedMask::reachEnd.

Referenced by nearestReachingMask().

◆ material_compileEsshader()

u32 esengine::material_compileEsshader ( const std::string & source,
const std::string & featuresCsv )

Compile a .esshader through the full ShaderParser path — assembling the auto-generated MaterialConstants block plus the requested feature/switch permutation (each feature -> #define NAME 1) — and register its param layout. featuresCsv is the enabled #pragma switch set, comma-separated, so a material's static switches select a permutation; the SDK loader caches one compiled program per (shader, switch-set). Returns the shader resource handle, or 0 on failure.

Definition at line 29 of file MaterialBindings.cpp.

References esengine::resource::ShaderParser::assembleStage(), esengine::resource::ParsedShader::errorMessage, ES_LOG_ERROR, esengine::resource::Fragment, g_renderContext, g_resourceManager, esengine::resource::Handle< T >::id(), esengine::resource::Handle< T >::isValid(), esengine::MaterialStore::layoutOf(), esengine::resource::ParsedShader::name, esengine::resource::ShaderParser::parse(), esengine::MaterialStore::seedSamplers(), esengine::resource::ShaderParser::splitFeatures(), esengine::resource::ParsedShader::valid, and esengine::resource::Vertex.

◆ material_define()

void esengine::material_define ( u32 materialId,
u32 shaderHandle,
u32 blendMode,
u32 flags,
i32 depthBias )

Publish a material's resolved render state. shaderHandle is translated here to the program id the render path binds; flags packs depthTest (bit 0), depthWrite (bit 1) and CullMode (bits 2-3), while depthBias is its own parameter because it is a value, not a switch.

Definition at line 70 of file MaterialBindings.cpp.

References esengine::MaterialRecord::blend, esengine::MaterialRecord::cull, esengine::MaterialRecord::depthBias, esengine::MaterialRecord::depthTest, esengine::MaterialRecord::depthWrite, g_renderContext, g_resourceManager, esengine::MaterialRecord::shader, and esengine::MaterialRecord::shaderRef.

◆ material_setTexture()

void esengine::material_setTexture ( u32 materialId,
const std::string & name,
u32 textureHandle )

Bind a texture param to its reflected sampler unit. textureHandle is an SDK texture resource handle; 0 clears the binding back to the param's default.

Definition at line 99 of file MaterialBindings.cpp.

References g_renderContext.

◆ material_setUniform()

void esengine::material_setUniform ( u32 materialId,
const std::string & name,
u32 arity,
f32 v0,
f32 v1,
f32 v2,
f32 v3 )

Pack a named param's float components into the material's std140 block, by reflected offset. A no-op when the shader declares no matching #pragma param.

Definition at line 91 of file MaterialBindings.cpp.

References g_renderContext.

◆ material_undefine()

void esengine::material_undefine ( u32 materialId)

Definition at line 108 of file MaterialBindings.cpp.

References g_renderContext.

◆ materialDefaultByName()

MaterialDefaultTexture esengine::materialDefaultByName ( const std::string & name)
inline

Maps a shader's declared default(<name>) to the built-in it names.

Definition at line 68 of file MaterialStore.hpp.

References Black, FlatNormal, Ripples, and White.

Referenced by esengine::MaterialStore::layoutOf().

◆ mesh_createFromChannels()

u32 esengine::mesh_createFromChannels ( uintptr_t channelsPtr,
u32 channelCount,
u32 vertexStride,
uintptr_t vertexPtr,
u32 vertexBytes,
uintptr_t indexPtr,
u32 indexCount,
f32 minX,
f32 minY,
f32 minZ,
f32 maxX,
f32 maxY,
f32 maxZ,
uintptr_t bindPtr,
u32 bindFloats,
uintptr_t morphPtr,
u32 morphFloats,
u32 morphTargets,
u32 morphNormals )

Geometry from an .esmesh channel table; returns its handle, 0 on failure.

Definition at line 516 of file RendererBindings.cpp.

References esengine::resource::ResourceManager::createMesh(), ctx(), esengine::resource::Handle< T >::id(), SourceReplayable, and esengine::EstellaContext::tryGet().

◆ mesh_release()

void esengine::mesh_release ( u32 meshHandle)

Definition at line 598 of file RendererBindings.cpp.

References ctx().

◆ mesh_rematerializeFromChannels()

u32 esengine::mesh_rematerializeFromChannels ( u32 targetHandle,
uintptr_t channelsPtr,
u32 channelCount,
u32 vertexStride,
uintptr_t vertexPtr,
u32 vertexBytes,
uintptr_t indexPtr,
u32 indexCount,
f32 minX,
f32 minY,
f32 minZ,
f32 maxX,
f32 maxY,
f32 maxZ,
uintptr_t bindPtr,
u32 bindFloats,
uintptr_t morphPtr,
u32 morphFloats,
u32 morphTargets,
u32 morphNormals )

Releases a mesh and the buffers it owns.

Puts replayed geometry behind an EXISTING mesh handle after a device loss. Returns targetHandle on success, 0 on failure — never a new handle, which is the whole reason this is not mesh_createFromChannels.

Definition at line 542 of file RendererBindings.cpp.

References ctx(), esengine::resource::ResourceManager::rematerializeMesh(), and esengine::EstellaContext::tryGet().

◆ mesh_setClusters()

u32 esengine::mesh_setClusters ( u32 meshHandle,
uintptr_t clustersPtr,
u32 clusterCount,
uintptr_t indexPtr,
u32 indexCount )

Releases a mesh and the buffers it owns.

Gives a mesh its cluster hierarchy: clusterCount 48-byte records (lod::Cluster) and the indices of every level, the mesh's own first. Returns 1, or 0 where the engine refused it and the mesh stays drawn whole.

Definition at line 585 of file RendererBindings.cpp.

References boundarySpan(), esengine::lod::ClusterHierarchy::clusters, ctx(), esengine::lod::ClusterHierarchy::indices, and esengine::EstellaContext::tryGet().

◆ mesh_setSkinChunks()

u32 esengine::mesh_setSkinChunks ( u32 meshHandle,
uintptr_t chunksPtr,
u32 chunkCount,
uintptr_t bonesPtr,
u32 boneCount )

Gives a skinned mesh the chunks it is drawn in: chunkCount records of three u32 (first index, index count, bones named) and every chunk's bones in turn as u16 indices into the bind matrices. Returns 1, or 0 where the engine refused them and a mesh bound to more joints than one draw carries is drawn static.

Definition at line 568 of file RendererBindings.cpp.

References boundarySpan(), ctx(), and esengine::EstellaContext::tryGet().

◆ meshInstances_set()

void esengine::meshInstances_set ( ecs::Registry & registry,
u32 entity,
uintptr_t dataPtr,
u32 count )

The placements of a MeshInstances: sixteen f32 an instance (see the component). Empty clears the set.

Definition at line 368 of file RendererBindings.cpp.

References boundarySpan(), ES_LOG_WARN, esengine::Entity::fromRaw(), esengine::ecs::Registry::markChanged(), esengine::placement_bounds::stretchSquared(), and esengine::ecs::Registry::tryGet().

◆ meshLocalBounds()

void esengine::meshLocalBounds ( const Mesh & base,
const Mesh * coarse,
f32 displacement,
glm::vec3 & lo,
glm::vec3 & hi )
inline

Displacement is local to the geometry and must be included before any placement or parent transform.

Definition at line 74 of file MeshGeometry.hpp.

References esengine::Mesh::localMax, and esengine::Mesh::localMin.

Referenced by esengine::MeshPlugin::collect().

◆ meshRenderer_makeAllResident()

u32 esengine::meshRenderer_makeAllResident ( ecs::Registry & registry)

Freezes every MeshRenderer in the world; returns how many were frozen.

Definition at line 803 of file RendererBindings.cpp.

References esengine::ecs::Registry::tryGet(), and esengine::ecs::Registry::view().

◆ meshRenderer_setGeometry()

void esengine::meshRenderer_setGeometry ( ecs::Registry & registry,
u32 entity,
uintptr_t posUvPtr,
u32 vertexCount,
uintptr_t colorsPtr,
uintptr_t indicesPtr,
u32 indexCount )

◆ meshRenderer_setMaterialAll()

u32 esengine::meshRenderer_setMaterialAll ( ecs::Registry & registry,
u32 materialId )

Points every MeshRenderer at one material; returns how many.

Definition at line 792 of file RendererBindings.cpp.

References esengine::ecs::Registry::tryGet(), and esengine::ecs::Registry::view().

◆ meshRenderer_setMeshAll()

u32 esengine::meshRenderer_setMeshAll ( ecs::Registry & registry,
u32 meshHandle )

Points every MeshRenderer at one resident mesh; returns how many.

Definition at line 777 of file RendererBindings.cpp.

References esengine::ecs::MeshRenderer::mesh, esengine::ecs::Registry::tryGet(), and esengine::ecs::Registry::view().

◆ meshShaderReads()

bool esengine::meshShaderReads ( MeshChannel c)
constexpr

Whether the mesh shaders READ a channel, as opposed to the file carrying it.

An attribute nothing reads spends a slot and a fetch per vertex, so a channel kept for its information stays out of the LAYOUT. Every channel the format names is read now; the predicate stays so the next one can wait for its reader. check-mesh-shader-inputs holds this both ways.

Definition at line 177 of file GfxEnums.hpp.

◆ modelFromOrigin()

glm::mat4 esengine::modelFromOrigin ( const glm::mat4 & model,
const glm::dvec3 & origin )
inline

A model placed from origin, as it is placed from the origin now.

Definition at line 40 of file RenderOrigin.hpp.

References renderOrigin().

◆ nearestReachingMask()

const ResolvedMask * esengine::nearestReachingMask ( const ResolvedMask * masks,
u32 count,
const DrawList::SortIdentity & where )
inline

The mask whose ref the stencil still holds at where, or null.

The NEAREST reaching one, because it wrote last: where two masks overlap, the later write is what is in the buffer, so testing an earlier mask's ref would fail exactly inside the mask that covered it.

Definition at line 46 of file SpriteMaskRange.hpp.

References esengine::ResolvedMask::at, maskReaches(), and esengine::ResolvedMask::ref.

◆ neutralSkyIrradiance()

void esengine::neutralSkyIrradiance ( std::array< glm::vec3, 9 > & sh)
static

The studio rig. A sky that is light from above and less from below, so a surface reads by its facing even before a light touches it; the radiance is a + b*y, whose cosine-convolved nine coefficients (already over pi, like an imported environment's) are a/Y00 for the constant term and (2/3)*b/Y1 for the y one.

Definition at line 2084 of file RenderFrame.cpp.

◆ nextRevision()

◆ notifyDeviceLost()

void esengine::notifyDeviceLost ( u32 reason,
const std::string & message )

Reports a loss the page observed.

The browser tells JS, not wasm: webglcontextlost fires on the canvas element and a GPUDevice resolves its lost promise. Both arrive here so the C++ device stops submitting on the same frame rather than after its own next poll.

Definition at line 511 of file WebSDKEntry.cpp.

◆ orientedWorldAabb()

void esengine::orientedWorldAabb ( const glm::vec3 & position,
const glm::quat & rotation,
const glm::vec3 & scale,
const glm::vec3 & localMin,
const glm::vec3 & localMax,
glm::vec3 & outCentre,
glm::vec3 & outHalf )
inline

The world AABB of a turned box: its centre and half-extents, from a local box and the position, rotation and scale that place it.

Each axis takes |R| * halfExtents, which is exact for a box. One function because two things derive it — a mesh's cull and a shadow map's fit — and a rotation dropped from either bounds a model by a box smaller than itself.

Definition at line 511 of file RenderTypePlugin.hpp.

Referenced by esengine::MeshPlugin::collect().

◆ packColor() [1/2]

u32 esengine::packColor ( const glm::vec4 & c)
inline

Definition at line 55 of file BatchVertex.hpp.

References packColor().

◆ packColor() [2/2]

◆ packHalf()

u16 esengine::packHalf ( f32 value)
inline

IEEE binary32 to binary16.

The end that matters is the subnormal one — hence the explicit path rather than a cast. A value too large for half saturates to infinity, which is what a number that big would look like on screen either way.

Definition at line 25 of file Half.hpp.

Referenced by esengine::ProbeStore::fillAtlas().

◆ packLightLayerRange()

f32 esengine::packLightLayerRange ( i32 layerMin,
i32 layerMax )
inline

The range of sprite layers a light reaches, as the number that rides in shadowMap.y above the tile count. 0 is every layer.

Definition at line 97 of file LightConstants.hpp.

◆ packShadowBias()

f32 esengine::packShadowBias ( f32 texels,
f32 slopeFloor )
inline

Definition at line 77 of file LightConstants.hpp.

◆ packSpriteLightLane()

f32 esengine::packSpriteLightLane ( i32 layer,
u32 reachMask )
inline

The lane a lit quad carries: its layer and the lights that reach it (lightReachMask2D).

Definition at line 243 of file LightConstants.hpp.

References SPRITE_LAYER_BIAS, SPRITE_LIGHT_REACH_BITS, and SPRITE_LIGHT_REACH_STEP.

Referenced by esengine::SpritePlugin::collect().

◆ parallaxAnchor()

ParallaxAnchor & esengine::parallaxAnchor ( )
inline

Definition at line 147 of file RenderTypePlugin.hpp.

Referenced by computeCameraView(), and renderer_setParallaxAnchor().

◆ parallaxedWorldPosition()

◆ pixelFormatName()

const char * esengine::pixelFormatName ( GfxPixelFormat format)
inline

A pixel format as a word.

Named HERE rather than mirrored in TypeScript: the enum crosses as a bare number, and a second spelling of its ORDER is what check-enum-twins exists to refuse. A reader that wants to show the format asks for the word.

Definition at line 47 of file HdrFormat.hpp.

References Depth24Stencil8, DepthComponent24, RGB8, RGBA16F, RGBA32F, RGBA8, and SRGB8_ALPHA8.

◆ placementCoarseMesh()

const Mesh * esengine::placementCoarseMesh ( resource::ResourceManager & resources,
const Mesh & base,
const ecs::MeshInstances & placements )
inline

◆ planarReflectionCamera()

bool esengine::planarReflectionCamera ( const glm::mat4 & source,
const glm::vec3 & origin,
glm::vec3 normal,
f32 offset,
PlanarReflectionCamera & out )
inline

Mirrors through a world plane; supports perspective and orthographic sources. Engine clip depth stays [-1,1] until the existing device remap at upload. Oblique row replacement: https://terathon.com/blog/oblique-clipping.html

Definition at line 19 of file PlanarReflectionCamera.hpp.

References cameraFromViewProjection(), esengine::PlanarReflectionCamera::projection, and esengine::PlanarReflectionCamera::samplingProjection.

◆ postprocess_addComputePass()

u32 esengine::postprocess_addComputePass ( const std::string & name,
const std::string & wgsl,
const std::string & params,
u32 workgroupX,
u32 workgroupY )

Adds a pass that is a WGSL compute shader over the picture (see PostProcessPipeline::addComputePass).

Parameters
paramsThe names of the f32 params the shader's block holds, in order, comma separated.

On a device with no compute stage the pass is left out of the chain and the picture goes through as it was.

◆ postprocess_addNativePass()

u32 esengine::postprocess_addNativePass ( const std::string & name,
const std::string & kind )

Adds a pass the engine implements itself ("voxelGI"); its parameters are set by name like any pass's.

On a device with no compute stage the pass is left out of the chain and the picture goes through as it was.

◆ postprocess_addPass()

u32 esengine::postprocess_addPass ( const std::string & name,
u32 shaderHandle )

◆ postprocess_addScreenPass()

u32 esengine::postprocess_addScreenPass ( const std::string & name,
u32 shaderHandle )

◆ postprocess_begin()

void esengine::postprocess_begin ( )

◆ postprocess_beginScreenCapture()

void esengine::postprocess_beginScreenCapture ( )

◆ postprocess_clearPasses()

void esengine::postprocess_clearPasses ( )

◆ postprocess_clearScreenPasses()

void esengine::postprocess_clearScreenPasses ( )

◆ postprocess_effectiveMsaaSamples()

u32 esengine::postprocess_effectiveMsaaSamples ( )

What the scene target is actually multisampled at, and the most this device can do. Separate because a request and a capability are different facts, and only saying both tells a typo from a machine. 0 = nothing here can answer.

◆ postprocess_end()

void esengine::postprocess_end ( )

◆ postprocess_endScreenCapture()

void esengine::postprocess_endScreenCapture ( )

◆ postprocess_executeScreenPasses()

void esengine::postprocess_executeScreenPasses ( )

◆ postprocess_giStats()

u32 esengine::postprocess_giStats ( uintptr_t dst,
u32 capacity )

The dynamic GI's last-frame work counters (DynamicGIStats), written as floats to dst; returns how many, 0 when capacity is short.

◆ postprocess_hdrFormat()

i32 esengine::postprocess_hdrFormat ( uintptr_t outPtr)

The format decision the last frame COMMITTED to, into four floats at outPtr: requested, effective, refusal, linear.

The frame's own answer, not the capability re-asked. linear false is a project that never asked for HDR, which is not a fallback. Returns 0 before a frame has committed a format.

◆ postprocess_hdrFormatNames()

std::string esengine::postprocess_hdrFormatNames ( )

The last committed decision as words: "requested|effective|reason". Empty before a frame has committed one. The names come from the engine so no reader has to hold a second spelling of the format enum's order.

◆ postprocess_init()

bool esengine::postprocess_init ( u32 width,
u32 height )

◆ postprocess_isInitialized()

bool esengine::postprocess_isInitialized ( )

◆ postprocess_maxMsaaSamples()

u32 esengine::postprocess_maxMsaaSamples ( )

◆ postprocess_pollSkyCapture()

i32 esengine::postprocess_pollSkyCapture ( )

0 = not yet, 1 = ready to take, 2 = nothing asked for or it failed. Call between frames.

◆ postprocess_requestSkyCapture()

void esengine::postprocess_requestSkyCapture ( const std::string & passName,
u32 width,
u32 height )

Draw passName once more next frame into a width x height RGBA8 panorama, its u_skyCapture param at 1.

◆ postprocess_resize()

void esengine::postprocess_resize ( u32 width,
u32 height )

◆ postprocess_setBypass()

void esengine::postprocess_setBypass ( bool bypass)

◆ postprocess_setDisplayLut()

void esengine::postprocess_setDisplayLut ( u32 textureHandle,
f32 amount )

A graded look the last pass applies to the picture as the display shows it: a 1024x32 table (texture handle, 0 for none) and how far, 0 to 1. Let go with the passes.

◆ postprocess_setGIScene()

bool esengine::postprocess_setGIScene ( uintptr_t headerPtr,
u32 headerCount,
uintptr_t sdfPtr,
u32 sdfCount,
uintptr_t instancesPtr,
u32 instanceCount,
uintptr_t pixelsPtr,
u32 pixelCount )

Hands the dynamic GI the scene it traces: the header, the distance field, the instances and the card pixels, laid out as sdk/src/gi/gpuScene.ts writes them (see DynamicGI.hpp). The engine copies them; the pointers are free after the call.

Returns
false when a count does not match what the header says.

◆ postprocess_setMsaaSamples()

void esengine::postprocess_setMsaaSamples ( u32 samples)

The project's multisampling request for the scene target; 1 = off. Clamped by what the device supports — the device answers capability, not policy.

◆ postprocess_setOutputTransform()

void esengine::postprocess_setOutputTransform ( u32 transform)

The curve the chain applies on the way out: 0 = none, 1 = ACES filmic.

◆ postprocess_setOutputViewport()

void esengine::postprocess_setOutputViewport ( u32 x,
u32 y,
u32 w,
u32 h )

◆ postprocess_setPassContinuesEffect()

void esengine::postprocess_setPassContinuesEffect ( const std::string & passName)

A later pass of a multi-pass effect: it composites over that effect's input.

◆ postprocess_setPassScale()

void esengine::postprocess_setPassScale ( const std::string & passName,
f32 scale )

Draw a pass at a fraction of the chain size; the next pass upsamples it.

◆ postprocess_setPassTexture()

void esengine::postprocess_setPassTexture ( const std::string & passName,
const std::string & uniform,
u32 textureHandle )

◆ postprocess_setPresentRequired()

void esengine::postprocess_setPresentRequired ( bool required)

Say the frame needs a present even when the two rects look alike; see PostProcessPipeline::setPresentRequired.

◆ postprocess_setScreenUniformFloat()

void esengine::postprocess_setScreenUniformFloat ( const std::string & passName,
const std::string & uniform,
f32 value )

◆ postprocess_setScreenUniformVec4()

void esengine::postprocess_setScreenUniformVec4 ( const std::string & passName,
const std::string & uniform,
f32 x,
f32 y,
f32 z,
f32 w )

◆ postprocess_setUniformFloat()

void esengine::postprocess_setUniformFloat ( const std::string & passName,
const std::string & uniform,
f32 value )

◆ postprocess_setUniformVec4()

void esengine::postprocess_setUniformVec4 ( const std::string & passName,
const std::string & uniform,
f32 x,
f32 y,
f32 z,
f32 w )

◆ postprocess_setViewExposure()

void esengine::postprocess_setViewExposure ( f32 ev)

The editor view's exposure in stops (EV); 0 is exact identity. View state, never saved.

◆ postprocess_shutdown()

void esengine::postprocess_shutdown ( )

◆ postprocess_supportsCompute()

bool esengine::postprocess_supportsCompute ( )

Whether compute passes run on this device: WebGPU yes, WebGL2 no.

◆ postprocess_takeSkyCapture()

bool esengine::postprocess_takeSkyCapture ( uintptr_t dst,
u32 bytes )

Copies the ready capture (RGBA8, rows bottom-up) to dst; false when it does not fit bytes or is not ready.

◆ postprocess_updateGIField()

bool esengine::postprocess_updateGIField ( uintptr_t headerPtr,
u32 headerCount,
uintptr_t sdfPtr,
u32 sdfOffset,
u32 sdfCount )

Updates the scene the dynamic GI traces after the camera moved: the header, and sdfCount floats of the field from float sdfOffset on.

Nothing else of the scene changes, and the GPU is sent only that range: the cards keep the light they have. Needs a scene set whole first.

Returns
false when there is no scene yet, or the range falls outside it.

◆ probe_volume_create()

u32 esengine::probe_volume_create ( i32 resX,
i32 resY,
i32 resZ,
uintptr_t shPtr )

Registers a grid of baked irradiance — an environment sampled at points.

Registers a grid of baked irradiance: x*y*z*27 floats, x fastest.

Parameters
shPtrresX*resY*resZ*27 floats: nine RGB coefficients per probe, in grid order with x varying fastest.

Definition at line 672 of file RendererBindings.cpp.

References boundarySpan(), ctx(), and esengine::EstellaContext::tryGet().

◆ probe_volume_createBricks()

u32 esengine::probe_volume_createBricks ( i32 resX,
i32 resY,
i32 resZ,
i32 brickCount,
uintptr_t bricksPtr,
uintptr_t shPtr )

Registers a sparse grid of baked irradiance: brickCount bricks of four ints (first finest-brick cell x, y, z and span) at bricksPtr, and brickCount*125*27 floats at shPtr, brick after brick.

Definition at line 684 of file RendererBindings.cpp.

References boundarySpan(), ctx(), esengine::ProbeVolume::kBrickProbes, and esengine::EstellaContext::tryGet().

◆ probe_volume_getBricks()

i32 esengine::probe_volume_getBricks ( u32 volumeHandle,
uintptr_t outPtr,
i32 maxBricks )

A sparse volume's bricks, four ints each (first finest-brick cell x, y, z and span), up to maxBricks of them at outPtr. Returns how many it has: 0 for a dense volume or none, more than maxBricks when cut short.

Definition at line 722 of file RendererBindings.cpp.

References boundarySpanMut(), ctx(), and esengine::EstellaContext::tryGet().

◆ probe_volume_getResolution()

bool esengine::probe_volume_getResolution ( u32 volumeHandle,
uintptr_t outPtr )

The finest grid's probes along x, y and z, as three ints at outPtr. False for no such volume.

Definition at line 710 of file RendererBindings.cpp.

References boundarySpanMut(), ctx(), and esengine::EstellaContext::tryGet().

◆ probe_volume_release()

void esengine::probe_volume_release ( u32 volumeHandle)

Releases a probe volume.

Definition at line 739 of file RendererBindings.cpp.

References ctx().

◆ probe_volume_setSkyVisibility()

void esengine::probe_volume_setSkyVisibility ( u32 volumeHandle,
uintptr_t visibilityPtr )

Releases a probe volume.

Gives a probe grid how much of the sky each probe sees: nine floats per probe, in the order its irradiance is (grid order, or brick after brick for a sparse grid; a bake with sky occlusion). The grid's irradiance then holds the lights alone, and the frame's sky is added through this.

Definition at line 698 of file RendererBindings.cpp.

References boundarySpan(), ctx(), esengine::ProbeVolume::isValid(), esengine::ProbeVolume::nextRevision(), esengine::ProbeVolume::probeCount(), esengine::ProbeVolume::revision, esengine::ProbeVolume::skyVisibility, and esengine::EstellaContext::tryGet().

◆ provideReplacementDevice()

bool esengine::provideReplacementDevice ( )

Hands the backend a replacement device the page acquired.

WebGPU only: a device belongs to whoever created it, so a lost one can only be replaced from the page. Taken up by the next recovery attempt, which keeps one order of operations for both backends.

Definition at line 479 of file WebSDKEntry.cpp.

References esengine::GfxDevice::provideReplacementDevice().

◆ pushBatchCommand() [1/2]

void esengine::pushBatchCommand ( TransientBufferPool & pool,
DrawList & drawList,
const ClipState & clips,
u32 vertexByteOffset,
u32 vertexCount,
const u16 * localIndices,
u32 indexCount,
const BatchDrawKey & key )

Definition at line 198 of file BatchBuilder.cpp.

◆ pushBatchCommand() [2/2]

void esengine::pushBatchCommand ( TransientBufferPool & pool,
DrawList & drawList,
const ClipState & clips,
u32 vertexByteOffset,
u32 vertexCount,
const u32 * localIndices,
u32 indexCount,
const BatchDrawKey & key )

Pushes a DrawCommand for vertices ALREADY resident in the Batch stream at vertexByteOffset.

Offsets localIndices (0-based within the primitive) by the stream's baseVertex, appends them, then delegates to pushBatchDraw. Use when the caller formatted vertices in place via allocVertices()+vertexData() (the spine path). The u16/u32 overloads cover both index source widths.

Definition at line 191 of file BatchBuilder.cpp.

Referenced by esengine::RenderFrame::submitSkeletalBatch(), and esengine::RenderFrame::submitTextBatch().

◆ pushBatchDraw()

void esengine::pushBatchDraw ( DrawList & drawList,
const ClipState & clips,
u32 vertexByteOffset,
u32 vertexCount,
u32 indexOffset,
u32 indexCount,
const BatchDrawKey & key )

Atomic primitive: assemble + clip + push one DrawCommand for an index range ALREADY written into (or, for instanced draws, static in) the key's stream.

The single piece every render path used to duplicate. Use directly when the caller streams both vertices and indices in place, or for instanced draws over a static index range (the particle emitter's unit quad).

Definition at line 54 of file BatchBuilder.cpp.

References esengine::ClipState::applyTo(), Batch, esengine::BatchDrawKey::blend, esengine::DrawCommand::blend_mode, esengine::DrawList::GroupIdentity::block, esengine::DrawList::GroupIdentity::blockOrder, esengine::DrawCommand::buildSortKey(), esengine::DrawCommand::buildSortKeyTree(), esengine::DrawCommand::buildSortKeyYSorted(), esengine::BatchDrawKey::cull, esengine::DrawCommand::cull, esengine::BatchDrawKey::cullBit, esengine::DrawList::Depth, esengine::BatchDrawKey::depth, esengine::DrawCommand::depth_bias, esengine::DrawCommand::depth_shader_id, esengine::DrawCommand::depth_test, esengine::DrawCommand::depth_write, esengine::BatchDrawKey::depthBias, esengine::BatchDrawKey::depthShaderId, esengine::BatchDrawKey::depthTest, esengine::BatchDrawKey::depthWrite, esengine::BatchDrawKey::entity, esengine::DrawCommand::entity, esengine::BatchDrawKey::envTextureId, esengine::Entity::id(), esengine::DrawCommand::index_buffer, esengine::DrawCommand::index_count, esengine::DrawCommand::index_offset, esengine::BatchDrawKey::indexBuffer, esengine::DrawCommand::instance_buffer, esengine::DrawCommand::instance_count, esengine::DrawCommand::instance_stride, esengine::BatchDrawKey::instanceBuffer, esengine::BatchDrawKey::instanceCount, esengine::BatchDrawKey::instanceStride, Invalid, esengine::ClipState::isEmptyScissor(), esengine::BatchDrawKey::layer, esengine::DrawCommand::layer, esengine::DrawList::SortIdentity::layer, esengine::DrawList::layerBit(), esengine::DrawList::layerOrder(), esengine::DrawList::layerVisible(), esengine::DrawCommand::layout_id, esengine::BatchDrawKey::layoutId, esengine::BatchDrawKey::lightmapTextureId, esengine::DrawCommand::material_id, esengine::BatchDrawKey::materialId, esengine::DrawCommand::morph_index, esengine::BatchDrawKey::morphIndex, esengine::BatchDrawKey::morphTextureId, None, esengine::BatchDrawKey::normalTextureId, Opaque, esengine::BatchDrawKey::order, esengine::DrawList::SortIdentity::order, esengine::DrawCommand::planar_index, esengine::BatchDrawKey::planarIndex, esengine::DrawCommand::probe_index, esengine::BatchDrawKey::probeGridTextureId, esengine::BatchDrawKey::probeIndex, esengine::DrawList::push(), esengine::DrawCommand::shader_id, esengine::BatchDrawKey::shaderId, esengine::BatchDrawKey::shadowTextureId, esengine::DrawCommand::skin_count, esengine::DrawCommand::skin_offset, esengine::BatchDrawKey::skinCount, esengine::BatchDrawKey::skinOffset, esengine::DrawCommand::sort_key, esengine::DrawList::sortIdentity(), esengine::DrawList::sortingGroupOf(), esengine::BatchDrawKey::stage, esengine::DrawCommand::stage, esengine::DrawCommand::texture_count, esengine::DrawCommand::texture_ids, esengine::BatchDrawKey::textureId, esengine::BatchDrawKey::topology, esengine::DrawCommand::topology, Transparent, esengine::DrawList::Tree, esengine::DrawList::treeSequenceOf(), esengine::BatchDrawKey::type, esengine::DrawCommand::type, esengine::DrawCommand::vertex_buffer, esengine::DrawCommand::vertex_byte_offset, esengine::DrawCommand::vertex_count, esengine::DrawCommand::vertex_layout, esengine::BatchDrawKey::vertexBuffer, esengine::BatchDrawKey::vertexLayout, esengine::DrawCommand::withGroupOrder(), esengine::BatchDrawKey::y, and esengine::DrawList::YSort.

Referenced by appendQuads(), esengine::MeshPlugin::collect(), esengine::ParticlePlugin::collect(), and esengine::TilemapRenderPlugin::collect().

◆ qualityCap()

f32 esengine::qualityCap ( QualityValue id)
constexpr

Definition at line 46 of file QualityValues.hpp.

References QUALITY_VALUE_SPECS.

◆ qualitySpecsInOrder()

bool esengine::qualitySpecsInOrder ( )
constexpr

Definition at line 38 of file QualityValues.hpp.

References QUALITY_VALUE_COUNT, and QUALITY_VALUE_SPECS.

◆ radialMaxSweep()

f32 esengine::radialMaxSweep ( ecs::UIFillMethod m)
static

◆ radialStartAngle()

f32 esengine::radialStartAngle ( ecs::UIFillOrigin origin)
static

◆ rebased()

glm::vec3 esengine::rebased ( const glm::vec3 & world)
inline

◆ recoverDevice()

bool esengine::recoverDevice ( )

Rebuilds the device and everything it issued; see GfxDevice::recoverDevice.

The device stays Recovering, drawing, until the content it is owed has been refilled or given up on, then turns Live by itself.

Definition at line 496 of file WebSDKEntry.cpp.

References g_renderContext, and esengine::GfxDevice::recoverDevice().

◆ refusalName()

const char * esengine::refusalName ( AtlasRefusal why)
inline

The refusal as a word, for a log line and, later, for a reader.

Definition at line 41 of file ShadowAtlas.hpp.

References None, NoSpace, TileBudget, and TooLarge.

◆ registry_batchSyncPhysicsTransforms()

void esengine::registry_batchSyncPhysicsTransforms ( ecs::Registry & registry,
uintptr_t bufferPtr,
int count,
float ppu )

◆ registry_componentMutationRevision()

double esengine::registry_componentMutationRevision ( ecs::Registry & registry,
u32 component,
bool topology )

◆ registry_entityChangeResetEpoch()

double esengine::registry_entityChangeResetEpoch ( ecs::Registry & registry)

◆ registry_entityChangeSequence()

double esengine::registry_entityChangeSequence ( ecs::Registry & registry)

◆ registry_getCanvasEntity()

i32 esengine::registry_getCanvasEntity ( ecs::Registry & registry)

Definition at line 1755 of file RendererBindings.cpp.

References esengine::ecs::Registry::activeView().

Referenced by EMSCRIPTEN_BINDINGS().

◆ registry_getGeneration()

u32 esengine::registry_getGeneration ( ecs::Registry & registry,
u32 entity )

◆ registry_markComponentsChanged()

void esengine::registry_markComponentsChanged ( ecs::Registry & registry,
uintptr_t pairsPtr,
int count )

◆ registry_readEntityChanges()

int esengine::registry_readEntityChanges ( ecs::Registry & registry,
double after,
uintptr_t outputPtr,
int capacity )

◆ registry_readWorldPoses2D()

◆ registry_unwatchEntityChanges()

void esengine::registry_unwatchEntityChanges ( ecs::Registry & registry,
u32 reader )

◆ registry_watchEntityChanges()

u32 esengine::registry_watchEntityChanges ( ecs::Registry & registry)

Definition at line 1810 of file RendererBindings.cpp.

References esengine::ecs::Registry::watchEntityChanges().

Referenced by EMSCRIPTEN_BINDINGS().

◆ registryLayoutEpoch()

double esengine::registryLayoutEpoch ( ecs::Registry & r)

Definition at line 530 of file WebSDKEntry.cpp.

References esengine::ecs::Registry::layoutEpoch().

Referenced by EMSCRIPTEN_BINDINGS().

◆ renderer_begin()

void esengine::renderer_begin ( uintptr_t matrixPtr,
u32 targetHandle,
i32 clearFlags,
f32 r,
f32 g,
f32 b,
f32 a,
i32 clearX,
i32 clearY,
u32 clearW,
u32 clearH )

Definition at line 863 of file RendererBindings.cpp.

References boundarySpan(), and g_renderFrame.

◆ renderer_beginFrame()

void esengine::renderer_beginFrame ( f32 elapsedSec)

Definition at line 848 of file RendererBindings.cpp.

References ctx(), g_renderFrame, g_viewportHeight, and g_viewportWidth.

◆ renderer_beginScreenOverlay()

void esengine::renderer_beginScreenOverlay ( uintptr_t projectionPtr,
i32 vpX,
i32 vpY,
u32 vpW,
u32 vpH )

The frame's screen-space overlay, drawn once after every camera and after post: begin with the projection the layout domain reaches pixels through, collect, let the host add its own screen geometry, then declare and run it.

Definition at line 939 of file RendererBindings.cpp.

References boundarySpan(), and g_renderFrame.

◆ renderer_captureFrame()

u32 esengine::renderer_captureFrame ( u32 w,
u32 h )

Books the next completed frame for readback and returns a handle to poll. The one way to ask a running engine what is on screen; a host that reads the page instead gets the display's answer, which is colour managed.

Books the next completed frame for readback; poll + take it.

Definition at line 2003 of file RendererBindings.cpp.

References g_device.

◆ renderer_captureNextFrame()

void esengine::renderer_captureNextFrame ( )

Definition at line 1882 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_captureTarget()

u32 esengine::renderer_captureTarget ( u32 target,
u32 w,
u32 h )

Books a readback of a render target's colour (w*h, bottom-up RGBA): poll it with renderer_pollFrameCapture. 0 when there is none.

Definition at line 2009 of file RendererBindings.cpp.

References g_device, and g_renderFrame.

◆ renderer_clusterInspect()

i32 esengine::renderer_clusterInspect ( u32 entity,
uintptr_t outPtr )

What the last frames drew of entity's Cluster LOD mesh: triangles and clusters, two u32 at outPtr; 0 when it has none drawn lately.

Definition at line 1578 of file RendererBindings.cpp.

References boundarySpanMut(), esengine::Entity::fromRaw(), and g_renderFrame.

◆ renderer_copyCapturedEntities()

bool esengine::renderer_copyCapturedEntities ( uintptr_t dest,
u32 destSize )

Definition at line 1957 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_copyCapturedRecords()

bool esengine::renderer_copyCapturedRecords ( uintptr_t dest,
u32 destSize )

The captured frame and the replay snapshot copied into the caller's buffer, for a host whose script cannot read engine memory (native). False when there is nothing to copy or destSize is too small for it.

Definition at line 1951 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_copyCapturedTextures()

bool esengine::renderer_copyCapturedTextures ( uintptr_t dest,
u32 destSize )

Definition at line 1963 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_copySnapshot()

bool esengine::renderer_copySnapshot ( uintptr_t dest,
u32 destSize )

Definition at line 1969 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_createSkeletalPreview()

u32 esengine::renderer_createSkeletalPreview ( i32 w,
i32 h )

Definition at line 2056 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_createTarget()

u32 esengine::renderer_createTarget ( u32 width,
u32 height,
i32 flags )

Definition at line 1125 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_destroySkeletalPreview()

void esengine::renderer_destroySkeletalPreview ( u32 preview)

Definition at line 2123 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_deviceGeneration()

f64 esengine::renderer_deviceGeneration ( )

Which generation of the GPU device is current. Not part of a readiness claim — the guard that says the claim was taken on one device.

Definition at line 1399 of file RendererBindings.cpp.

References g_device.

◆ renderer_diagnose()

◆ renderer_drawOverScreen()

void esengine::renderer_drawOverScreen ( i32 vpX,
i32 vpY,
u32 vpW,
u32 vpH,
u32 targetHandle )

Draws what Draw collected after the screen overlay over the whole frame, its UI included, in this pixel rect (see RenderFrame::drawOverScreen).

Definition at line 975 of file RendererBindings.cpp.

References checkGLErrors(), and g_renderFrame.

◆ renderer_end()

void esengine::renderer_end ( )

Definition at line 884 of file RendererBindings.cpp.

References checkGLErrors(), and g_renderFrame.

◆ renderer_endFrame()

void esengine::renderer_endFrame ( )

Closes the frame — the pair of beginFrame, and where a borrowed swapchain image goes back. Per FRAME, not per camera (see RenderFrame::endFrame).

Definition at line 890 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_endScreenOverlay()

void esengine::renderer_endScreenOverlay ( u32 targetHandle)

Definition at line 969 of file RendererBindings.cpp.

References checkGLErrors(), and g_renderFrame.

◆ renderer_entityVisibleToCamera()

void esengine::renderer_entityVisibleToCamera ( ecs::Registry & registry,
u32 entity,
i32 layer,
f32 minX,
f32 minY,
f32 maxX,
f32 maxY,
uintptr_t outVisiblePtr )

Whether the camera being rendered right now would draw this entity, given the local extent it promises to stay inside. All four corners are transformed, because under rotation the result's corners are not the input's. The frustum and mask are the frame's own — a fact, not a permission.

Geometry posed by a skeletal runtime (Spine, DragonBones): x,y,u,v,r,g,b,a per vertex, drawn as entity's, with its material resolved as a Sprite's is.

Definition at line 190 of file RendererBindings.cpp.

References esengine::ecs::Transform::ensureDecomposed(), esengine::Entity::fromRaw(), g_initialized, g_renderFrame, esengine::ecs::Registry::get(), and esengine::ecs::Registry::has().

◆ renderer_flush()

void esengine::renderer_flush ( )

Definition at line 878 of file RendererBindings.cpp.

References checkGLErrors(), and g_renderFrame.

◆ renderer_framePending()

i32 esengine::renderer_framePending ( )

1 while the GPU is still working on the frame last ended (GfxDevice::framePending); asks without waiting.

Definition at line 1574 of file RendererBindings.cpp.

References g_device.

◆ renderer_getAsyncComputeEnabled()

bool esengine::renderer_getAsyncComputeEnabled ( )

Definition at line 1415 of file RendererBindings.cpp.

References g_device.

◆ renderer_getCapturedEntities()

uintptr_t esengine::renderer_getCapturedEntities ( )

Definition at line 1898 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getCapturedEntityCount()

u32 esengine::renderer_getCapturedEntityCount ( )

Definition at line 1903 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getCapturedFrameData()

uintptr_t esengine::renderer_getCapturedFrameData ( )

Definition at line 1893 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getCapturedFrameSize()

u32 esengine::renderer_getCapturedFrameSize ( )

Definition at line 1888 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getCapturedPassCount()

u32 esengine::renderer_getCapturedPassCount ( )

Definition at line 1918 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getCapturedTextureCount()

u32 esengine::renderer_getCapturedTextureCount ( )

Definition at line 1913 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getCapturedTextures()

uintptr_t esengine::renderer_getCapturedTextures ( )

Definition at line 1908 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getCulled()

u32 esengine::renderer_getCulled ( )

Definition at line 1265 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getDrawCalls()

u32 esengine::renderer_getDrawCalls ( )

Definition at line 1166 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getDrawsWaitingForProgram()

u32 esengine::renderer_getDrawsWaitingForProgram ( )

Scene draws the last frame left out because a program they use was still compiling in the background.

Definition at line 1176 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getEstimatedGpuBytes()

f64 esengine::renderer_getEstimatedGpuBytes ( )

Definition at line 1386 of file RendererBindings.cpp.

References g_device.

◆ renderer_getGpuDrawCalls()

u32 esengine::renderer_getGpuDrawCalls ( )

Every draw the GPU was asked for in the last frame, every pass included (shadows, prepass, reflections, post-processing).

Definition at line 1181 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getGpuTimeMs()

f32 esengine::renderer_getGpuTimeMs ( )

Definition at line 1270 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getMeshes()

u32 esengine::renderer_getMeshes ( )

Definition at line 1260 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getPendingProgramLabels()

std::string esengine::renderer_getPendingProgramLabels ( )

What each program still compiling in the background is, one per line: its id and what it was made for.

Definition at line 1171 of file RendererBindings.cpp.

References g_device.

◆ renderer_getPendingShaders()

u32 esengine::renderer_getPendingShaders ( )

How many shaders are still compiling in the background; a loading screen waits for it to reach 0.

Definition at line 1558 of file RendererBindings.cpp.

References g_device.

◆ renderer_getPlanarReflectionStatus()

std::string esengine::renderer_getPlanarReflectionStatus ( u32 view,
u32 entity )

Definition at line 1500 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getPreviewHeight()

u32 esengine::renderer_getPreviewHeight ( )

Definition at line 2294 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getPreviewPtr()

uintptr_t esengine::renderer_getPreviewPtr ( )

Definition at line 2282 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getPreviewSize()

u32 esengine::renderer_getPreviewSize ( )

Definition at line 2286 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getPreviewWidth()

u32 esengine::renderer_getPreviewWidth ( )

Definition at line 2290 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getProbeAtlasBytes()

f64 esengine::renderer_getProbeAtlasBytes ( )

What the frame's probe atlas takes on the GPU, in bytes (0 while nothing reads per pixel).

Definition at line 1528 of file RendererBindings.cpp.

References esengine::ProbeStore::atlasBytes(), esengine::ProbeStore::atlasTexture(), ctx(), and esengine::EstellaContext::tryGet().

◆ renderer_getProbeDraws()

u32 esengine::renderer_getProbeDraws ( bool perPixel)

Draws that read a probe volume last frame: per pixel when perPixel, else per object.

Definition at line 1535 of file RendererBindings.cpp.

References ctx(), esengine::ProbeStore::perObjectDraws(), esengine::ProbeStore::perPixelDraws(), and esengine::EstellaContext::tryGet().

◆ renderer_getSkeletal()

u32 esengine::renderer_getSkeletal ( )

Definition at line 1250 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getSkeletalPreviewHeight()

u32 esengine::renderer_getSkeletalPreviewHeight ( u32 preview)

Definition at line 2119 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getSkeletalPreviewPtr()

uintptr_t esengine::renderer_getSkeletalPreviewPtr ( u32 preview)

Definition at line 2106 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getSkeletalPreviewSize()

u32 esengine::renderer_getSkeletalPreviewSize ( u32 preview)

Definition at line 2111 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getSkeletalPreviewWidth()

u32 esengine::renderer_getSkeletalPreviewWidth ( u32 preview)

Definition at line 2115 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getSkinCacheStat()

f64 esengine::renderer_getSkinCacheStat ( i32 which)

The skin cache's state: 0 active, 1 meshes held, 2 bytes held, 3 refused this frame by the budget, 4 posed this frame, 5 draws this frame that read a posed copy.

Definition at line 1433 of file RendererBindings.cpp.

References esengine::SkinCache::active(), esengine::SkinCache::bytesUsed(), esengine::SkinCache::drawsThisFrame(), esengine::SkinCache::entryCount(), g_renderFrame, esengine::SkinCache::refusedThisFrame(), and esengine::SkinCache::scheduledThisFrame().

◆ renderer_getSnapshotHeight()

u32 esengine::renderer_getSnapshotHeight ( )

Definition at line 1989 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getSnapshotPtr()

uintptr_t esengine::renderer_getSnapshotPtr ( )

Definition at line 1974 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getSnapshotSize()

u32 esengine::renderer_getSnapshotSize ( )

Definition at line 1979 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getSnapshotWidth()

u32 esengine::renderer_getSnapshotWidth ( )

Definition at line 1984 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getSprites()

u32 esengine::renderer_getSprites ( )

Definition at line 1245 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getTargetDepthTexture()

u32 esengine::renderer_getTargetDepthTexture ( u32 handle)

Definition at line 1133 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getTargetTexture()

u32 esengine::renderer_getTargetTexture ( u32 handle)

Definition at line 1145 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getText()

u32 esengine::renderer_getText ( )

Definition at line 1255 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_getTextureBytes()

f64 esengine::renderer_getTextureBytes ( )

Definition at line 1379 of file RendererBindings.cpp.

References ctx().

◆ renderer_getTriangles()

u32 esengine::renderer_getTriangles ( )

Definition at line 1240 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_hasCapturedData()

bool esengine::renderer_hasCapturedData ( )

Definition at line 1923 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_init()

void esengine::renderer_init ( u32 width,
u32 height )

Points a MeshRenderer at resident geometry; 0 returns it to its inline payload.

Definition at line 812 of file RendererBindings.cpp.

References ctx(), g_renderFrame, esengine::EstellaContext::state(), esengine::EngineState::viewport_height, and esengine::EngineState::viewport_width.

◆ renderer_keepScreenOverlay()

bool esengine::renderer_keepScreenOverlay ( ecs::Registry & registry,
bool hostStill )

Asked after begin (and the layers): true, and the pass draws what the overlay already holds - submit nothing until end. hostStill is the host's word that the geometry it adds itself is what it was.

See also
RenderFrame::keepScreenOverlay

Definition at line 954 of file RendererBindings.cpp.

References ctx(), ensureTransformsUpdated(), g_renderFrame, screenDomain(), and uiTreeLayers().

◆ renderer_lightStatus()

i32 esengine::renderer_lightStatus ( u32 entity,
uintptr_t outPtr )

What the light cap did to entity last frame, into nine floats at outPtr: accepted, refusal, limit, requested, refusedCount, then whether a light cast the environment's sun and the aim it took.

Returns 0 before any frame has collected lights, which is not a frame that refused none.

Definition at line 1674 of file RendererBindings.cpp.

References boundarySpanMut(), esengine::LightCapReport::environmentSun, esengine::LightCapReport::environmentSunAim, esengine::Entity::fromRaw(), g_renderFrame, esengine::LightCapReport::limit, None, esengine::LightCapReport::refusalFor(), esengine::LightCapReport::refused, and esengine::LightCapReport::requested.

◆ renderer_lodInspect()

i32 esengine::renderer_lodInspect ( u32 view,
u32 entity,
uintptr_t outPtr )

What view decided about entity's LOD, into four floats at outPtr: level, the level the bare thresholds ask for, how many stand-ins are reachable, and the screen size measured.

A level of -1 is culled. Returns 0 when this view has not measured the entity, which is not level 0 and must not be shown as one.

Definition at line 1586 of file RendererBindings.cpp.

References boundarySpanMut(), esengine::Entity::fromRaw(), g_renderFrame, and esengine::lod::kCulled.

◆ renderer_materialBakeState()

i32 esengine::renderer_materialBakeState ( u32 ticket)

0 waiting, 1 drawn, -1 not drawable; a drawn or failed ticket is forgotten once asked.

Definition at line 1161 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_pollFrameCapture()

i32 esengine::renderer_pollFrameCapture ( u32 handle)

0 = pending (step a frame, poll again), 1 = ready, 2 = failed/unknown.

Definition at line 2025 of file RendererBindings.cpp.

References g_device, Pending, and Ready.

◆ renderer_pollPreviewReadback()

i32 esengine::renderer_pollPreviewReadback ( )

Definition at line 2278 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_pollProbeCapture()

i32 esengine::renderer_pollProbeCapture ( )

0 = not yet, 1 = ready to take, 2 = none asked for or it failed. Between frames only.

Definition at line 1625 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_pollSkeletalPreview()

i32 esengine::renderer_pollSkeletalPreview ( u32 preview)

Definition at line 2102 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_pollSnapshotReadback()

i32 esengine::renderer_pollSnapshotReadback ( )

Definition at line 1939 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_programEpoch()

f64 esengine::renderer_programEpoch ( )

The renderer's current program-readiness epoch. A readiness record stamped with an older one names programs that may be gone.

Definition at line 1392 of file RendererBindings.cpp.

References ctx().

◆ renderer_projectMaterialBake()

bool esengine::renderer_projectMaterialBake ( u32 ticket,
u32 material,
u32 target,
u32 instances )

Attach an additive, instanced projection to the just-queued material bake. Both run before the scene.

Definition at line 1157 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_queueMaterialBake()

u32 esengine::renderer_queueMaterialBake ( u32 material,
u32 shader,
u32 target,
u32 x,
u32 y,
u32 w,
u32 h,
f32 a0,
f32 a1,
f32 a2,
f32 a3,
f32 b0,
f32 b1,
f32 b2,
f32 b3 )

Draws a material through a PostProcess shader into a rect of a render target before the next scene (RenderFrame::queueMaterialBake); a0..a3 and b0..b3 are the shader's u_bakeA and u_bakeB. The ticket for renderer_materialBakeState.

Definition at line 1151 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_releaseTarget()

void esengine::renderer_releaseTarget ( u32 handle)

Definition at line 1139 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_renderMaterialPreview()

◆ renderer_renderMeshPreview()

void esengine::renderer_renderMeshPreview ( u32 meshId,
i32 w,
i32 h )

A thumbnail of a loaded mesh, into the same offscreen target the material preview uses and by the same route (a throwaway scene through the real collect path) — so a thumbnail shows what the viewport would. The eye stands off-axis because a model seen head-on is a silhouette.

Definition at line 2227 of file RendererBindings.cpp.

References esengine::ecs::Registry::create(), ctx(), esengine::ecs::Directional, esengine::ecs::Registry::emplace(), g_renderFrame, g_transformSystem, esengine::math::ortho(), esengine::ecs::Transform::position, esengine::EstellaContext::services(), and esengine::EstellaContext::tryGet().

◆ renderer_renderSkeletalPreview()

i32 esengine::renderer_renderSkeletalPreview ( u32 preview,
uintptr_t viewProjectionPtr )

Definition at line 2093 of file RendererBindings.cpp.

References boundarySpan(), and g_renderFrame.

◆ renderer_replayToDrawCall()

void esengine::renderer_replayToDrawCall ( i32 drawCallIndex)

Definition at line 1928 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_requestProbeCapture()

void esengine::renderer_requestProbeCapture ( f32 x,
f32 y,
f32 z,
u32 face )

Capture the scene around (x, y, z) into six face-pixel faces, one a frame (RenderFrame::requestProbeCapture).

Definition at line 1621 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_resize()

void esengine::renderer_resize ( u32 width,
u32 height )

◆ renderer_retainedTextBatch()

void esengine::renderer_retainedTextBatch ( u32 entity,
uintptr_t verticesPtr,
i32 vertexCount,
uintptr_t indicesPtr,
i32 indexCount,
u32 pageId,
i32 glyphMode )

One batch of glyph quads of the entity begun last: TEXT_VERTEX_FLOATS floats a vertex, whole quads, drawn from atlas page pageId and read as glyphMode says (TextGlyphMode; 0 is a plain RGBA page, 1 a distance field).

Definition at line 250 of file RendererBindings.cpp.

References boundarySpan(), g_initialized, g_renderFrame, TEXT_VERTEX_FLOATS, and textGlyphModeFromRaw().

◆ renderer_retainedTextBegin()

void esengine::renderer_retainedTextBegin ( u32 entity,
i32 sdf,
i32 screen,
i32 hasBox,
i32 layer,
f32 boxWidth,
f32 boxHeight,
i32 autoKind )

Starts (or replaces) an entity's retained text: the layout's domain, box and order, with its batches to follow. autoKind says the glyph pipeline (sdf) was picked from the entity's world scale, which the engine then watches in place of the script.

Definition at line 243 of file RendererBindings.cpp.

References g_initialized, and g_renderFrame.

◆ renderer_retainedTextClear()

void esengine::renderer_retainedTextClear ( u32 entity)

Forgets an entity's retained text.

Definition at line 262 of file RendererBindings.cpp.

References g_initialized, and g_renderFrame.

◆ renderer_retainedTextStale()

i32 esengine::renderer_retainedTextStale ( ecs::Registry & registry,
uintptr_t outPtr,
i32 capacity )

The entities whose retained text no longer matches the world, written to outPtr as u32s.

Stale means the entity's domain or box is not the one it was laid out for, or its world scale now picks the other glyph pipeline. An entity that is gone is dropped here and not reported.

Returns
How many were written, at most capacity.

Definition at line 267 of file RendererBindings.cpp.

References boundarySpanMut(), ctx(), esengine::Entity::fromRaw(), g_initialized, g_renderFrame, retainedTextAutoIsSdf(), esengine::ecs::Registry::tryGet(), esengine::EstellaContext::tryGet(), and esengine::ecs::Registry::valid().

◆ renderer_retainedTextSubmit()

void esengine::renderer_retainedTextSubmit ( ecs::Registry & registry,
i32 screen,
uintptr_t projectionPtr )

Submits every retained label of one domain into the open list: its matrix, order, opacity and cull bit read off the entity, its quads clipped against projectionPtr (16 floats; 0 for no clipping).

Definition at line 299 of file RendererBindings.cpp.

References boundarySpan(), g_initialized, and g_renderFrame.

◆ renderer_setAsyncComputeEnabled()

void esengine::renderer_setAsyncComputeEnabled ( bool enabled)

Permit compute jobs to overlap independent graphics passes on a capable native device.

Definition at line 1411 of file RendererBindings.cpp.

References g_device.

◆ renderer_setAsyncShaderCompile()

void esengine::renderer_setAsyncShaderCompile ( bool on)

Draws whose shader the browser is still compiling are left out, not waited for: a frame never stops for a compile, and what needs the shader appears when it is done (several at once compile side by side, which the waiting form never gives them). Off (the default) is a frame that waits.

Definition at line 1554 of file RendererBindings.cpp.

References g_device.

◆ renderer_setClearColor()

void esengine::renderer_setClearColor ( f32 r,
f32 g,
f32 b,
f32 a )

◆ renderer_setColorSpace()

void esengine::renderer_setColorSpace ( u32 linear)

Project colorSpace: 1 = linear-light rendering (set before shaders compile).

Definition at line 1710 of file RendererBindings.cpp.

References g_renderFrame, and esengine::resource::ShaderParser::setLinearColorSpace().

◆ renderer_setCullingMask()

void esengine::renderer_setCullingMask ( u32 mask)

Sorting layers the next collect draws (bit i = layer i). Set per camera.

Definition at line 1564 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setDepthLayers()

void esengine::renderer_setDepthLayers ( u32 mask)

2.5D opt-in: bit i ⇒ layer i resolves by real depth. Same shape as y-sort.

Definition at line 1465 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setDepthPrepass()

void esengine::renderer_setDepthPrepass ( bool on)

Definition at line 1520 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setEntityDrawOrder()

void esengine::renderer_setEntityDrawOrder ( ecs::Registry & registry,
uintptr_t entitiesPtr,
u32 count )

◆ renderer_setImpostorAtlas()

void esengine::renderer_setImpostorAtlas ( u32 entity,
u32 texture,
u32 frames )

Hand entity's Impostor the atlas it draws from: texture holds frames x frames pictures.

A zero texture takes it away, and the mesh is drawn as itself at any size.

Definition at line 1610 of file RendererBindings.cpp.

References esengine::Entity::fromRaw(), and g_renderFrame.

◆ renderer_setLightingDirect()

void esengine::renderer_setLightingDirect ( bool on)

Definition at line 1516 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setLodDistanceScale()

void esengine::renderer_setLodDistanceScale ( f32 scale)

Definition at line 1542 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setLodPreview()

void esengine::renderer_setLodPreview ( u32 view,
u32 entity,
i32 level )

Draw level for entity in view instead of the chosen one; a negative level goes back to the view's own choice.

Definition at line 1615 of file RendererBindings.cpp.

References esengine::Entity::fromRaw(), and g_renderFrame.

◆ renderer_setMeshEdgeBuffers()

void esengine::renderer_setMeshEdgeBuffers ( bool enabled)

Give meshes realized from now on an edge buffer, for a wireframe view.

A second index buffer per mesh, so off unless an editor asks, and asked BEFORE the assets load: a mesh realized earlier has none and is drawn filled instead.

Definition at line 1670 of file RendererBindings.cpp.

References ctx().

◆ renderer_setOcclusionGridSize()

void esengine::renderer_setOcclusionGridSize ( u32 size)

Definition at line 1546 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setOrigin()

void esengine::renderer_setOrigin ( f64 x,
f64 y,
f64 z )

The point the next frames are drawn relative to (RenderOrigin.hpp); the view-projection they are begun with is built for the same one.

Definition at line 827 of file RendererBindings.cpp.

References setRenderOrigin().

◆ renderer_setParallaxAnchor()

void esengine::renderer_setParallaxAnchor ( bool set,
f64 x,
f64 y )

Where parallax layers are measured from in the next frames (RenderTypePlugin.hpp's ParallaxAnchor): a world point when set, or the drawing camera's own centre when not, which is what a game wants. The editor's view sets it.

Definition at line 833 of file RendererBindings.cpp.

References parallaxAnchor().

◆ renderer_setParticleDepthGrid()

void esengine::renderer_setParticleDepthGrid ( u32 texels)

Definition at line 1486 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setPlanarReflectionQuality()

void esengine::renderer_setPlanarReflectionQuality ( f32 scale,
u32 maxSize,
f32 updatesPerSecond,
bool capAuthored )

Definition at line 1482 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setPreviewOrbit()

void esengine::renderer_setPreviewOrbit ( f32 yawDegrees,
f32 pitchDegrees )

The angle the next mesh or material preview is seen from, degrees: yaw about up, pitch above the horizon.

Definition at line 2150 of file RendererBindings.cpp.

◆ renderer_setProbesPerPixel()

void esengine::renderer_setProbesPerPixel ( bool on)

Whether meshes read their probe volume per pixel (true, the default) or per object, holding no probe atlas.

Definition at line 1524 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setProbeVolumeOverride()

void esengine::renderer_setProbeVolumeOverride ( u32 entity,
u32 volumeHandle )

The grid the volume on entity reads instead of its own (a capture's); 0 stops.

Definition at line 1641 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setProbeVolumeReflection()

void esengine::renderer_setProbeVolumeReflection ( u32 entity,
u32 environmentHandle,
u32 slot )

The volume on entity reflects column slot of environmentHandle (an atlas of captures, column 0 the sky); 0 stops.

Definition at line 1637 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setQualityBudgets()

void esengine::renderer_setQualityBudgets ( u32 atlasSize,
u32 cellSize,
u32 cascades,
u32 particleLimit )

Definition at line 1458 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setQualityConstants()

void esengine::renderer_setQualityConstants ( f32 x,
f32 y,
f32 z,
f32 w )

Definition at line 1496 of file RendererBindings.cpp.

References ctx().

◆ renderer_setQualityValue()

bool esengine::renderer_setQualityValue ( const std::string & name,
f32 value )

Definition at line 1512 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setRetainedTextCollected()

void esengine::renderer_setRetainedTextCollected ( bool collected)

The frame draws the retained labels in its own collects from now on, and renderer_retainedTextSubmit draws nothing.

Definition at line 306 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setScreenOverlayEffect()

void esengine::renderer_setScreenOverlayEffect ( u32 material)

Definition at line 965 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setShadow2DSoftSamples()

void esengine::renderer_setShadow2DSoftSamples ( u32 samples)

Definition at line 1508 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setShadowDistance()

void esengine::renderer_setShadowDistance ( f32 distance)

Definition at line 1504 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setSkinCache()

void esengine::renderer_setSkinCache ( i32 enabled,
i32 behavior,
f32 maxMegabytes )

The project's skin cache: on or off, which meshes go through it when their MeshSkin says Auto (0 every one, 1 only those that say Enabled), and the memory it may hold in megabytes. A device without compute poses every skin in the vertex stage.

Definition at line 1423 of file RendererBindings.cpp.

References esengine::SkinCacheSettings::behavior, esengine::SkinCacheSettings::enabled, Exclusive, g_renderFrame, Inclusive, and esengine::SkinCacheSettings::maxMegabytes.

◆ renderer_setSkyEnvironment()

void esengine::renderer_setSkyEnvironment ( u32 environmentHandle)

The environment the sky lights the scene with, 0 for none: an Ambient light that names no environment of its own lights with it (the Sky Atmosphere's Light the Scene).

Definition at line 621 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setStage()

void esengine::renderer_setStage ( i32 stage)

Definition at line 1120 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setTargetPoolIdleBudget()

void esengine::renderer_setTargetPoolIdleBudget ( u32 megabytes)

Definition at line 1550 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setTextureParams()

void esengine::renderer_setTextureParams ( u32 textureId,
i32 minFilter,
i32 magFilter,
i32 wrapS,
i32 wrapT )

Definition at line 2298 of file RendererBindings.cpp.

References g_device.

◆ renderer_setTreeSortLayers()

void esengine::renderer_setTreeSortLayers ( u32 mask)

Definition at line 1452 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setViewId()

void esengine::renderer_setViewId ( u32 view)

Names the view the next collect looks from, which its LOD levels are remembered under. Set per camera, before renderer_submitAll; 0 = the shared default view.

Definition at line 1570 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setViewLighting()

void esengine::renderer_setViewLighting ( u32 mode,
f32 rotationDegrees,
f32 keyIntensity,
f32 fillIntensity,
f32 skyIntensity,
bool showSky )

The editor view's lighting. mode 0 = the scene's own lights (the default, and the only one a packaged build ever has); 1 = studio: a neutral sky, a key and a fill, in their place. View state — nothing here is saved with a scene.

Definition at line 1469 of file RendererBindings.cpp.

References esengine::RenderFrame::ViewLighting::fillIntensity, g_renderFrame, esengine::RenderFrame::ViewLighting::keyIntensity, esengine::RenderFrame::ViewLighting::rotation, esengine::RenderFrame::ViewLighting::showSky, esengine::RenderFrame::ViewLighting::skyIntensity, and esengine::RenderFrame::ViewLighting::studio.

◆ renderer_setViewport()

void esengine::renderer_setViewport ( i32 x,
i32 y,
i32 w,
i32 h )

Definition at line 1407 of file RendererBindings.cpp.

References g_device.

◆ renderer_setViewSelection()

void esengine::renderer_setViewSelection ( u32 view,
uintptr_t idsPtr,
u32 count )

The editor's selection in view, outlined on screen: count entity ids at idsPtr; zero clears it.

Definition at line 1658 of file RendererBindings.cpp.

References boundarySpan(), and g_renderFrame.

◆ renderer_setViewShading()

void esengine::renderer_setViewShading ( u32 view,
i32 mode )

Shade a view's meshes as authored (0), as neutral clay (1), as flat albedo (2), as wireframe (3), or as clay lit by the lights alone (4) or by everything that is not a light (5).

View state, like the LOD preview beside it: the same scene drawn through another view keeps its own look. Out-of-range modes mean authored.

Definition at line 1649 of file RendererBindings.cpp.

References g_renderFrame, kShadingModeCount, and Shaded.

◆ renderer_setViewSkinWeights()

void esengine::renderer_setViewSkinWeights ( u32 view,
u32 entity,
i32 joint )

Colour one skinned entity in a view by how much a joint moves each vertex.

joint indexes the mesh's own bind matrices, the order its Joints channel uses; a negative joint goes back to no entity. A view that is not the editor's never asks.

Definition at line 1664 of file RendererBindings.cpp.

References esengine::Entity::fromRaw(), g_renderFrame, and INVALID_ENTITY.

◆ renderer_setWorldUnitsPerMeter()

void esengine::renderer_setWorldUnitsPerMeter ( f32 units)

How many world units make a metre: what an inverse-square light measures distance in.

Definition at line 1645 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_setYSortLayers()

void esengine::renderer_setYSortLayers ( u32 mask)

Definition at line 1448 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_shadowStatus()

i32 esengine::renderer_shadowStatus ( u32 entity,
uintptr_t outPtr )

What the shadow atlas gave entity last frame, into five floats at outPtr: requested, granted, refusal, deniedCasters, reducedCasters.

granted below requested and above zero is a REDUCTION — a sun that kept two cascades of four still casts. Zero is a denial. Returns 0 when this entity asked the atlas for nothing.

Definition at line 1694 of file RendererBindings.cpp.

References boundarySpanMut(), esengine::ShadowPlanReport::deniedCasters(), esengine::Entity::fromRaw(), g_renderFrame, esengine::ShadowGrant::granted, esengine::ShadowPlanReport::grantFor(), esengine::ShadowPlanReport::reducedCasters(), esengine::ShadowGrant::refusal, and esengine::ShadowGrant::requested.

◆ renderer_snapshotMatchesCapture()

bool esengine::renderer_snapshotMatchesCapture ( )

Definition at line 1935 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_submitAll()

void esengine::renderer_submitAll ( ecs::Registry & registry,
i32 vpX,
i32 vpY,
i32 vpW,
i32 vpH )

◆ renderer_submitScreenOverlay()

void esengine::renderer_submitScreenOverlay ( ecs::Registry & registry)

◆ renderer_submitSkeletalBatchByEntity()

void esengine::renderer_submitSkeletalBatchByEntity ( ecs::Registry & registry,
uintptr_t verticesPtr,
i32 vertexCount,
uintptr_t indicesPtr,
i32 indexCount,
u32 textureId,
i32 blendMode,
u32 entity,
f32 skelScale,
bool flipX,
bool flipY,
i32 layer,
f32 depth,
u32 materialId )

Definition at line 113 of file RendererBindings.cpp.

References renderer_submitSkeletalBatchByEntityEx().

◆ renderer_submitSkeletalBatchByEntityEx()

void esengine::renderer_submitSkeletalBatchByEntityEx ( ecs::Registry & registry,
uintptr_t verticesPtr,
i32 vertexCount,
uintptr_t indicesPtr,
i32 indexCount,
u32 textureId,
i32 blendMode,
u32 entity,
f32 skelScale,
bool flipX,
bool flipY,
i32 layer,
f32 depth,
u32 materialId,
bool premultipliedColor )

◆ renderer_submitSkeletalPreviewBatch()

i32 esengine::renderer_submitSkeletalPreviewBatch ( u32 preview,
uintptr_t verticesPtr,
i32 vertexCount,
uintptr_t indicesPtr,
i32 indexCount,
u32 textureId,
i32 blendMode,
uintptr_t transformPtr,
i32 layer,
f32 depth,
u32 materialId )

Definition at line 2062 of file RendererBindings.cpp.

References renderer_submitSkeletalPreviewBatchEx().

◆ renderer_submitSkeletalPreviewBatchEx()

i32 esengine::renderer_submitSkeletalPreviewBatchEx ( u32 preview,
uintptr_t verticesPtr,
i32 vertexCount,
uintptr_t indicesPtr,
i32 indexCount,
u32 textureId,
i32 blendMode,
uintptr_t transformPtr,
i32 layer,
f32 depth,
u32 materialId,
bool premultipliedColor )

Definition at line 2072 of file RendererBindings.cpp.

References boundarySpan(), and g_renderFrame.

Referenced by renderer_submitSkeletalPreviewBatch().

◆ renderer_submitTextBatch()

void esengine::renderer_submitTextBatch ( uintptr_t verticesPtr,
i32 vertexCount,
uintptr_t indicesPtr,
i32 indexCount,
u32 textureId,
uintptr_t transformPtr,
u32 entity,
i32 layer,
f32 depth,
i32 glyphMode,
u32 cullBit )

◆ renderer_supportsAsyncCompute()

bool esengine::renderer_supportsAsyncCompute ( )

Definition at line 1419 of file RendererBindings.cpp.

References g_device.

◆ renderer_takeFrameCapture()

bool esengine::renderer_takeFrameCapture ( u32 handle,
uintptr_t dest,
u32 destSize )

Copies a ready capture into dest (w*h*4 bytes, bottom-up RGBA) and releases it.

Always RGBA: a surface may be BGRA (which is what a canvas usually prefers, and configuring anything else costs a copy per present), and every consumer of this reads channels by index.

Definition at line 2042 of file RendererBindings.cpp.

References g_device.

◆ renderer_takeProbeCapture()

bool esengine::renderer_takeProbeCapture ( uintptr_t dst,
u32 bytes )

Copies the capture (six faces side by side, RGBM RGBA8, rows bottom-up) to dst; false when it does not fit or is not ready.

Definition at line 1629 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_takeTargetCapture()

bool esengine::renderer_takeTargetCapture ( u32 handle,
uintptr_t dest,
u32 destSize )

Copies a ready target capture into dest (w*h*4 bytes, bottom-up RGBA) and releases it.

Definition at line 2017 of file RendererBindings.cpp.

References g_device.

◆ renderer_takeTextureWants()

std::string esengine::renderer_takeTextureWants ( )

What size each texture was asked for since the last call, as handle:side pairs joined by commas, and the record starts again.

side is the texels across a view needs for a texel to be about a pixel where it drew a mesh with that texture (texture streaming reads it). Empty when nothing was drawn with a mesh texture.

Definition at line 1605 of file RendererBindings.cpp.

References g_renderFrame.

◆ renderer_updateTransforms()

void esengine::renderer_updateTransforms ( ecs::Registry & registry)

Definition at line 911 of file RendererBindings.cpp.

References ensureTransformsUpdated().

◆ renderOrigin()

◆ renderThread_bootStatus()

i32 esengine::renderThread_bootStatus ( )

Definition at line 375 of file WebSDKEntry.cpp.

References threadedBoot.

Referenced by EMSCRIPTEN_BINDINGS().

◆ renderThread_complete()

bool esengine::renderThread_complete ( f64 fence)

◆ renderThread_enabled()

bool esengine::renderThread_enabled ( )

◆ renderThread_fence()

f64 esengine::renderThread_fence ( )

◆ renderThread_flush()

void esengine::renderThread_flush ( )

◆ renderThread_resizeSurface()

void esengine::renderThread_resizeSurface ( u32 width,
u32 height )

◆ resolveSpriteDraw()

SpriteDrawChoice esengine::resolveSpriteDraw ( ecs::SpriteDrawMode mode,
bool hasTileSize,
bool hasSliceBorder )
constexpr

Resolve the geometry from the author's mode and what the data offers.

Under Auto a tileSize outranks a slice border, because a tileSize is only ever set deliberately. A named mode overrides the inference but cannot invent data: Tiled with no tileSize and NineSlice with no border draw the plain quad.

Definition at line 31 of file SpriteDrawResolve.hpp.

References esengine::ecs::Auto, esengine::ecs::NineSlice, esengine::ecs::Simple, and esengine::ecs::Tiled.

Referenced by esengine::SpritePlugin::collect().

◆ retainedTextAutoIsSdf()

bool esengine::retainedTextAutoIsSdf ( f32 worldScaleX)
inline

Which glyph pipeline a label of automatic render mode draws with at a world scale: hinted bitmaps while the scale is within 2% of 1:1, SDF past it. The same rule, in the same precision, as resolveTextRenderMode in sdk/src/ui/text/plugin.ts. True for SDF.

Definition at line 132 of file RetainedText.hpp.

Referenced by renderer_retainedTextStale().

◆ retainedTextClassify()

int esengine::retainedTextClassify ( const double * planes,
double left,
double bottom,
double right,
double top )
inline

0 outside, 1 inside, 2 crossing a clip plane. Non-finite bounds stay visible.

Definition at line 169 of file RetainedText.hpp.

Referenced by retainedTextClip().

◆ retainedTextClip()

◆ retainedTextClipPlanes()

bool esengine::retainedTextClipPlanes ( double * out,
const f32 * view,
const f32 * model )
inline

Six clip planes on the glyph's local z=0 plane, each with three coefficients and three rounding-error weights: 36 doubles. False for a view or model matrix with a non-finite entry. Near uses -w, which stays conservative for both OpenGL and zero-to-one depth.

Definition at line 145 of file RetainedText.hpp.

Referenced by esengine::RenderFrame::submitRetainedText().

◆ rewriteLooseUniforms()

DrawParamsRewrite esengine::rewriteLooseUniforms ( const std::string & vertexSrc,
const std::string & fragmentSrc )

Lifts loose non-sampler uniform declarations out of both stages into one shared std140 DrawParams block.

Handles single-declarator float/int/vec2/vec3/vec4/mat3/mat4 declarations (optional precision qualifier); arrays, initializers, multi-declarator lines, samplers and struct types stay loose and untouched. Both stages share ONE block definition (GLSL requires identical redeclarations), inserted where each stage's first lifted declaration was. Returns the inputs unchanged when nothing lifts, when the same name is declared with two types, or when the source already mentions the DrawParams block name.

Definition at line 160 of file DrawParams.cpp.

References esengine::DrawParamsLayout::blockSize, DRAW_PARAMS_BLOCK, drawParamSizeAlign(), esengine::DrawParamsRewrite::fragmentSrc, esengine::DrawParamsRewrite::layout, esengine::DrawParamsLayout::slots, and esengine::DrawParamsRewrite::vertexSrc.

Referenced by esengine::resource::ResourceManager::createShader().

◆ ribbonSide()

glm::vec3 esengine::ribbonSide ( const glm::vec3 & tangent,
const glm::vec3 & worldPos,
const CameraView & camera,
const glm::vec3 & lastSide )
inline

The side vector a ribbon widens along: perpendicular to both its path and the viewer, so the strip faces the eye instead of lying in one plane.

lastSide carries a segment aimed straight at the viewer — no width it could see, so no side of its own. Flat scenes are the degenerate case: the eye direction is +Z and this reduces to the XY perpendicular.

Definition at line 476 of file RenderTypePlugin.hpp.

References towardViewer().

Referenced by esengine::ParticlePlugin::collect(), and esengine::TrailPlugin::collect().

◆ rm_acquireTextureByPath()

u32 esengine::rm_acquireTextureByPath ( resource::ResourceManager & rm,
const std::string & path )

◆ rm_adoptTextureContent()

bool esengine::rm_adoptTextureContent ( resource::ResourceManager & rm,
u32 target,
u32 source )

Moves a freshly loaded texture's pixels behind an owed handle.

Definition at line 167 of file ResourceManagerBindings.cpp.

References esengine::resource::ResourceManager::adoptTextureContent().

◆ rm_createCompressedTexture()

u32 esengine::rm_createCompressedTexture ( resource::ResourceManager & rm,
u32 width,
u32 height,
i32 format,
uintptr_t dataPtr,
u32 dataLen,
u32 mipLevels,
u32 content )

Uploads pre-transcoded blocks (level 0 first) as one compressed texture.

Uploads pre-transcoded blocks as one compressed texture.

Definition at line 126 of file ResourceManagerBindings.cpp.

References boundarySpan(), esengine::resource::ResourceManager::createCompressedTexture(), esengine::resource::Handle< T >::id(), and S3TC_DXT5_SRGB.

◆ rm_createShader()

u32 esengine::rm_createShader ( resource::ResourceManager & rm,
const std::string & vertSrc,
const std::string & fragSrc )

◆ rm_createTexture()

u32 esengine::rm_createTexture ( resource::ResourceManager & rm,
u32 width,
u32 height,
uintptr_t pixelsPtr,
u32 pixelsLen,
i32 format,
bool flipY,
u32 content )

A texture's content is a resource::ResourceContent: who refills it after a device loss.

Definition at line 53 of file ResourceManagerBindings.cpp.

References boundarySpan(), esengine::resource::ResourceManager::createTexture(), and esengine::resource::Handle< T >::id().

◆ rm_createTextureArray()

u32 esengine::rm_createTextureArray ( resource::ResourceManager & rm,
u32 width,
u32 height,
u32 layers,
uintptr_t pixelsPtr,
u32 pixelsLen,
i32 format,
i32 filterMode,
i32 wrapMode,
u32 content )

A 2D texture array of layers RGBA8 layers, pixelsLen bytes of them back to back. filterMode and wrapMode are createTextureEx's codes; there is no flipY, the layers are taken in the rows given.

Definition at line 97 of file ResourceManagerBindings.cpp.

References boundarySpan(), esengine::resource::ResourceManager::createTextureArray(), esengine::TextureSpecification::format, esengine::TextureSpecification::height, esengine::resource::Handle< T >::id(), esengine::TextureSpecification::layers, RGBA8, SRGB8A8, and esengine::TextureSpecification::width.

◆ rm_createTextureEx()

◆ rm_forgoTextureContent()

void esengine::rm_forgoTextureContent ( resource::ResourceManager & rm,
u32 handle )

Gives up on an owed texture's content; it keeps blank storage.

Definition at line 155 of file ResourceManagerBindings.cpp.

References esengine::resource::ResourceManager::forgoTextureContent().

◆ rm_getShaderRefCount()

u32 esengine::rm_getShaderRefCount ( resource::ResourceManager & rm,
u32 handleId )

◆ rm_getTextureGLId()

u32 esengine::rm_getTextureGLId ( resource::ResourceManager & rm,
u32 handleId )

◆ rm_getTextureNativeId()

u32 esengine::rm_getTextureNativeId ( resource::ResourceManager & rm,
u32 handle )

◆ rm_getTextureRefCount()

u32 esengine::rm_getTextureRefCount ( resource::ResourceManager & rm,
u32 handleId )

◆ rm_invalidateTexturePath()

bool esengine::rm_invalidateTexturePath ( resource::ResourceManager & rm,
const std::string & path )

◆ rm_meshesAwaitingRemat()

std::string esengine::rm_meshesAwaitingRemat ( resource::ResourceManager & rm)

Replayable meshes still owed their geometry, as comma-separated handle ids. No path: the engine never knew one, and the asset layer holds it.

Definition at line 186 of file ResourceManagerBindings.cpp.

References esengine::resource::ResourceManager::meshesAwaitingRematerialization().

◆ rm_meshRealizations()

std::string esengine::rm_meshRealizations ( resource::ResourceManager & rm)

Every live mesh as handle:realized.

Definition at line 195 of file ResourceManagerBindings.cpp.

References esengine::resource::ResourceManager::meshRealizations().

◆ rm_registerExternalTexture()

u32 esengine::rm_registerExternalTexture ( resource::ResourceManager & rm,
u32 glTextureId,
u32 width,
u32 height,
u32 content )

◆ rm_registerExternalTextureSized()

u32 esengine::rm_registerExternalTextureSized ( resource::ResourceManager & rm,
u32 glTextureId,
u32 width,
u32 height,
u32 bytes,
u32 content )

◆ rm_registerTextureWithPath()

void esengine::rm_registerTextureWithPath ( resource::ResourceManager & rm,
u32 handleId,
const std::string & path )

◆ rm_releaseShader()

void esengine::rm_releaseShader ( resource::ResourceManager & rm,
u32 handleId )

◆ rm_releaseTexture()

void esengine::rm_releaseTexture ( resource::ResourceManager & rm,
u32 handleId )

◆ rm_restoreTextureContent()

void esengine::rm_restoreTextureContent ( resource::ResourceManager & rm,
u32 handle )

◆ rm_setRetainedBudget()

void esengine::rm_setRetainedBudget ( resource::ResourceManager & rm,
u32 bytes )

◆ rm_setTextureBudget()

void esengine::rm_setTextureBudget ( resource::ResourceManager & rm,
u32 bytes )

◆ rm_setTextureMetadata()

◆ rm_supportsCompressedFormat()

bool esengine::rm_supportsCompressedFormat ( resource::ResourceManager & rm,
i32 format )

Whether the ACTIVE backend can sample this compressed format — the question WebGL extensions answer for one backend only, and answer with "none" for the other, which arrives as a texture that never loaded.

Whether the active backend samples this compressed format.

Definition at line 118 of file ResourceManagerBindings.cpp.

References esengine::resource::ResourceManager::device(), S3TC_DXT5_SRGB, and esengine::GfxDevice::supportsCompressedFormat().

◆ rm_texturesAwaitingReupload()

std::string esengine::rm_texturesAwaitingReupload ( resource::ResourceManager & rm)

The textures the device is waiting for content for, as handle|content|path lines.

Definition at line 171 of file ResourceManagerBindings.cpp.

References esengine::resource::ResourceManager::getTexturePath(), and esengine::resource::ResourceManager::texturesAwaitingReupload().

◆ rm_trimTextureCache()

u32 esengine::rm_trimTextureCache ( resource::ResourceManager & rm)

◆ rm_updateTextureSubregion()

void esengine::rm_updateTextureSubregion ( resource::ResourceManager & rm,
u32 handleId,
u32 x,
u32 y,
u32 width,
u32 height,
uintptr_t pixelsPtr,
u32 pixelsLen )

◆ rm_wrapDeviceTexture()

u32 esengine::rm_wrapDeviceTexture ( resource::ResourceManager & rm,
u32 textureId,
u32 width,
u32 height )

A resource handle for a device texture another owner keeps (a render target's colour).

Definition at line 151 of file ResourceManagerBindings.cpp.

References esengine::resource::ResourceManager::wrapDeviceTexture().

◆ rotatePoint()

glm::vec3 esengine::rotatePoint ( const glm::vec3 & center,
f32 px,
f32 py,
f32 cosA,
f32 sinA )
inline

Rotates a point around center in the XY plane, carrying the center's z through untouched — the rotation a 2D renderer means is about z.

Definition at line 67 of file BatchBuilder.hpp.

Referenced by esengine::BatchPlugin::emitNineSlice(), and esengine::BatchPlugin::emitRadialFill().

◆ samplerBindingForUnit()

u32 esengine::samplerBindingForUnit ( u32 unit)
inlineconstexpr

Group-1 binding of a texture unit's sampler (see textureBindingForUnit).

Definition at line 32 of file WgslBindings.hpp.

Referenced by esengine::WebGPUDevice::backendCreateProgram().

◆ scanWGSLBindingMask()

u64 esengine::scanWGSLBindingMask ( const char * source,
u32 group )
inline

Bit mask of the @group(N) @binding(i) indices a WGSL source declares.

Declarations drive the backend's EXPLICIT bind-group layouts: every declared binding gets a layout entry and a bound resource (or a dummy backfill), so a declared-but-unused binding is as legal as it is in GLSL. Bindings >= 64 are ignored.

Definition at line 44 of file WgslBindings.hpp.

Referenced by esengine::WebGPUDevice::backendCreateProgram().

◆ scanWGSLReachedUnits()

void esengine::scanWGSLReachedUnits ( const char * source,
u32 & textures,
u32 & samplers )
inline

The tN / sN names a WGSL source REACHES, by unit.

The other half of the question scanWGSLBindingMask asks: what a stage names, as against what it declares. A name reached and not declared is an unresolved identifier, which WebGPU reports as an invalid PIPELINE with no shader named anywhere in it — so the assembler completes the set instead.

A name the source makes its own is not a unit: let s2, var t0 in a function, a parameter or a field s1 : f32. Three colours kept in s0..s3 once counted as four units read, and a material's eighth texture was told there was no unit left for it. A var after an attribute's ) is a binding's own declaration, which does name the unit.

Definition at line 78 of file WgslBindings.hpp.

References WGSL_MAX_TEXTURE_UNITS.

Referenced by esengine::WebGPUDevice::backendCreateProgram().

◆ screenDomain()

const std::unordered_set< u32 > * esengine::screenDomain ( )
static

The screen's entities, as a membership set the renderer can partition by. Empty when there is no UI system — then every collect is a world one, which is what a project with no Canvas has always had.

Definition at line 934 of file RendererBindings.cpp.

References ctx(), esengine::ecs::UISystem::screenDomain(), and esengine::EstellaContext::tryGet().

Referenced by renderer_keepScreenOverlay(), renderer_submitAll(), and renderer_submitScreenOverlay().

◆ serviceTypeId()

template<typename T>
TypeId esengine::serviceTypeId ( )
inline

◆ setBoundaryRegion()

void esengine::setBoundaryRegion ( uintptr_t base,
usize size )
inline

Declare the region a native host lets JS address (its heap arena).

Called once, when the host reserves the arena. Until then a native build only null/overflow-checks, since there is no bound to check.

Definition at line 70 of file BoundarySpan.hpp.

References esengine::detail::g_boundaryBase, and esengine::detail::g_boundarySize.

◆ setPendingRandomSeed()

void esengine::setPendingRandomSeed ( u32 seed)

A seed set before the engine had a RandomSource to put it in. The SDK sets it beside the colour space — pre-init on purpose, so shaders and spawns both see the run's configuration — and EstellaContext adopts it on creation.

Definition at line 11 of file RandomSource.cpp.

Referenced by engine_setRandomSeed().

◆ setRenderOrigin()

void esengine::setRenderOrigin ( const glm::dvec3 & origin)
inline

Definition at line 25 of file RenderOrigin.hpp.

References renderOrigin().

Referenced by renderer_setOrigin().

◆ shaderDataTypeComponentCount()

u32 esengine::shaderDataTypeComponentCount ( ShaderDataType type)

Gets the component count of a shader data type.

Parameters
typeThe shader data type
Returns
Number of components (e.g., 3 for Float3)

Definition at line 38 of file Buffer.cpp.

References Bool, Float, Float2, Float3, Float4, Int, Int2, Int3, Int4, and UByte4N.

Referenced by esengine::CustomGeometry::init().

◆ shaderDataTypeSize()

u32 esengine::shaderDataTypeSize ( ShaderDataType type)

Gets the size in bytes of a shader data type.

Parameters
typeThe shader data type
Returns
Size in bytes

Definition at line 22 of file Buffer.cpp.

References Bool, Float, Float2, Float3, Float4, Int, Int2, Int3, Int4, and UByte4N.

Referenced by esengine::VertexAttribute::VertexAttribute().

◆ shadesAsClay()

bool esengine::shadesAsClay ( ShadingMode mode)
inline

Whether a mode draws meshes as clay (the lit neutral surface).

Definition at line 45 of file ViewShading.hpp.

References Clay, DirectLighting, and IndirectLighting.

◆ shadowMasksCollide()

bool esengine::shadowMasksCollide ( const ShadowMaskLight & a,
const ShadowMaskLight & b )
inline

Whether two lights cannot share a channel: one reads where the other writes.

Definition at line 33 of file ShadowChannels2D.hpp.

References esengine::ShadowMaskLight::everywhere, esengine::ShadowMaskLight::pos, esengine::ShadowMaskLight::read, and esengine::ShadowMaskLight::write.

Referenced by assignShadowChannels().

◆ shadowUp()

glm::vec3 esengine::shadowUp ( const glm::vec3 & dir)
static

An up that cannot be parallel to dir, whichever way it points.

Definition at line 2292 of file RenderFrame.cpp.

Referenced by coneShadow().

◆ shutdownRenderer()

void esengine::shutdownRenderer ( )

Definition at line 408 of file WebSDKEntry.cpp.

References g_activeContext, and threadedBoot.

Referenced by EMSCRIPTEN_BINDINGS().

◆ sink()

template<typename SignalType>
auto esengine::sink ( SignalType & signal)

Create a sink for a signal.

Parameters
signalThe signal to create a sink for
Returns
Sink object

Definition at line 175 of file Sink.hpp.

Referenced by esengine::Log::addSink(), esengine::ecs::Registry::auditChanges(), esengine::ecs::Registry::onDestroy(), and esengine::DrawList::setShaderRunSink().

◆ splitFraction()

f32 esengine::splitFraction ( u32 i,
u32 count,
f32 nearDist,
f32 farDist,
f32 lambda )
static

Definition at line 2264 of file RenderFrame.cpp.

◆ spotProjection()

glm::mat4 esengine::spotProjection ( f32 fovDegrees,
f32 nearDist,
f32 farDist )
static

The frustum a cone sees, with clip z running [0, 1] over [near, far].

That range is the point: a GL-convention perspective puts half its volume below zero, which the second backend discards. This matrix is free to be built either way — its depths are only compared against a copy of itself.

Definition at line 2279 of file RenderFrame.cpp.

Referenced by coneShadow().

◆ springbone_release()

void esengine::springbone_release ( ecs::Registry & registry,
u32 entity )

Copies a chain's particles for the editor to draw and returns how many (seven floats each; see SpringBoneSystem::snapshot); read them at springbone_snapshotData(). Gives a chain's bones back as the animation had them and forgets its state: what ends a preview.

Definition at line 1094 of file RendererBindings.cpp.

References esengine::Entity::fromRaw(), and g_springBoneSystem.

Referenced by EMSCRIPTEN_BINDINGS().

◆ springbone_reset()

void esengine::springbone_reset ( ecs::Registry & registry,
u32 entity )

Puts a chain back at its animated pose on its next frame (a teleport, a respawn).

Definition at line 1088 of file RendererBindings.cpp.

References esengine::Entity::fromRaw(), and g_springBoneSystem.

Referenced by EMSCRIPTEN_BINDINGS().

◆ springbone_snapshot()

u32 esengine::springbone_snapshot ( ecs::Registry & registry,
u32 entity )

◆ springbone_snapshotCount()

u32 esengine::springbone_snapshotCount ( )

Definition at line 1112 of file RendererBindings.cpp.

References springBoneSnapshot().

Referenced by EMSCRIPTEN_BINDINGS().

◆ springbone_snapshotData()

uintptr_t esengine::springbone_snapshotData ( )

Definition at line 1116 of file RendererBindings.cpp.

References springBoneSnapshot().

Referenced by EMSCRIPTEN_BINDINGS().

◆ springbone_update()

void esengine::springbone_update ( ecs::Registry & registry,
f32 dt )

Advances every SpringBone chain: call after the animation has posed the skeleton, before the frame is drawn.

Definition at line 1083 of file RendererBindings.cpp.

References g_springBoneSystem, and g_transformSystem.

Referenced by EMSCRIPTEN_BINDINGS().

◆ springBoneSnapshot()

std::vector< f32 > & esengine::springBoneSnapshot ( )
static

◆ srgbToLinearCpu()

glm::vec3 esengine::srgbToLinearCpu ( const glm::vec3 & c)

Definition at line 3822 of file RenderFrame.cpp.

◆ stageTextureRows()

void esengine::stageTextureRows ( u8 * dst,
const u8 * src,
u32 width,
u32 height,
u32 srcBpp,
u32 dstBpp,
bool reverseRows )
inline

Stage height rows for a texture upload: reads exactly width * srcBpp bytes per row from src, writes width * dstBpp per row into dst, bottom-up when reverseRows, widening 3-byte pixels to opaque RGBA when the two sizes differ.

Definition at line 29 of file PixelUpload.hpp.

◆ startRenderThread()

bool esengine::startRenderThread ( EstellaContext & context,
const char * canvas = nullptr )
inline

◆ stencilModeOf()

GfxStencilMode esengine::stencilModeOf ( u16 stateFlags)
inline

The stencil mode a draw's state flags mean.

One reading of these bits. Done at the point of use it would be done in each backend's own words, and a mode nobody mapped is a draw that quietly tests the wrong way — which looks like a mask that works everywhere but one path.

Definition at line 41 of file DrawCommand.hpp.

References CMD_STATE_STENCIL_DECREMENT, CMD_STATE_STENCIL_INCREMENT, CMD_STATE_STENCIL_OUT, CMD_STATE_STENCIL_TEST, CMD_STATE_STENCIL_WRITE, CMD_STATE_STENCIL_ZERO, Decrement, Increment, Off, Test, TestOutside, Write, and Zero.

Referenced by esengine::DrawList::execute(), and takesPartInPrepass().

◆ takePendingRandomSeed()

bool esengine::takePendingRandomSeed ( u32 & out)

The pending seed, or nothing when the run was never given one.

Definition at line 16 of file RandomSource.cpp.

◆ takesPartInPrepass()

bool esengine::takesPartInPrepass ( const DrawCommand & cmd)
static

A draw the prepass takes in: opaque and depth-writing, with a program of its own for it, and nothing that changes where it lands (a stencil).

Definition at line 540 of file DrawList.cpp.

References esengine::DrawCommand::depth_shader_id, esengine::DrawCommand::depth_test, esengine::DrawCommand::depth_write, Off, esengine::DrawCommand::state_flags, and stencilModeOf().

Referenced by esengine::DrawList::depthPrepassDraws(), and esengine::DrawList::execute().

◆ textGlyphModeFromRaw()

TextGlyphMode esengine::textGlyphModeFromRaw ( i32 raw)
inline

The mode a raw script-side value names; anything out of range is Color, the draw that cannot be wrong about a page it does not understand.

Definition at line 23 of file TextVertexFormat.hpp.

References Color, and Fill.

Referenced by renderer_retainedTextBatch(), and renderer_submitTextBatch().

◆ textureBindingForUnit()

u32 esengine::textureBindingForUnit ( u32 unit)
inlineconstexpr

Group-1 binding of a texture unit. Units 0-7 are the batch stream and take bindings 0-7; a material's own units start at 8 and take 16 upward, leaving 8-15 for the samplers underneath the first eight.

Definition at line 29 of file WgslBindings.hpp.

Referenced by esengine::WebGPUDevice::backendCreateProgram().

◆ toClipDepthRange()

glm::mat4 esengine::toClipDepthRange ( const glm::mat4 & p,
ClipDepthRange range )
inline

The projection p as a device keeping range wants it.

The engine builds for [-1, 1], so MinusOneToOne returns p itself and such a device is handed the matrix bit for bit. ZeroToOne averages row 2 with row 3, which is that remap written as a matrix; the viewpoint cameraFromViewProjection reads is invariant under it.

Definition at line 75 of file FrameConstants.hpp.

References MinusOneToOne.

Referenced by esengine::RenderFrame::end(), esengine::RenderContext::updateCameraConstants(), and esengine::RenderContext::updateCameraConstants().

◆ towardViewer()

glm::vec3 esengine::towardViewer ( const glm::vec3 & worldPos,
const CameraView & camera )
inline

Decomposes transform and returns its world position shifted toward the camera by (1 - parallax); factor 1 = no shift, 0 = screen-pinned. Applied before the frustum cull so a parallaxed renderable is culled where drawn.

The direction the viewer lies in from worldPos, in CameraView::eye's convention — the eye's own direction orthographically, where every point shares it, and the vector to the eye under perspective.

Definition at line 465 of file RenderTypePlugin.hpp.

References esengine::CameraView::eye.

Referenced by esengine::ParticlePlugin::collect(), ribbonSide(), and esengine::particle::velocityOnScreen().

◆ trail_clear()

void esengine::trail_clear ( ecs::Registry & registry,
u32 entity )

Definition at line 1077 of file RendererBindings.cpp.

References esengine::Entity::fromRaw(), and g_trailSystem.

◆ trail_update()

void esengine::trail_update ( ecs::Registry & registry,
f32 dt )

Definition at line 1070 of file RendererBindings.cpp.

References g_trailSystem.

◆ transform_copyFlatRenderMatrix()

bool esengine::transform_copyFlatRenderMatrix ( ecs::Registry & registry,
u32 entity,
uintptr_t outputPtr )

Copy a drawable entity's complete world matrix to 16 caller-owned floats. False for missing or collapsed geometry; leaves the output unchanged.

Definition at line 152 of file UIBindings.cpp.

References esengine::ecs::copyFlatRenderMatrix(), and esengine::Entity::fromRaw().

Referenced by EMSCRIPTEN_BINDINGS().

◆ transform_update()

void esengine::transform_update ( ecs::Registry & registry)

Compose world transforms now (the UI layout pass reads them).

Definition at line 159 of file UIBindings.cpp.

References ctx(), esengine::EstellaContext::services(), and esengine::ecs::TransformSystem::update().

Referenced by EMSCRIPTEN_BINDINGS().

◆ ui_getCullBit()

u32 esengine::ui_getCullBit ( ecs::Registry & registry,
u32 entity )

Mask bit of the owning Canvas' layer, for Camera.cullingMask. 0 = not a UI node.

Definition at line 115 of file UIBindings.cpp.

References esengine::Entity::fromRaw(), esengine::ecs::Registry::tryGet(), and esengine::ecs::UIVisual::uiCullBit.

◆ ui_getRenderOrder()

i32 esengine::ui_getRenderOrder ( ecs::Registry & registry,
u32 entity )

An entity's UI draw order, so the SDF text path can interleave glyph quads with UI quads. -1 = not a UI node.

Definition at line 108 of file UIBindings.cpp.

References esengine::Entity::fromRaw(), esengine::ecs::Registry::tryGet(), and esengine::ecs::UIVisual::uiOrder.

◆ ui_isScreenDomain()

bool esengine::ui_isScreenDomain ( ecs::Registry & registry,
u32 entity )

Whether entity belongs to the SCREEN rather than to the world.

The same answer the renderer partitions its collects by, asked here because the SDK submits some of the screen's geometry itself — glyph quads — into the list the panel behind them went into.

Definition at line 120 of file UIBindings.cpp.

References ctx(), esengine::ecs::UISystem::isScreenDomain(), and esengine::EstellaContext::tryGet().

◆ uiHitTest_getHitEntity()

u32 esengine::uiHitTest_getHitEntity ( )

Definition at line 65 of file UIBindings.cpp.

References ctx(), and esengine::EstellaContext::require().

◆ uiHitTest_inputsChanged()

bool esengine::uiHitTest_inputsChanged ( ecs::Registry & registry)

Definition at line 40 of file UIBindings.cpp.

References ctx(), and esengine::EstellaContext::require().

◆ uiHitTest_pick()

u32 esengine::uiHitTest_pick ( ecs::Registry & registry,
f32 worldX,
f32 worldY )

Definition at line 69 of file UIBindings.cpp.

References ctx(), and esengine::EstellaContext::require().

◆ uiHitTest_pickAll()

u32 esengine::uiHitTest_pickAll ( ecs::Registry & registry,
f32 worldX,
f32 worldY )

Definition at line 73 of file UIBindings.cpp.

References ctx(), and esengine::EstellaContext::require().

◆ uiHitTest_pickResult()

u32 esengine::uiHitTest_pickResult ( u32 index)

Definition at line 77 of file UIBindings.cpp.

References ctx(), and esengine::EstellaContext::require().

◆ uiHitTest_update()

void esengine::uiHitTest_update ( ecs::Registry & registry,
f32 originX,
f32 originY,
f32 originZ,
f32 dirX,
f32 dirY,
f32 dirZ )

The runtime raycast. The pointer is a RAY — a screen point names one, and only a chosen plane turns it into a position — so content away from z = 0 (a mesh, a sprite on another layer) can be hit at all. pick/pickAll below stay a point: the editor asks about the flat design surface.

Definition at line 44 of file UIBindings.cpp.

References ctx(), and esengine::EstellaContext::require().

◆ uiHitTest_updateDomains()

void esengine::uiHitTest_updateDomains ( ecs::Registry & registry,
f32 worldOriginX,
f32 worldOriginY,
f32 worldOriginZ,
f32 worldDirX,
f32 worldDirY,
f32 worldDirZ,
f32 screenOriginX,
f32 screenOriginY,
f32 screenOriginZ,
f32 screenDirX,
f32 screenDirY,
f32 screenDirZ )

The hit test with a ray per domain — world content and world-space UI answer the first, screen UI the second.

A separate entry point rather than more parameters: these are bound by NAME, and widening a signature makes an older core throw rather than decline.

Definition at line 52 of file UIBindings.cpp.

References ctx(), and esengine::EstellaContext::require().

◆ uiLayout_update()

bool esengine::uiLayout_update ( ecs::Registry & registry,
f32 boxLeft,
f32 boxBottom,
f32 boxRight,
f32 boxTop,
bool propertyDirty )

Solve the UI layout tree against the world-space box UI lives in — its size is the available area, its center is where screen roots are placed. propertyDirty is the SDK's O(1) "an authored UINode/FlexContainer field changed" signal.

Definition at line 35 of file UIBindings.cpp.

References ctx(), and esengine::EstellaContext::require().

◆ uiNode_computedHeight()

f32 esengine::uiNode_computedHeight ( ecs::Registry & r,
u32 e )

◆ uiNode_computedWidth()

f32 esengine::uiNode_computedWidth ( ecs::Registry & registry,
u32 entity )

Resolved (Yoga-pass) pixel size of a UI node, for the editor's selection outline. The node's world box is this size, pivot-centered on its Transform.

Definition at line 83 of file UIBindings.cpp.

References esengine::ecs::UINode::computed_size_, esengine::Entity::fromRaw(), and esengine::ecs::Registry::tryGet().

Referenced by EMSCRIPTEN_BINDINGS().

◆ uiRenderOrder_update()

void esengine::uiRenderOrder_update ( ecs::Registry & registry)

◆ uiTreeLayers()

const std::unordered_map< u32, i32 > * esengine::uiTreeLayers ( )

The layers of what the Canvases hold with no uiOrder of its own, by entity id.

Definition at line 95 of file UIBindings.cpp.

References g_uiTreeOrder.

Referenced by renderer_keepScreenOverlay(), renderer_submitAll(), and renderer_submitScreenOverlay().

◆ viewProjectionFromOrigin()

glm::mat4 esengine::viewProjectionFromOrigin ( const glm::mat4 & viewProjection,
const glm::dvec3 & origin )
inline

A view-projection made for origin, for a point given from the origin now: the point from the old origin is the new one's plus the step between them.

Definition at line 33 of file RenderOrigin.hpp.

References renderOrigin().

Referenced by esengine::PostProcessPipeline::beginTemporalView(), esengine::PostProcessPipeline::peekTemporalView(), and esengine::PostProcessPipeline::trackView().

◆ withTextureSlot()

f32 esengine::withTextureSlot ( f32 texIndex,
i32 slot )
inline

Definition at line 21 of file BatchVertex.hpp.

References BATCH_SLOT_BITS.

◆ writesStencil()

bool esengine::writesStencil ( GfxStencilMode mode)
inline

Variable Documentation

◆ BATCH_DITHER_BIT

i32 esengine::BATCH_DITHER_BIT = 1 << 8
inlineconstexpr

texIndex bits: draw every other pixel in a checkerboard, at full colour (ImmediateDraw::setDither), and which half — the two halves together cover every pixel once. Above the glyph modes.

Definition at line 14 of file BatchVertex.hpp.

◆ BATCH_DITHER_PHASE_BIT

i32 esengine::BATCH_DITHER_PHASE_BIT = 1 << 9
inlineconstexpr

Definition at line 15 of file BatchVertex.hpp.

◆ BATCH_QUAD_INDICES

u32 esengine::BATCH_QUAD_INDICES[6] = { 0, 1, 2, 2, 3, 0 }
inlineconstexpr

Canonical two-triangle quad winding shared by every batch path.

Definition at line 63 of file BatchBuilder.hpp.

Referenced by appendQuads(), esengine::ShapePlugin::collect(), and esengine::TextPlugin::collect().

◆ BATCH_QUAD_POSITIONS

glm::vec4 esengine::BATCH_QUAD_POSITIONS[4]
inlineconstexpr
Initial value:
= {
{ -0.5f, -0.5f, 0.0f, 1.0f },
{ 0.5f, -0.5f, 0.0f, 1.0f },
{ 0.5f, 0.5f, 0.0f, 1.0f },
{ -0.5f, 0.5f, 0.0f, 1.0f },
}

Canonical centered unit-quad corner positions (CCW).

Definition at line 47 of file BatchBuilder.hpp.

Referenced by esengine::BatchPlugin::emitQuad().

◆ BATCH_QUAD_TEX_COORDS

glm::vec2 esengine::BATCH_QUAD_TEX_COORDS[4]
inlineconstexpr
Initial value:
= {
{ 0.0f, 0.0f },
{ 1.0f, 0.0f },
{ 1.0f, 1.0f },
{ 0.0f, 1.0f },
}

Unit-quad texture coordinates matching BATCH_QUAD_POSITIONS.

Definition at line 55 of file BatchBuilder.hpp.

Referenced by esengine::BatchPlugin::emitQuad().

◆ BATCH_SLOT_BITS

i32 esengine::BATCH_SLOT_BITS = 3
inlineconstexpr

Definition at line 11 of file BatchVertex.hpp.

Referenced by batchGlyphModeBits(), and withTextureSlot().

◆ CMD_STATE_CUSTOM_DRAW

u16 esengine::CMD_STATE_CUSTOM_DRAW = 0x08
staticconstexpr

Definition at line 29 of file DrawCommand.hpp.

◆ CMD_STATE_SCISSOR

◆ CMD_STATE_STENCIL_DECREMENT

u16 esengine::CMD_STATE_STENCIL_DECREMENT = 0x80
staticconstexpr

Definition at line 26 of file DrawCommand.hpp.

Referenced by esengine::DrawList::finalize(), and stencilModeOf().

◆ CMD_STATE_STENCIL_INCREMENT

u16 esengine::CMD_STATE_STENCIL_INCREMENT = 0x40
staticconstexpr

Definition at line 25 of file DrawCommand.hpp.

Referenced by esengine::DrawList::finalize(), and stencilModeOf().

◆ CMD_STATE_STENCIL_OUT

u16 esengine::CMD_STATE_STENCIL_OUT = 0x10
staticconstexpr

◆ CMD_STATE_STENCIL_TEST

◆ CMD_STATE_STENCIL_WRITE

◆ CMD_STATE_STENCIL_ZERO

u16 esengine::CMD_STATE_STENCIL_ZERO = 0x100
staticconstexpr

Definition at line 27 of file DrawCommand.hpp.

Referenced by esengine::DrawList::finalize(), and stencilModeOf().

◆ CMD_STATE_UI_STENCIL

◆ DRAW_PARAMS_BINDING

u32 esengine::DRAW_PARAMS_BINDING = 4
inlineconstexpr

Indexed UBO binding point for the per-draw DrawParams block. (0 = FrameConstants, 1 = MaterialConstants, 2 = LightConstants, 3 = TimeConstants.).

Definition at line 36 of file DrawParams.hpp.

Referenced by esengine::RenderContext::bindFrameConstants(), and esengine::Shader::commitParams().

◆ DRAW_PARAMS_BLOCK

const char* esengine::DRAW_PARAMS_BLOCK = "DrawParams"
inlineconstexpr

GLSL block name; must match the rewriter's generated block + Shader::compile lookup.

Definition at line 39 of file DrawParams.hpp.

Referenced by rewriteLooseUniforms().

◆ DRAW_PARAMS_FALLBACK_SIZE

u32 esengine::DRAW_PARAMS_FALLBACK_SIZE = 4096
inlineconstexpr

Size of the zeroed fallback UBO RenderContext binds at DRAW_PARAMS_BINDING each frame.

A draw path that never calls commitParams (e.g. a raw material shader drawn by the batch path) still needs SOME buffer bound that covers its block, or WebGL rejects the draw; the fallback makes unset members read zero — exactly what their loose-uniform ancestors read. Adoption warns if a shader's block ever exceeds this.

Definition at line 50 of file DrawParams.hpp.

Referenced by esengine::Shader::adoptDrawParams().

◆ ENTITY_POSE_2D_WORDS

u32 esengine::ENTITY_POSE_2D_WORDS = 4
staticconstexpr

Definition at line 9 of file EntityPose2D.hpp.

◆ ENV_MAP_SAMPLER

const char* esengine::ENV_MAP_SAMPLER = "u_envMap"
inlineconstexpr

The injected reflection sampler, one unit past the shadow map's.

Definition at line 29 of file EngineTextureUnits.hpp.

◆ ENV_MAP_TEXTURE_UNIT

u32 esengine::ENV_MAP_TEXTURE_UNIT = 3
inlineconstexpr

◆ FRAME_CONSTANTS_BINDING

u32 esengine::FRAME_CONSTANTS_BINDING = 0
inlineconstexpr

Indexed uniform binding point the FrameConstants block is bound to.

Definition at line 83 of file FrameConstants.hpp.

Referenced by esengine::RenderContext::bindFrameConstants().

◆ FRAME_CONSTANTS_BLOCK

const char* esengine::FRAME_CONSTANTS_BLOCK = "FrameConstants"
inlineconstexpr

GLSL block name; must match the shader declarations and Shader::compile lookup.

Definition at line 86 of file FrameConstants.hpp.

◆ g_activeContext

EstellaContext* esengine::g_activeContext = nullptr
inline

The explicitly-installed active engine context (or null if none).

Set by setActiveContext or, until N3, by the legacy initRenderer path. Read through activeCtx.

Definition at line 16 of file ActiveContext.hpp.

Referenced by activeCtx(), EMSCRIPTEN_BINDINGS(), initRendererInternal(), initRendererThreaded(), initRendererWebGPU(), initRendererWithContext(), and shutdownRenderer().

◆ g_uiTreeOrder

ecs::UITreeOrder esengine::g_uiTreeOrder
static

Definition at line 93 of file UIBindings.cpp.

Referenced by uiRenderOrder_update(), and uiTreeLayers().

◆ GFX_INVALID_UNIFORM_BLOCK

u32 esengine::GFX_INVALID_UNIFORM_BLOCK = 0xFFFFFFFFu
staticconstexpr

Sentinel returned by getUniformBlockIndex when a program has no such block (GL_INVALID_INDEX).

Definition at line 44 of file GfxDevice.hpp.

Referenced by esengine::GLDevice::backendUniformBlockIndex(), esengine::WebGPUDevice::backendUniformBlockIndex(), esengine::GfxDevice::getUniformBlockIndex(), and esengine::GfxDevice::uniformBlockBinding().

◆ GFX_UNBOUND_BLOCK

u32 esengine::GFX_UNBOUND_BLOCK = 0xFFFFFFFFu
inlineconstexpr

Definition at line 86 of file GfxResourceRegistry.hpp.

Referenced by esengine::GfxDevice::getUniformBlockIndex().

◆ GFX_UNIFORM_OFFSET_ALIGNMENT

u32 esengine::GFX_UNIFORM_OFFSET_ALIGNMENT = 256
staticconstexpr

What a uniform binding's offset must be a multiple of: the largest either API may ask.

Definition at line 47 of file GfxDevice.hpp.

◆ INSTANCE_CONSTANTS_BINDING

u32 esengine::INSTANCE_CONSTANTS_BINDING = 8
inlineconstexpr

Indexed UBO binding point for the per-draw InstanceConstants block. Nine and not four: slot 4 is DRAW_PARAMS_BINDING, which every shader whose loose uniforms were lifted declares — two blocks on one binding is a pipeline the device refuses without naming either.

Definition at line 36 of file InstanceConstants.hpp.

Referenced by esengine::DrawList::execute().

◆ INSTANCE_CONSTANTS_BLOCK

const char* esengine::INSTANCE_CONSTANTS_BLOCK = "InstanceConstants"
inlineconstexpr

GLSL block name; must match the injected mesh header + Shader::compile lookup.

Definition at line 39 of file InstanceConstants.hpp.

◆ INSTANCE_DATA_SAMPLER

const char* esengine::INSTANCE_DATA_SAMPLER = "u_instanceData"
inlineconstexpr

GLSL name of the record texture; pinned to its unit by Shader::compile.

Definition at line 42 of file InstanceConstants.hpp.

◆ INVALID_CALLBACK_ID

◆ INVALID_DENSE_INDEX

u32 esengine::INVALID_DENSE_INDEX = std::numeric_limits<u32>::max()
constexpr

Sentinel for empty sparse set slots.

Definition at line 177 of file Types.hpp.

◆ INVALID_ENTITY

◆ is_component_v

template<typename T>
bool esengine::is_component_v = is_component<T>::value
inlineconstexpr

Helper variable template for is_component.

Definition at line 180 of file Reflection.hpp.

◆ kClusterCutFreshCollects

u64 esengine::kClusterCutFreshCollects = 64
constexpr

How many collects back a cut still says what an entity is drawn with: a few frames of every pass. Older, it was not drawn lately (off screen, hidden), and its count would describe a view that is gone.

Definition at line 1165 of file MeshPlugin.cpp.

Referenced by esengine::MeshPlugin::clusterInspect().

◆ kClusterCutIdleCollects

u64 esengine::kClusterCutIdleCollects = 2048
constexpr

Collects a cut may go undrawn before its buffer is given back. A frame has several: the scene's, each shadow map's.

Definition at line 1162 of file MeshPlugin.cpp.

Referenced by esengine::MeshPlugin::collect().

◆ kClusterPixelError

f32 esengine::kClusterPixelError = 1.0f
constexpr

The error a clustered mesh may show, in pixels of the scene view, before a finer cluster is drawn.

Definition at line 1160 of file MeshPlugin.cpp.

◆ kDynamicGIStatFloats

u32 esengine::kDynamicGIStatFloats = 16
constexpr

Definition at line 94 of file DynamicGI.hpp.

◆ kEstellaBuildProvenance

const char* esengine::kEstellaBuildProvenance
staticconstexpr
Initial value:
=
"estella-build:9abbd5b4-06f3-47df-b968-826763c6879a"

Definition at line 160 of file WebSDKEntry.cpp.

Referenced by initRendererInternal(), and initRendererWebGPU().

◆ kGBufferUnit

u32 esengine::kGBufferUnit = 6
inlineconstexpr

The unit a PostProcess pass reads the scene's surface record at: what a surface IS — octahedral normal in rg, roughness in b, metalness in a (0 = nothing wrote here).

Just below the depth, on the same reasoning: the loose-uniform path fills upward from 2 and stops short of both, and a material's own textures start at 8.

Definition at line 45 of file MaterialConstants.hpp.

Referenced by esengine::PostProcessPipeline::drawMaterialOver(), and esengine::PostProcessPipeline::drawMaterialThrough().

◆ kNoAsyncComputeFence

◆ kSceneDepthUnit

u32 esengine::kSceneDepthUnit = 7
inlineconstexpr

The unit a PostProcess pass reads the scene's DEPTH at.

The top of the engine range on purpose: units 0 and 1 are the pass input and the scene, and the loose-uniform path fills upward from 2, so the last one is the only one nothing else can reach. A fullscreen pass has no use for the batch's other units.

Definition at line 36 of file MaterialConstants.hpp.

Referenced by esengine::PostProcessPipeline::drawMaterialOver(), esengine::PostProcessPipeline::drawMaterialThrough(), esengine::PostProcessPipeline::drawSelectionGround(), and esengine::PostProcessPipeline::grabDepth().

◆ kShadingModeCount

u8 esengine::kShadingModeCount = 7
inlineconstexpr

Definition at line 42 of file ViewShading.hpp.

Referenced by renderer_setViewShading().

◆ kShadowAtlasSize

u32 esengine::kShadowAtlasSize = 2048
inlineconstexpr

The one shadow texture every map a frame renders shares. One size for every scene: coverage adapts to the camera instead, so texel density is a property of how far a light was asked to reach rather than of a knob nobody can calibrate.

Definition at line 57 of file RenderFrame.hpp.

◆ kShadowCascadeCells

u32 esengine::kShadowCascadeCells = 2
inlineconstexpr

Definition at line 62 of file RenderFrame.hpp.

◆ kShadowCellSize

u32 esengine::kShadowCellSize = 512
inlineconstexpr

The unit the atlas is handed out in. A cascade takes a 2x2 block of them; the texel snap and the depth bias are derived from the tile that comes back, not from this, so a smaller tile is a smaller answer rather than a wrong one.

Definition at line 61 of file RenderFrame.hpp.

◆ LAYOUT_COUNT

u32 esengine::LAYOUT_COUNT = 5
staticconstexpr

Definition at line 102 of file GfxEnums.hpp.

Referenced by esengine::RenderFrame::endScreenOverlay().

◆ LIGHT_CONSTANTS_BINDING

u32 esengine::LIGHT_CONSTANTS_BINDING = 2
inlineconstexpr

Indexed UBO binding point for the per-frame LightConstants block.

Definition at line 26 of file LightConstants.hpp.

Referenced by esengine::LightStore::uploadAndBind().

◆ LIGHT_CONSTANTS_BLOCK

const char* esengine::LIGHT_CONSTANTS_BLOCK = "LightConstants"
inlineconstexpr

GLSL block name; must match ShaderParser's injected block + Shader::compile lookup.

Definition at line 29 of file LightConstants.hpp.

◆ LIGHT_TILE_BITS

f32 esengine::LIGHT_TILE_BITS = 8.0f
inlineconstexpr

The sprite layers a light reaches ride in GpuLight::shadowMap.y above the atlas tile count: tiles + 8 * range.

The block has no spare lane (it sits at the 16 KB every device guarantees). The range is two bytes, the lowest layer biased up by 128 and the highest counted down from 127, so that ZERO IS EVERY LAYER and a light nobody gave a range is unchanged.

Definition at line 94 of file LightConstants.hpp.

Referenced by esengine::LightStore::setLightShadowTiles().

◆ LIGHTMAP_SAMPLER

const char* esengine::LIGHTMAP_SAMPLER = "u_lightmap"
inlineconstexpr

The baked-light atlas, and the unit a lightmapped mesh samples it from.

Unit 5 and not 4: the morph deltas hold that one and 6/7 are the frame's 2D masks, so this is the last a draw's own stream can claim. A lit fragment ADDS the bake as its indirect term; an unlit one takes it as the whole of its light.

Definition at line 43 of file EngineTextureUnits.hpp.

◆ LIGHTMAP_TEXTURE_UNIT

u32 esengine::LIGHTMAP_TEXTURE_UNIT = 5
inlineconstexpr

◆ MATERIAL_CONSTANTS_BINDING

u32 esengine::MATERIAL_CONSTANTS_BINDING = 1
inlineconstexpr

Indexed UBO binding point for the per-material MaterialConstants block.

Definition at line 20 of file MaterialConstants.hpp.

Referenced by esengine::MaterialStore::bindForDraw(), and esengine::MaterialStore::bindThrough().

◆ MATERIAL_CONSTANTS_BLOCK

const char* esengine::MATERIAL_CONSTANTS_BLOCK = "MaterialConstants"
inlineconstexpr

GLSL block name; must match ShaderParser's generated block + Shader::compile lookup.

Definition at line 23 of file MaterialConstants.hpp.

◆ MATERIAL_TEXTURE_UNIT_BASE

u32 esengine::MATERIAL_TEXTURE_UNIT_BASE = 8
inlineconstexpr

First sampler unit a material texture parameter may use (batch owns units 0..7).

Definition at line 26 of file MaterialConstants.hpp.

◆ MAX_CMD_TEXTURE_SLOTS

◆ MAX_LIGHTS

u32 esengine::MAX_LIGHTS = 16
inlineconstexpr

Max simultaneous 2D lights packed into the UBO. The injected fragment loop is a fixed bound; inactive slots are zeroed (intensity 0) so they contribute nothing. Must match the u_lights[..] array size in ShaderParser's injected GLSL.

Definition at line 36 of file LightConstants.hpp.

Referenced by esengine::LightStore::addLight().

◆ MAX_REFLECTION_PROBES

u32 esengine::MAX_REFLECTION_PROBES = 15
inlineconstexpr

Columns of the reflection atlas one frame can address — column 0 the environment's, so fifteen probes and a sky.

Here rather than with the store that fills them: what bounds it is the array in the block below, a box per column.

Definition at line 87 of file LightConstants.hpp.

Referenced by esengine::ReflectionStore::add(), and esengine::LightStore::setReflections().

◆ MAX_SHADOW_2D_LIGHTS

u32 esengine::MAX_SHADOW_2D_LIGHTS = 8
inlineconstexpr

Channels of the 2D shadow mask: the lights that MEET one another and cast at once (see ShadowChannels2D.hpp).

Eight: a second mask, which takes the shape mask's texture unit (6) because every unit above it is the first mask's and every one below is spoken for. A frame with a light that has a cookie needs that unit for the shape mask, and has the first mask's four. A light past the channels still lights the scene and stops shadowing, which is the failure a 2D scene can look at and understand.

Definition at line 51 of file LightConstants.hpp.

Referenced by esengine::LightStore::setLightShadow2DChannel(), and esengine::LightStore::setTiledLightShadow2DChannel().

◆ MAX_SHADOW_CASCADES

u32 esengine::MAX_SHADOW_CASCADES = 4
inlineconstexpr

Slices one directional shadow map is split into, each covering a stretch of the view — so the near one spends its texels on what is near instead of on the whole scene. Where they LAND is the atlas's answer, not this number's: a cascade claims a tile like anything else that casts.

Definition at line 59 of file LightConstants.hpp.

Referenced by esengine::RenderFrame::setShadowBudget().

◆ MAX_SHADOW_TILES

u32 esengine::MAX_SHADOW_TILES = 16
inlineconstexpr

Max shadow tiles one frame's atlas hands out — the shader's array bound.

Not the same number as the cascades above: a cascade is one reason to want a tile and a spot light is another, and the atlas does not care which asked. Sixteen because a point light's map is a cube — six of them — and eight could not hold one beside a sun's cascades.

Definition at line 75 of file LightConstants.hpp.

Referenced by esengine::LightStore::setShadowTiles(), and esengine::ShadowAtlas::setTileBudget().

◆ MAX_SHAPE_2D_LIGHTS

u32 esengine::MAX_SHAPE_2D_LIGHTS = 4
inlineconstexpr

Lights whose SHAPE one frame can carry — the shape mask's four channels.

Definition at line 39 of file LightConstants.hpp.

Referenced by esengine::LightStore::setLightShape2DChannel().

◆ MAX_TILED_LIGHTS

u32 esengine::MAX_TILED_LIGHTS = 96
inlineconstexpr

Lights a frame can carry through tiles, past the sixteen the loop reads directly. Three words of mask: the fourth is spare.

Definition at line 34 of file TiledLights.hpp.

Referenced by esengine::LightStore::addTiledLight().

◆ MAX_VERTEX_ATTRIBUTES

u32 esengine::MAX_VERTEX_ATTRIBUTES = 16
staticconstexpr

Definition at line 217 of file GfxEnums.hpp.

Referenced by esengine::CustomGeometry::init().

◆ MAX_VERTEX_BUFFER_SLOTS

u32 esengine::MAX_VERTEX_BUFFER_SLOTS = 2
staticconstexpr

◆ MESH_INSTANCE_MAX_RECORDS

u32 esengine::MESH_INSTANCE_MAX_RECORDS
staticconstexpr
Initial value:
=
static constexpr u32 MESH_INSTANCE_TEXELS
Definition GfxEnums.hpp:108
static constexpr u32 MESH_INSTANCE_TEXTURE_WIDTH
Definition GfxEnums.hpp:125

Records the texture holds. Beyond it the frame's tail draws unplaced, which is visible; a texture the device refuses would draw nothing at all.

Definition at line 128 of file GfxEnums.hpp.

◆ MESH_INSTANCE_STRIDE

u32 esengine::MESH_INSTANCE_STRIDE = MESH_INSTANCE_TEXELS * 16
staticconstexpr

Bytes one record occupies. RGBA32F: a world-space translation is what this carries, and half precision loses whole units of it a thousand away.

Definition at line 121 of file GfxEnums.hpp.

Referenced by esengine::MeshPlugin::collect().

◆ MESH_INSTANCE_TEXEL_LIGHTMAP

u32 esengine::MESH_INSTANCE_TEXEL_LIGHTMAP = 7
staticconstexpr

The bake's atlas rectangle (xy scale, zw offset). Per object, because the same mesh placed twice is lit twice and occupies two patches of one atlas.

Definition at line 118 of file GfxEnums.hpp.

Referenced by esengine::MeshPlugin::collect().

◆ MESH_INSTANCE_TEXEL_MODEL

u32 esengine::MESH_INSTANCE_TEXEL_MODEL = 0
staticconstexpr

The model matrix's three ROWS, translation in .w. Its fourth row is (0,0,0,1) on every transform a Transform can state, so it is not sent.

Definition at line 111 of file GfxEnums.hpp.

Referenced by esengine::MeshPlugin::collect().

◆ MESH_INSTANCE_TEXEL_NORMAL

u32 esengine::MESH_INSTANCE_TEXEL_NORMAL = 4
staticconstexpr

The normal matrix's three rows in .xyz. Per object because a non-uniform scale makes the model matrix the wrong transform for a normal.

Definition at line 115 of file GfxEnums.hpp.

Referenced by esengine::MeshPlugin::collect().

◆ MESH_INSTANCE_TEXEL_TINT

u32 esengine::MESH_INSTANCE_TEXEL_TINT = 3
staticconstexpr

Definition at line 112 of file GfxEnums.hpp.

Referenced by esengine::MeshPlugin::collect().

◆ MESH_INSTANCE_TEXELS

u32 esengine::MESH_INSTANCE_TEXELS = 8
staticconstexpr

One per-object record for a resident mesh, in texels of the frame's RGBA32F instance texture. FIXED at one shape for every variant, so no stride has to be derived by the layout, the allocation and the packer separately.

See also
MESH_INSTANCE_TEXEL_MODEL and the offsets below.

Definition at line 108 of file GfxEnums.hpp.

Referenced by esengine::MeshPlugin::collect().

◆ MESH_INSTANCE_TEXTURE_UNIT

u32 esengine::MESH_INSTANCE_TEXTURE_UNIT = 15
staticconstexpr

The unit the frame's record texture binds on. Not one of the eight a draw's own stream can claim, because it is FRAME state; and the TOP of what remains, since a material's textures are handed units upward from unit 8.

Definition at line 133 of file GfxEnums.hpp.

Referenced by esengine::DrawList::execute().

◆ MESH_INSTANCE_TEXTURE_WIDTH

u32 esengine::MESH_INSTANCE_TEXTURE_WIDTH = 2048
staticconstexpr

Texels per row of the instance texture. A multiple of the record, so no record straddles a row; 2048 is the smallest MAX_TEXTURE_SIZE WebGL2 grants.

Definition at line 125 of file GfxEnums.hpp.

◆ MESH_MAX_ACTIVE_MORPHS

u32 esengine::MESH_MAX_ACTIVE_MORPHS = 64
staticconstexpr

Morph targets one draw may blend AT ONCE; past it the heaviest are taken. The shader loops over only the live ones, each a texture read or two per vertex, so an unused budget costs nothing beyond the larger block. Matches the bones: a face runs dozens.

Definition at line 142 of file GfxEnums.hpp.

◆ MESH_MAX_BONES

u32 esengine::MESH_MAX_BONES = 256
staticconstexpr

Bone matrices one skinned draw may carry. 256 mat4 is exactly the 16KB a WebGL2 uniform block is guaranteed, and a draw stages only the matrices it has, so a small rig pays nothing for the room. A skin with more is split into chunks of at most this many at import, one draw each; one with more and no chunks is drawn static.

Definition at line 138 of file GfxEnums.hpp.

Referenced by esengine::resource::ResourceManager::setMeshSkinChunks().

◆ MESH_VARIANTS

u32 esengine::MESH_VARIANTS = 4096
staticconstexpr

Definition at line 150 of file GfxEnums.hpp.

◆ MORPH_DELTA_SAMPLER

const char* esengine::MORPH_DELTA_SAMPLER = "u_morphDeltas"
inlineconstexpr

The sampler a mesh's morph deltas arrive through, and the unit it is pinned to.

Definition at line 33 of file EngineTextureUnits.hpp.

◆ MORPH_DELTA_TEXTURE_UNIT

u32 esengine::MORPH_DELTA_TEXTURE_UNIT = 4
inlineconstexpr

◆ MORPH_MAX_TEXELS

u32 esengine::MORPH_MAX_TEXELS = MORPH_TEXTURE_WIDTH * MORPH_TEXTURE_WIDTH
staticconstexpr

Deltas one mesh may carry: targets * vertices * (2 with normals, else 1). Beyond it the geometry draws unmorphed — a texture the device refuses is a mesh that does not draw at all.

Definition at line 149 of file GfxEnums.hpp.

◆ MORPH_TEXTURE_WIDTH

u32 esengine::MORPH_TEXTURE_WIDTH = 2048
staticconstexpr

Texels per row of a mesh's delta texture. 2048 is the smallest MAX_TEXTURE_SIZE WebGL2 guarantees, so a square of them is the most any device here must hold.

Definition at line 145 of file GfxEnums.hpp.

◆ MULTI_DRAW_MAX

u32 esengine::MULTI_DRAW_MAX = 64
inlineconstexpr

The most draws one call may carry where the device draws runs (WEBGL_multi_draw).

Definition at line 56 of file InstanceConstants.hpp.

◆ PARTICLE_INSTANCE_STRIDE

u32 esengine::PARTICLE_INSTANCE_STRIDE = 60
staticconstexpr

Definition at line 122 of file GfxEnums.hpp.

◆ PLANAR_CONSTANTS_BINDING

u32 esengine::PLANAR_CONSTANTS_BINDING = 9
inlineconstexpr

Definition at line 7 of file PlanarConstants.hpp.

Referenced by esengine::DrawList::execute().

◆ PLANAR_CONSTANTS_BLOCK

const char* esengine::PLANAR_CONSTANTS_BLOCK = "PlanarConstants"
inlineconstexpr

Definition at line 8 of file PlanarConstants.hpp.

◆ PROBE_BLOCK_BYTES

u32 esengine::PROBE_BLOCK_BYTES
inlineconstexpr
Initial value:
=
static_cast<u32>(sizeof(ProbeConstants)) * PROBE_MAX_INSTANCES + 16
constexpr u32 PROBE_MAX_INSTANCES
How many instances of one merged draw carry their own irradiance.
std::uint32_t u32
Unsigned 32-bit integer.
Definition Types.hpp:45
The indirect light one instance stands in — both halves of it.

Bytes the block is declared with: every run, then one vec4 that is not data.

ANGLE on D3D11 turns a block whose only member is a large array into a StructuredBuffer placed after the stage's texture registers. A lit material under a reflection samples sixteen, so it lands out of range and Chrome's GPU process aborts. A second member keeps the block a constant buffer.

Definition at line 69 of file ProbeConstants.hpp.

◆ PROBE_CONSTANTS_BINDING

u32 esengine::PROBE_CONSTANTS_BINDING = 7
inlineconstexpr

Indexed UBO binding point for the per-draw ProbeConstants block.

Definition at line 26 of file ProbeConstants.hpp.

Referenced by esengine::DrawList::execute().

◆ PROBE_CONSTANTS_BLOCK

const char* esengine::PROBE_CONSTANTS_BLOCK = "ProbeConstants"
inlineconstexpr

GLSL block name; must match the injected Lit header + Shader::compile lookup.

Definition at line 29 of file ProbeConstants.hpp.

◆ PROBE_GRID_SAMPLER

const char* esengine::PROBE_GRID_SAMPLER = "u_probeGrid"
inlineconstexpr

The frame's probe atlas, read per pixel, on the bake's unit.

A draw that reads a bake asks no volume for its light, so the two never meet in one draw; a mesh variant compiled with the bake's sampler declares no atlas at all and reads its volume per object.

Definition at line 51 of file EngineTextureUnits.hpp.

◆ PROBE_MAX_INSTANCES

u32 esengine::PROBE_MAX_INSTANCES = 100
inlineconstexpr

How many instances of one merged draw carry their own irradiance.

It rides the draw's uniform block, one run of ten vec4 per instance, so 100 runs is 16000 bytes — inside the 16KB a WebGL2 uniform block is guaranteed. A run reaching this many stops merging rather than drawing someone else's light.

Definition at line 39 of file ProbeConstants.hpp.

Referenced by esengine::DrawCommand::mergeBlocker().

◆ PROBE_TEXELS

u32 esengine::PROBE_TEXELS = 10
inlineconstexpr

Texels one instance's indirect light occupies in that block.

Definition at line 42 of file ProbeConstants.hpp.

◆ QUALITY_VALUE_COUNT

u32 esengine::QUALITY_VALUE_COUNT = static_cast<u32>(QualityValue::Count)
inlineconstexpr

◆ QUALITY_VALUE_SPECS

QualityValueSpec esengine::QUALITY_VALUE_SPECS[]
inlineconstexpr
Initial value:
= {
{QualityValue::LoopLights, "loopLights", 16.0f, 16.0f},
{QualityValue::TiledLights, "tiledLights", 96.0f, 96.0f},
{QualityValue::ShadowTiles, "shadowTiles", 16.0f, 16.0f},
}

Definition at line 28 of file QualityValues.hpp.

Referenced by qualityCap(), qualitySpecsInOrder(), esengine::QualityValues::reset(), and esengine::QualityValues::set().

◆ RETAINED_TEXT_BLOCK_QUADS

u32 esengine::RETAINED_TEXT_BLOCK_QUADS = 64
inlineconstexpr

Quads in one bounds block: a view that misses the whole block does not look at its quads.

Definition at line 26 of file RetainedText.hpp.

Referenced by esengine::RetainedTextStore::add(), and retainedTextClip().

◆ RETAINED_TEXT_QUAD_FLOATS

u32 esengine::RETAINED_TEXT_QUAD_FLOATS = 4 * TEXT_VERTEX_FLOATS
inlineconstexpr

Definition at line 27 of file RetainedText.hpp.

Referenced by esengine::RetainedTextStore::add(), and retainedTextClip().

◆ RIPPLE_NORMALS_LONGEST

u32 esengine::RIPPLE_NORMALS_LONGEST = 2
inlineconstexpr

The longest wave in a field runs this many times across the texture, the shortest twenty: a field read at one size holds a decade of lengths.

Definition at line 16 of file RippleNormals.hpp.

◆ RIPPLE_NORMALS_SIZE

u32 esengine::RIPPLE_NORMALS_SIZE = 256
inlineconstexpr

◆ SHADOW_2D_MASK_CHANNELS

u32 esengine::SHADOW_2D_MASK_CHANNELS = 4
inlineconstexpr

Channels one 2D shadow mask carries: an RGBA8 target has four.

Definition at line 42 of file LightConstants.hpp.

◆ SHADOW_2D_SAMPLER

const char* esengine::SHADOW_2D_SAMPLER = "u_shadow2D"
inlineconstexpr

The 2D shadow mask, and the texture unit every Lit shader samples it from.

One screen-sized RGBA8 target, a channel per casting light: the shadow pass draws what each occluder hides and a Lit fragment reads its own channel at its own pixel. Unit 7 is the top of the batch stream's eight, taken from it only while a mask exists — so a scene with no 2D shadows pays no merge slot.

Definition at line 70 of file EngineTextureUnits.hpp.

◆ SHADOW_2D_TEXTURE_UNIT

u32 esengine::SHADOW_2D_TEXTURE_UNIT = 7
inlineconstexpr

◆ SHADOW_CUBE_FACES

u32 esengine::SHADOW_CUBE_FACES = 6
inlineconstexpr

Faces a point light's map is rendered as. Six cones at right angles cover every direction from a point, and each is a tile like any other — which is what spares the pass a projection nothing else in it understands.

Definition at line 66 of file LightConstants.hpp.

◆ SHADOW_MAP_SAMPLER

const char* esengine::SHADOW_MAP_SAMPLER = "u_shadowMap"
inlineconstexpr

The injected shadow-map sampler, and the texture unit Shader::compile pins it to.

Every Lit shader gets the sampler from the injected header, so the unit is a contract rather than something each compile site repeats. Slot 2 sits after the draw's own two (base colour, normal map) — see BatchBuilder's slot assembly.

Definition at line 25 of file EngineTextureUnits.hpp.

◆ SHADOW_MAP_TEXTURE_UNIT

u32 esengine::SHADOW_MAP_TEXTURE_UNIT = 2
inlineconstexpr

◆ SHAPE_2D_SAMPLER

const char* esengine::SHAPE_2D_SAMPLER = "u_lightShape2D"
inlineconstexpr

The 2D light-shape mask, and the unit below the shadow mask's.

The same target shape carrying the other half of "how much of this light is here": what its SHAPE covers, drawn as the light's own cookie. Two planes rather than one channel, because a fragment needs both numbers to multiply them — a single channel could only carry their sum.

Definition at line 60 of file EngineTextureUnits.hpp.

◆ SHAPE_2D_TEXTURE_UNIT

u32 esengine::SHAPE_2D_TEXTURE_UNIT = 6
inlineconstexpr

◆ SKIN_CONSTANTS_BINDING

u32 esengine::SKIN_CONSTANTS_BINDING = 5
inlineconstexpr

Indexed UBO binding point for the per-draw SkinConstants block.

Definition at line 27 of file SkinConstants.hpp.

Referenced by esengine::DrawList::execute().

◆ SKIN_CONSTANTS_BLOCK

const char* esengine::SKIN_CONSTANTS_BLOCK = "SkinConstants"
inlineconstexpr

GLSL block name; must match the shader's declaration + Shader::compile lookup.

Definition at line 30 of file SkinConstants.hpp.

◆ SPRITE_LAYER_BIAS

f32 esengine::SPRITE_LAYER_BIAS = 129.0f
inlineconstexpr

What a sprite's layer is written as in the vertex lane the lit fragment reads: the layer plus 129, so 0 is "no layer to test".

Definition at line 104 of file LightConstants.hpp.

Referenced by packSpriteLightLane().

◆ SPRITE_LIGHT_REACH_BITS

u32 esengine::SPRITE_LIGHT_REACH_BITS = 15
inlineconstexpr

◆ SPRITE_LIGHT_REACH_STEP

f32 esengine::SPRITE_LIGHT_REACH_STEP = 512.0f
inlineconstexpr

Which of the loop's lights can reach a lit quad rides in the same vertex lane as its layer: -(layer + 129 + 512 * reach).

A lit pixel used to work every light of the frame out, the ones across the level included, and that arithmetic is the whole cost of 2D lighting (docs/GPU_PERFORMANCE_OPTIONS.md, section 9). The quad's box is known where it is submitted, so which lights reach it is settled there and the fragment skips the rest. NEGATIVE says the lane carries a reach at all: a lane written by anything older, or by a draw that does not know, is the bare layer and every light is worked out as before. Fifteen bits, because 9 bits of layer and 15 of reach is what a float carries whole; the sixteenth light is always worked out.

Definition at line 215 of file LightConstants.hpp.

Referenced by packSpriteLightLane().

◆ TEXT_VERTEX_FLOATS

◆ threadedBoot

std::atomic<int> esengine::threadedBoot {0}
static

◆ TILE_COLUMNS

u32 esengine::TILE_COLUMNS = 16
inlineconstexpr

Tiles across and down the picture. 16 x 12 is 192 tiles, each a mask of 128 bits (a vec4 of u32), which with the lights is what fits a uniform block's 16 KB.

Definition at line 30 of file TiledLights.hpp.

Referenced by esengine::LightStore::addTiledLight(), markLightTiles(), esengine::LightStore::markLoopLights(), and esengine::LightStore::setTiledView().

◆ TILE_ROWS

u32 esengine::TILE_ROWS = 12
inlineconstexpr

◆ TIME_CONSTANTS_BINDING

u32 esengine::TIME_CONSTANTS_BINDING = 3
inlineconstexpr

Definition at line 100 of file FrameConstants.hpp.

◆ TIME_CONSTANTS_BLOCK

const char* esengine::TIME_CONSTANTS_BLOCK = "TimeConstants"
inlineconstexpr

Definition at line 101 of file FrameConstants.hpp.

◆ WATER_SUN_GLSL

char esengine::WATER_SUN_GLSL[]
inlineconstexpr

◆ WATER_SUN_SAMPLER

const char* esengine::WATER_SUN_SAMPLER = "u_waterSunField"
inlineconstexpr

Definition at line 74 of file EngineTextureUnits.hpp.

◆ WATER_SUN_TEXTURE_UNIT

u32 esengine::WATER_SUN_TEXTURE_UNIT = 16
inlineconstexpr

Definition at line 75 of file EngineTextureUnits.hpp.

◆ WATER_SUN_WGSL

char esengine::WATER_SUN_WGSL[]
inlineconstexpr

Definition at line 64 of file WaterSunShader.hpp.

◆ WGSL_MAX_TEXTURE_UNITS

u32 esengine::WGSL_MAX_TEXTURE_UNITS = 17
inlineconstexpr

Units a tN / sN name can carry — the batch stream and a material's own.

Definition at line 35 of file WgslBindings.hpp.

Referenced by scanWGSLReachedUnits().