Files
src/miniquake/render/ray_shadow.ml
- Package
miniquake.render.ray_shadow- Reachable
- Yes
Imports
Declarations
# acceptProjection
function acceptProjection(index, hit, receiverSurface, fraction, hitX, hitY, hitZ, normalX, normalY, normalZ)
Validate and store one native or scalar ray result with a receiver-normal bias that prevents depth fighting on the actual world polygon.
| Parameter | Type | Default | Description |
|---|
index | dynamic | — | Zero-based index of the requested entry. |
hit | dynamic | — | The hit input consumed by `acceptProjection`. |
receiverSurface | dynamic | — | The receiver surface input consumed by `acceptProjection`. |
fraction | dynamic | — | The fraction input consumed by `acceptProjection`. |
hitX | dynamic | — | The hit x input consumed by `acceptProjection`. |
hitY | dynamic | — | The hit y input consumed by `acceptProjection`. |
hitZ | dynamic | — | The hit z input consumed by `acceptProjection`. |
normalX | dynamic | — | The normal x input consumed by `acceptProjection`. |
normalY | dynamic | — | The normal y input consumed by `acceptProjection`. |
normalZ | dynamic | — | The normal z input consumed by `acceptProjection`. |
View source
# activeMap
activeMap
Tracks the module-level active map state owned by `miniquake.render.ray_shadow`.
View source
# activeRootNode
activeRootNode
Tracks the module-level active root node state owned by `miniquake.render.ray_shadow`.
View source
# activeSurfaces
activeSurfaces
Tracks the module-level active surfaces state owned by `miniquake.render.ray_shadow`.
View source
# beginPrimitive
function beginPrimitive()
Start an independently indexed brush polygon while retaining the current light sample. Alias triangles deliberately share one generation so repeated MDL vertex indexes are traced only once.
View source
# beginProjectionSample
function beginProjectionSample(offsetX, offsetY)
Begin one hard-shadow or area-light sample and invalidate cached projected vertices by advancing a generation counter instead of clearing large arrays.
| Parameter | Type | Default | Description |
|---|
offsetX | dynamic | — | The offset x input consumed by `beginProjectionSample`. |
offsetY | dynamic | — | The offset y input consumed by `beginProjectionSample`. |
View source
# configureAlias
function configureAlias(worldMap, worldSurfaces, entity, model, doubleEyes, lightActive, lightX, lightY, lightZ)
Configure an MDL caster using the exact GLQuake alias transform, including the doubled-eyes compatibility special case.
| Parameter | Type | Default | Description |
|---|
worldMap | dynamic | — | The world map input consumed by `configureAlias`. |
worldSurfaces | dynamic | — | The world surfaces input consumed by `configureAlias`. |
entity | dynamic | — | Entity affected by the operation. |
model | dynamic | — | Model resource processed by the operation. |
doubleEyes | dynamic | — | The double eyes input consumed by `configureAlias`. |
lightActive | dynamic | — | The light active input consumed by `configureAlias`. |
lightX | dynamic | — | The light x input consumed by `configureAlias`. |
lightY | dynamic | — | The light y input consumed by `configureAlias`. |
lightZ | dynamic | — | The light z input consumed by `configureAlias`. |
View source
# configureBrush
function configureBrush(worldMap, worldSurfaces, entity, lightActive, lightX, lightY, lightZ)
Configure an inline or external BSP caster. Brush model vertices are already expressed in model-local world units and use the positive pitch transform.
| Parameter | Type | Default | Description |
|---|
worldMap | dynamic | — | The world map input consumed by `configureBrush`. |
worldSurfaces | dynamic | — | The world surfaces input consumed by `configureBrush`. |
entity | dynamic | — | Entity affected by the operation. |
lightActive | dynamic | — | The light active input consumed by `configureBrush`. |
lightX | dynamic | — | The light x input consumed by `configureBrush`. |
lightY | dynamic | — | The light y input consumed by `configureBrush`. |
lightZ | dynamic | — | The light z input consumed by `configureBrush`. |
View source
# configureCaster
function configureCaster(worldMap, worldSurfaces, entity, scaleX, scaleY, scaleZ, offsetX, offsetY, offsetZ, pitchSign, lightActive, lightX, lightY, lightZ)
Configure common world, entity transform and light state for one caster.
| Parameter | Type | Default | Description |
|---|
worldMap | dynamic | — | The world map input consumed by `configureCaster`. |
worldSurfaces | dynamic | — | The world surfaces input consumed by `configureCaster`. |
entity | dynamic | — | Entity affected by the operation. |
scaleX | dynamic | — | The scale x input consumed by `configureCaster`. |
scaleY | dynamic | — | The scale y input consumed by `configureCaster`. |
scaleZ | dynamic | — | The scale z input consumed by `configureCaster`. |
offsetX | dynamic | — | The offset x input consumed by `configureCaster`. |
offsetY | dynamic | — | The offset y input consumed by `configureCaster`. |
offsetZ | dynamic | — | The offset z input consumed by `configureCaster`. |
pitchSign | dynamic | — | The pitch sign input consumed by `configureCaster`. |
lightActive | dynamic | — | The light active input consumed by `configureCaster`. |
lightX | dynamic | — | The light x input consumed by `configureCaster`. |
lightY | dynamic | — | The light y input consumed by `configureCaster`. |
lightZ | dynamic | — | The light z input consumed by `configureCaster`. |
View source
# ensureNativeWorld
function ensureNativeWorld(worldMap, worldSurfaces)
Upload a triangulated copy of the render BSP once per map. The native bridge builds a CPU BVH; MiniLang retains ownership of caster/light policy and all emitted shadow geometry.
| Parameter | Type | Default | Description |
|---|
worldMap | dynamic | — | The world map input consumed by `ensureNativeWorld`. |
worldSurfaces | dynamic | — | The world surfaces input consumed by `ensureNativeWorld`. |
View source
# ensureVertexCapacity
function ensureVertexCapacity(index)
Grow every parallel vertex cache together so a model vertex index remains a stable key throughout one shadow sample.
| Parameter | Type | Default | Description |
|---|
index | dynamic | — | Zero-based index of the requested entry. |
View source
# hitPacket
hitPacket
Tracks the module-level hit packet state owned by `miniquake.render.ray_shadow`.
View source
# INITIAL_VERTEX_CACHE
const INITIAL_VERTEX_CACHE = 1024
Defines the initial vertex cache value used by `miniquake.render.ray_shadow`.
View source
# isReady
inline function isReady()
Report whether the current caster has a valid render-BSP context.
View source
# MAX_RECEIVER_DISTANCE
const MAX_RECEIVER_DISTANCE = 768.
Defines the max receiver distance value used by `miniquake.render.ray_shadow`.
View source
# minimumHitFraction
minimumHitFraction
Tracks the module-level minimum hit fraction state owned by `miniquake.render.ray_shadow`.
View source
# modelOffsetX
modelOffsetX
Tracks the module-level model offset x state owned by `miniquake.render.ray_shadow`.
View source
# modelOffsetY
modelOffsetY
Tracks the module-level model offset y state owned by `miniquake.render.ray_shadow`.
View source
# modelOffsetZ
modelOffsetZ
Tracks the module-level model offset z state owned by `miniquake.render.ray_shadow`.
View source
# modelScaleX
modelScaleX
Tracks the module-level model scale x state owned by `miniquake.render.ray_shadow`.
View source
# modelScaleY
modelScaleY
Tracks the module-level model scale y state owned by `miniquake.render.ray_shadow`.
View source
# modelScaleZ
modelScaleZ
Tracks the module-level model scale z state owned by `miniquake.render.ray_shadow`.
View source
# nativeWorldReady
nativeWorldReady
Tracks the module-level native world ready state owned by `miniquake.render.ray_shadow`.
View source
# originX
originX
Tracks the module-level origin x state owned by `miniquake.render.ray_shadow`.
View source
# originY
originY
Tracks the module-level origin y state owned by `miniquake.render.ray_shadow`.
View source
# originZ
originZ
Tracks the module-level origin z state owned by `miniquake.render.ray_shadow`.
View source
# pitchCos
pitchCos
Tracks the module-level pitch cos state owned by `miniquake.render.ray_shadow`.
View source
# pitchSin
pitchSin
Tracks the module-level pitch sin state owned by `miniquake.render.ray_shadow`.
View source
# pointLightActive
pointLightActive
Tracks the module-level point light active state owned by `miniquake.render.ray_shadow`.
View source
# pointLightX
pointLightX
Tracks the module-level point light x state owned by `miniquake.render.ray_shadow`.
View source
# pointLightY
pointLightY
Tracks the module-level point light y state owned by `miniquake.render.ray_shadow`.
View source
# pointLightZ
pointLightZ
Tracks the module-level point light z state owned by `miniquake.render.ray_shadow`.
View source
# prepareVertexRay
function prepareVertexRay(index, packedX, packedY, packedZ)
Transform one model vertex and pack its finite light segment for either the native BVH batch or the scalar MiniLang fallback.
| Parameter | Type | Default | Description |
|---|
index | dynamic | — | Zero-based index of the requested entry. |
packedX | dynamic | — | The packed x input consumed by `prepareVertexRay`. |
packedY | dynamic | — | The packed y input consumed by `prepareVertexRay`. |
packedZ | dynamic | — | The packed z input consumed by `prepareVertexRay`. |
View source
# projectAliasVertices
function projectAliasVertices(vertices)
Trace every MDL frame vertex through one native call for the current sample.
| Parameter | Type | Default | Description |
|---|
vertices | dynamic | — | The vertices input consumed by `projectAliasVertices`. |
View source
# projectBrushVertices
function projectBrushVertices(vertices)
Trace every vertex of one BSP caster polygon through one native call.
| Parameter | Type | Default | Description |
|---|
vertices | dynamic | — | The vertices input consumed by `projectBrushVertices`. |
View source
# projectedPointSurface
inline function projectedPointSurface(index)
Return the render-BSP surface reached by one cached native ray.
| Parameter | Type | Default | Description |
|---|
index | dynamic | — | Zero-based index of the requested entry. |
View source
# projectedPointValid
inline function projectedPointValid(index)
Report whether one vertex reached a compatible receiver in this sample.
| Parameter | Type | Default | Description |
|---|
index | dynamic | — | Zero-based index of the requested entry. |
View source
# projectedPointX
inline function projectedPointX(index)
Return one cached projected x coordinate.
| Parameter | Type | Default | Description |
|---|
index | dynamic | — | Zero-based index of the requested entry. |
View source
# projectedPointY
inline function projectedPointY(index)
Return one cached projected y coordinate.
| Parameter | Type | Default | Description |
|---|
index | dynamic | — | Zero-based index of the requested entry. |
View source
# projectedPointZ
inline function projectedPointZ(index)
Return one cached projected z coordinate.
| Parameter | Type | Default | Description |
|---|
index | dynamic | — | Zero-based index of the requested entry. |
View source
# projectionGeneration
projectionGeneration
Tracks the module-level projection generation state owned by `miniquake.render.ray_shadow`.
View source
# projectionNormalX
projectionNormalX
Tracks the module-level projection normal x state owned by `miniquake.render.ray_shadow`.
View source
# projectionNormalY
projectionNormalY
Tracks the module-level projection normal y state owned by `miniquake.render.ray_shadow`.
View source
# projectionNormalZ
projectionNormalZ
Tracks the module-level projection normal z state owned by `miniquake.render.ray_shadow`.
View source
# projectionStamp
projectionStamp
Tracks the module-level projection stamp state owned by `miniquake.render.ray_shadow`.
View source
# projectionSurface
projectionSurface
Tracks the module-level projection surface state owned by `miniquake.render.ray_shadow`.
View source
# projectionTravel
projectionTravel
Tracks the module-level projection travel state owned by `miniquake.render.ray_shadow`.
View source
# projectionValid
projectionValid
Tracks the module-level projection valid state owned by `miniquake.render.ray_shadow`.
View source
# projectionX
projectionX
Tracks the module-level projection x state owned by `miniquake.render.ray_shadow`.
View source
# projectionY
projectionY
Tracks the module-level projection y state owned by `miniquake.render.ray_shadow`.
View source
# projectionZ
projectionZ
Tracks the module-level projection z state owned by `miniquake.render.ray_shadow`.
View source
# projectVertex
function projectVertex(index, packedX, packedY, packedZ)
Project an individual vertex for diagnostics and compatibility callers. The production alias/brush paths use the two batch entry points above.
| Parameter | Type | Default | Description |
|---|
index | dynamic | — | Zero-based index of the requested entry. |
packedX | dynamic | — | The packed x input consumed by `projectVertex`. |
packedY | dynamic | — | The packed y input consumed by `projectVertex`. |
packedZ | dynamic | — | The packed z input consumed by `projectVertex`. |
View source
# rayPacket
rayPacket
Tracks the module-level ray packet state owned by `miniquake.render.ray_shadow`.
View source
# rayPreparedValid
rayPreparedValid
Tracks the module-level ray prepared valid state owned by `miniquake.render.ray_shadow`.
View source
# ready
ready
Tracks the module-level ready state owned by `miniquake.render.ray_shadow`.
View source
# RECEIVER_BIAS
const RECEIVER_BIAS = 0.65
Defines the receiver bias value used by `miniquake.render.ray_shadow`.
View source
# receiverEdgeCompatible
function receiverEdgeCompatible(left, right)
Test one projected edge for a compatible receiver plane and bounded stretch.
| Parameter | Type | Default | Description |
|---|
left | dynamic | — | The left input consumed by `receiverEdgeCompatible`. |
right | dynamic | — | The right input consumed by `receiverEdgeCompatible`. |
View source
# receiverEdgeContinuity
inline function receiverEdgeContinuity(sourceLength, projectedLength, travelDifference)
Reject receiver discontinuities before the rasterizer interpolates a source edge across empty space. The allowance scales with the caster edge so a normal slope remains intact, while an adjacent ledge/floor pair cannot form the long translucent triangles previously visible around crate corners.
| Parameter | Type | Default | Description |
|---|
sourceLength | dynamic | — | Length of the requested data in units appropriate to the operation. |
projectedLength | dynamic | — | Length of the requested data in units appropriate to the operation. |
travelDifference | dynamic | — | The travel difference input consumed by `receiverEdgeContinuity`. |
View source
# receiverSurfaceContinuity
inline function receiverSurfaceContinuity(leftSurface, rightSurface)
Require native ray hits to remain on one concrete BSP receiver polygon. The scalar fallback cannot expose a surface id and retains the geometric normal/stretch checks below, represented by its negative sentinel.
| Parameter | Type | Default | Description |
|---|
leftSurface | dynamic | — | The left surface input consumed by `receiverSurfaceContinuity`. |
rightSurface | dynamic | — | The right surface input consumed by `receiverSurfaceContinuity`. |
View source
# receiverTriangleCompatible
function receiverTriangleCompatible(first, second, third)
Reject a triangle whose rays land across an abrupt BSP corner or stretch far beyond its source edge. Skipping that triangle prevents geometry from being interpolated through a wall between otherwise individually valid hits.
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | The first input consumed by `receiverTriangleCompatible`. |
second | dynamic | — | The second input consumed by `receiverTriangleCompatible`. |
third | dynamic | — | The third input consumed by `receiverTriangleCompatible`. |
View source
# rollCos
rollCos
Tracks the module-level roll cos state owned by `miniquake.render.ray_shadow`.
View source
# rollSin
rollSin
Tracks the module-level roll sin state owned by `miniquake.render.ray_shadow`.
View source
# sampleOffsetX
sampleOffsetX
Tracks the module-level sample offset x state owned by `miniquake.render.ray_shadow`.
View source
# sampleOffsetY
sampleOffsetY
Tracks the module-level sample offset y state owned by `miniquake.render.ray_shadow`.
View source
# sourceX
sourceX
Tracks the module-level source x state owned by `miniquake.render.ray_shadow`.
View source
# sourceY
sourceY
Tracks the module-level source y state owned by `miniquake.render.ray_shadow`.
View source
# sourceZ
sourceZ
Tracks the module-level source z state owned by `miniquake.render.ray_shadow`.
View source
# tracePreparedVertices
function tracePreparedVertices(count)
Trace the prepared prefix as one native BVH batch, falling back to the allocation-free render-BSP walker if the native acceleration is unavailable.
| Parameter | Type | Default | Description |
|---|
count | dynamic | — | Number of entries or units to process. |
View source
# uploadedMapName
uploadedMapName
Tracks the module-level uploaded map name state owned by `miniquake.render.ray_shadow`.
View source
# uploadedSurfaceCount
uploadedSurfaceCount
Tracks the module-level uploaded surface count state owned by `miniquake.render.ray_shadow`.
View source
# worldTrianglePacket
worldTrianglePacket
Tracks the module-level world triangle packet state owned by `miniquake.render.ray_shadow`.
View source
# yawCos
yawCos
Tracks the module-level yaw cos state owned by `miniquake.render.ray_shadow`.
View source
# yawSin
yawSin
Tracks the module-level yaw sin state owned by `miniquake.render.ray_shadow`.
View source