MiniQuake

src/miniquake/render/alias_mesh.ml

Package
miniquake.render.alias_mesh
Reachable
Yes

Imports

Declarations

ALIAS_BATCH_CACHE_SIZE

const ALIAS_BATCH_CACHE_SIZE = 4096

Defines the alias batch cache size value used by `miniquake.render.alias_mesh`.

View source

ALIAS_MESH_CACHE_SIZE

const ALIAS_MESH_CACHE_SIZE = 512

Defines the alias mesh cache size value used by `miniquake.render.alias_mesh`.

View source

aliasBatchData

function aliasBatchData(frame, mesh)

Return alias batch data derived from the active module state.

ParameterTypeDefaultDescription
framedynamic—The frame input consumed by `aliasBatchData`.
meshdynamic—The mesh input consumed by `aliasBatchData`.

View source

aliasBatchFrameKeys

aliasBatchFrameKeys

Tracks the module-level alias batch frame keys state owned by `miniquake.render.alias_mesh`.

View source

aliasBatchMeshKeys

aliasBatchMeshKeys

Tracks the module-level alias batch mesh keys state owned by `miniquake.render.alias_mesh`.

View source

aliasBatchValues

aliasBatchValues

Tracks the module-level alias batch values state owned by `miniquake.render.alias_mesh`.

View source

miniquake.render.alias_mesh.AliasMesh struct

miniquake.render.alias_mesh.AliasMeshCommand struct

miniquake.render.alias_mesh.AliasMeshVertex struct

aliasmodel

aliasmodel

Tracks the module-level aliasmodel state owned by `miniquake.render.alias_mesh`.

View source

aliasShadeDotData

function aliasShadeDotData(row)

Return alias shade dot data derived from the active module state.

ParameterTypeDefaultDescription
rowdynamic—The row input consumed by `aliasShadeDotData`.

View source

aliasShadeDotRows

aliasShadeDotRows

Tracks the module-level alias shade dot rows state owned by `miniquake.render.alias_mesh`.

View source

aliasShadowProjection

function aliasShadowProjection(entityOriginZ, lightSpotZ)

Implements the `aliasShadowProjection` operation for `miniquake.render.alias_mesh` (alias shadow projection).

ParameterTypeDefaultDescription
entityOriginZdynamic—The entity origin z input consumed by `aliasShadowProjection`.
lightSpotZdynamic—The light spot z input consumed by `aliasShadowProjection`.

View source

alltris

alltris

Tracks the module-level alltris state owned by `miniquake.render.alias_mesh`.

View source

allverts

allverts

Tracks the module-level allverts state owned by `miniquake.render.alias_mesh`.

View source

ambientlight

ambientlight

Tracks the module-level ambientlight state owned by `miniquake.render.alias_mesh`.

View source

BuildTris

function BuildTris()

Create and initialize tris.

View source

cachedMesh

function cachedMesh(model)

Implements the `cachedMesh` operation for `miniquake.render.alias_mesh` (cached mesh).

ParameterTypeDefaultDescription
modeldynamic—Model resource processed by the operation.

View source

clampByte

function clampByte(value)

Return a validated clamp byte value.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `clampByte`.

View source

clearCaches

function clearCaches()

Update module state for caches.

View source

commands

commands

Tracks the module-level commands state owned by `miniquake.render.alias_mesh`.

View source

configureAliasLighting

function configureAliasLighting(lightValue, ambientValue, yaw, spot)

Update subsystem configuration for configure alias lighting.

ParameterTypeDefaultDescription
lightValuedynamic—The light value input consumed by `configureAliasLighting`.
ambientValuedynamic—The ambient value input consumed by `configureAliasLighting`.
yawdynamic—The yaw input consumed by `configureAliasLighting`.
spotdynamic—The spot input consumed by `configureAliasLighting`.

View source

configureAliasModel

function configureAliasModel(model)

Update subsystem configuration for configure alias model.

ParameterTypeDefaultDescription
modeldynamic—Model resource processed by the operation.

View source

configureAliasShadowPointLight

function configureAliasShadowPointLight(enabled, x, y, z)

Select a model-local point light for physically directed projected shadows. Disabling it retains GLQuake's stable directional fallback.

ParameterTypeDefaultDescription
enableddynamic—Whether the optional behavior is enabled.
xdynamic—The x input consumed by `configureAliasShadowPointLight`.
ydynamic—The y input consumed by `configureAliasShadowPointLight`.
zdynamic—The z input consumed by `configureAliasShadowPointLight`.

View source

currentAliasFrame

currentAliasFrame

Tracks the module-level current alias frame state owned by `miniquake.render.alias_mesh`.

View source

drawAliasMesh

function drawAliasMesh(model, frame, mesh)

Render alias mesh.

ParameterTypeDefaultDescription
modeldynamic—Model resource processed by the operation.
framedynamic—The frame input consumed by `drawAliasMesh`.
meshdynamic—The mesh input consumed by `drawAliasMesh`.

View source

drawAliasMeshLerped

function drawAliasMeshLerped(model, previousFrame, currentFrame, fraction, mesh)

Render a diagnostic/scalar MDL mesh interpolated between two poses. The production path performs the same blend inside the native batch bridge.

ParameterTypeDefaultDescription
modeldynamic—Model resource processed by the operation.
previousFramedynamic—The previous frame input consumed by `drawAliasMeshLerped`.
currentFramedynamic—The current frame input consumed by `drawAliasMeshLerped`.
fractiondynamic—The fraction input consumed by `drawAliasMeshLerped`.
meshdynamic—The mesh input consumed by `drawAliasMeshLerped`.

View source

drawAliasModelBatch

function drawAliasModelBatch(model, frame, mesh, origin, angles, doubleEyes, smooth)

Render alias model batch.

ParameterTypeDefaultDescription
modeldynamic—Model resource processed by the operation.
framedynamic—The frame input consumed by `drawAliasModelBatch`.
meshdynamic—The mesh input consumed by `drawAliasModelBatch`.
origindynamic—World-space origin of the operation.
anglesdynamic—Orientation angles used by the operation.
doubleEyesdynamic—The double eyes input consumed by `drawAliasModelBatch`.
smoothdynamic—The smooth input consumed by `drawAliasModelBatch`.

View source

drawAliasModelBatchLerped

function drawAliasModelBatchLerped(model, previousFrame, currentFrame, fraction, mesh, origin, angles, doubleEyes, smooth)

Render an interpolated alias model with one native call on every backend.

ParameterTypeDefaultDescription
modeldynamic—Model resource processed by the operation.
previousFramedynamic—The previous frame input consumed by `drawAliasModelBatchLerped`.
currentFramedynamic—The current frame input consumed by `drawAliasModelBatchLerped`.
fractiondynamic—The fraction input consumed by `drawAliasModelBatchLerped`.
meshdynamic—The mesh input consumed by `drawAliasModelBatchLerped`.
origindynamic—World-space origin of the operation.
anglesdynamic—Orientation angles used by the operation.
doubleEyesdynamic—The double eyes input consumed by `drawAliasModelBatchLerped`.
smoothdynamic—The smooth input consumed by `drawAliasModelBatchLerped`.

View source

drawAliasShadowProjectionSampleAtOrigin

function drawAliasShadowProjectionSampleAtOrigin(header, posenum, entityOriginZ, offsetX, offsetY, contactOnly)

gl_rmain.c computes the projected height from currententity->origin[2]. The vertex coordinates below are still model-local because the entity transform is already active on the GL matrix stack.

ParameterTypeDefaultDescription
headerdynamic—The header input consumed by `drawAliasShadowProjectionSampleAtOrigin`.
posenumdynamic—The posenum input consumed by `drawAliasShadowProjectionSampleAtOrigin`.
entityOriginZdynamic—The entity origin z input consumed by `drawAliasShadowProjectionSampleAtOrigin`.
offsetXdynamic—The offset x input consumed by `drawAliasShadowProjectionSampleAtOrigin`.
offsetYdynamic—The offset y input consumed by `drawAliasShadowProjectionSampleAtOrigin`.
contactOnlydynamic—The contact only input consumed by `drawAliasShadowProjectionSampleAtOrigin`.

View source

FanLength

function FanLength(starttri, startv)

Return fan length derived from the active module state.

ParameterTypeDefaultDescription
starttridynamic—The starttri input consumed by `FanLength`.
startvdynamic—The startv input consumed by `FanLength`.

View source

frameForNumber

function frameForNumber(model, frameNumber, time)

Advance for number by one processing step.

ParameterTypeDefaultDescription
modeldynamic—Model resource processed by the operation.
frameNumberdynamic—The frame number input consumed by `frameForNumber`.
timedynamic—Simulation or presentation time for the operation.

View source

GL_DrawAliasContactShadowAtOrigin

function GL_DrawAliasContactShadowAtOrigin(header, posenum, entityOriginZ)

Draw one vertically projected model footprint as the stable contact core of the enhanced shadow. This is still the model mesh, not a generic blob.

ParameterTypeDefaultDescription
headerdynamic—The header input consumed by `GL_DrawAliasContactShadowAtOrigin`.
posenumdynamic—The posenum input consumed by `GL_DrawAliasContactShadowAtOrigin`.
entityOriginZdynamic—The entity origin z input consumed by `GL_DrawAliasContactShadowAtOrigin`.

View source

GL_DrawAliasFrame

function GL_DrawAliasFrame(header, posenum)

Mirror Quake's GL_DrawAliasFrame routine and its observable state changes.

ParameterTypeDefaultDescription
headerdynamic—The header input consumed by `GL_DrawAliasFrame`.
posenumdynamic—The posenum input consumed by `GL_DrawAliasFrame`.

View source

GL_DrawAliasRayShadowSample

function GL_DrawAliasRayShadowSample(header, posenum, entity, doubleEyes, pointLightEnabled, lightX, lightY, lightZ, offsetX, offsetY)

Project every MDL triangle along a real light ray onto the first compatible render-BSP polygon. The caster transform and world context are configured by the entity renderer immediately before this call.

ParameterTypeDefaultDescription
headerdynamic—The header input consumed by `GL_DrawAliasRayShadowSample`.
posenumdynamic—The posenum input consumed by `GL_DrawAliasRayShadowSample`.
entitydynamic—Entity affected by the operation.
doubleEyesdynamic—The double eyes input consumed by `GL_DrawAliasRayShadowSample`.
pointLightEnableddynamic—The point light enabled input consumed by `GL_DrawAliasRayShadowSample`.
lightXdynamic—The light x input consumed by `GL_DrawAliasRayShadowSample`.
lightYdynamic—The light y input consumed by `GL_DrawAliasRayShadowSample`.
lightZdynamic—The light z input consumed by `GL_DrawAliasRayShadowSample`.
offsetXdynamic—The offset x input consumed by `GL_DrawAliasRayShadowSample`.
offsetYdynamic—The offset y input consumed by `GL_DrawAliasRayShadowSample`.

View source

GL_DrawAliasShadow

function GL_DrawAliasShadow(header, posenum)

Compatibility entry point retained for the direct differential wrapper.

ParameterTypeDefaultDescription
headerdynamic—The header input consumed by `GL_DrawAliasShadow`.
posenumdynamic—The posenum input consumed by `GL_DrawAliasShadow`.

View source

GL_DrawAliasShadowAtOrigin

function GL_DrawAliasShadowAtOrigin(header, posenum, entityOriginZ)

Draw the reference single-tap projected alias silhouette.

ParameterTypeDefaultDescription
headerdynamic—The header input consumed by `GL_DrawAliasShadowAtOrigin`.
posenumdynamic—The posenum input consumed by `GL_DrawAliasShadowAtOrigin`.
entityOriginZdynamic—The entity origin z input consumed by `GL_DrawAliasShadowAtOrigin`.

View source

GL_DrawAliasShadowSampleAtOrigin

function GL_DrawAliasShadowSampleAtOrigin(header, posenum, entityOriginZ, offsetX, offsetY)

Draw one directional projected-shadow sample with the requested penumbra offset while retaining the public GLQuake-compatible entry point.

ParameterTypeDefaultDescription
headerdynamic—The header input consumed by `GL_DrawAliasShadowSampleAtOrigin`.
posenumdynamic—The posenum input consumed by `GL_DrawAliasShadowSampleAtOrigin`.
entityOriginZdynamic—The entity origin z input consumed by `GL_DrawAliasShadowSampleAtOrigin`.
offsetXdynamic—The offset x input consumed by `GL_DrawAliasShadowSampleAtOrigin`.
offsetYdynamic—The offset y input consumed by `GL_DrawAliasShadowSampleAtOrigin`.

View source

GL_MakeAliasModelDisplayLists

function GL_MakeAliasModelDisplayLists(model, header)

Mirror Quake's GL_MakeAliasModelDisplayLists routine and its observable state changes.

ParameterTypeDefaultDescription
modeldynamic—Model resource processed by the operation.
headerdynamic—The header input consumed by `GL_MakeAliasModelDisplayLists`.

View source

lastposenum

lastposenum

Tracks the module-level lastposenum state owned by `miniquake.render.alias_mesh`.

View source

lightspot

lightspot

Tracks the module-level lightspot state owned by `miniquake.render.alias_mesh`.

View source

meshCacheModelKeys

meshCacheModelKeys

Tracks the module-level mesh cache model keys state owned by `miniquake.render.alias_mesh`.

View source

meshCacheValues

meshCacheValues

Tracks the module-level mesh cache values state owned by `miniquake.render.alias_mesh`.

View source

numcommands

numcommands

Tracks the module-level numcommands state owned by `miniquake.render.alias_mesh`.

View source

numorder

numorder

Tracks the module-level numorder state owned by `miniquake.render.alias_mesh`.

View source

paliashdr

paliashdr

Tracks the module-level paliashdr state owned by `miniquake.render.alias_mesh`.

View source

precacheAliasLightingRows

function precacheAliasLightingRows()

Build the sixteen yaw-dependent shadedot tables during level precaching.

View source

precacheAliasModel

function precacheAliasModel(model)

Preload and register the alias model asset.

ParameterTypeDefaultDescription
modeldynamic—Model resource processed by the operation.

View source

R_SetupAliasFrame

function R_SetupAliasFrame(frame, header)

Apply the Quake-compatible r setup alias frame behavior.

ParameterTypeDefaultDescription
framedynamic—The frame input consumed by `R_SetupAliasFrame`.
headerdynamic—The header input consumed by `R_SetupAliasFrame`.

View source

setupAliasFrameAtTime

function setupAliasFrameAtTime(frame, header, time)

Update module state for up alias frame at time.

ParameterTypeDefaultDescription
framedynamic—The frame input consumed by `setupAliasFrameAtTime`.
headerdynamic—The header input consumed by `setupAliasFrameAtTime`.
timedynamic—Simulation or presentation time for the operation.

View source

shadeDotRow

function shadeDotRow(yaw)

Implements the `shadeDotRow` operation for `miniquake.render.alias_mesh` (shade dot row).

ParameterTypeDefaultDescription
yawdynamic—The yaw input consumed by `shadeDotRow`.

View source

shadedots

shadedots

Tracks the module-level shadedots state owned by `miniquake.render.alias_mesh`.

View source

shadelight

shadelight

Tracks the module-level shadelight state owned by `miniquake.render.alias_mesh`.

View source

shadeRow

shadeRow

Tracks the module-level shade row state owned by `miniquake.render.alias_mesh`.

View source

shadevector

shadevector

Tracks the module-level shadevector state owned by `miniquake.render.alias_mesh`.

View source

shadowPointLightActive

shadowPointLightActive

Tracks the module-level shadow point light active state owned by `miniquake.render.alias_mesh`.

View source

shadowPointLightX

shadowPointLightX

Tracks the module-level shadow point light x state owned by `miniquake.render.alias_mesh`.

View source

shadowPointLightY

shadowPointLightY

Tracks the module-level shadow point light y state owned by `miniquake.render.alias_mesh`.

View source

shadowPointLightZ

shadowPointLightZ

Tracks the module-level shadow point light z state owned by `miniquake.render.alias_mesh`.

View source

stripcount

stripcount

Tracks the module-level stripcount state owned by `miniquake.render.alias_mesh`.

View source

StripLength

function StripLength(starttri, startv)

Exact gl_mesh.c candidate-strip walk. Temporary used==2 markers are cleared after each candidate while the starting triangle remains selected.

ParameterTypeDefaultDescription
starttridynamic—The starttri input consumed by `StripLength`.
startvdynamic—The startv input consumed by `StripLength`.

View source

striptris

striptris

Tracks the module-level striptris state owned by `miniquake.render.alias_mesh`.

View source

stripverts

stripverts

Tracks the module-level stripverts state owned by `miniquake.render.alias_mesh`.

View source

stverts

stverts

Tracks the module-level stverts state owned by `miniquake.render.alias_mesh`.

View source

triangles

triangles

Tracks the module-level triangles state owned by `miniquake.render.alias_mesh`.

View source

triangleVertex

function triangleVertex(triangle, index)

Implements the `triangleVertex` operation for `miniquake.render.alias_mesh` (triangle vertex).

ParameterTypeDefaultDescription
triangledynamic—The triangle input consumed by `triangleVertex`.
indexdynamic—Zero-based index of the requested entry.

View source

used

used

Tracks the module-level used state owned by `miniquake.render.alias_mesh`.

View source

vertexorder

vertexorder

Tracks the module-level vertexorder state owned by `miniquake.render.alias_mesh`.

View source