MiniQuake2

src/miniquake2/renderer/classic/visibility.ml

Provides miniquake2 renderer classic visibility facilities for this project.

Package
miniquake2.renderer.classic.visibility
Reachable
Yes

Imports

Declarations

BACKFACE_EPSILON

const BACKFACE_EPSILON = 1.e-002

Defines the backface epsilon constant used by the miniquake2 renderer classic visibility module.

View source

miniquake2.renderer.classic.visibility.ClassicAlphaOrderState struct

miniquake2.renderer.classic.visibility.ClassicBrushBounds struct

miniquake2.renderer.classic.visibility.ClassicBrushSelection struct

miniquake2.renderer.classic.visibility.ClassicFrustumPlane struct

miniquake2.renderer.classic.visibility.ClassicPvsSelection struct

miniquake2.renderer.classic.visibility.ClassicViewClusters struct

classicVisibilityAngleAxes

function classicVisibilityAngleAxes(angles)

Return the classic visibility angle axes value.

ParameterTypeDefaultDescription
anglesdynamic—angles value consumed by this operation.

View source

classicVisibilityAppendAlphaNode

function classicVisibilityAppendAlphaNode(state, nodeIndex)

Append one BSP node in the order produced when R_RecursiveWorldNode's front-to-back traversal inserts transparent surfaces at the chain head.

ParameterTypeDefaultDescription
statedynamic—Mutable state inspected or updated by the operation.
nodeIndexdynamic—Zero-based index of node.

View source

classicVisibilityAreaAllowed

inline function classicVisibilityAreaAllowed(areaBits, area)

Return the classic visibility area allowed value.

ParameterTypeDefaultDescription
areaBitsdynamic—areaBits value consumed by this operation.
areadynamic—area value consumed by this operation.

View source

classicVisibilityAreaBitsEqual

inline function classicVisibilityAreaBitsEqual(first, second)

Report whether classic visibility area bits equal.

ParameterTypeDefaultDescription
firstdynamic—first value consumed by this operation.
seconddynamic—second value consumed by this operation.

View source

miniquake2.renderer.classic.visibility.ClassicVisibilityAxes struct

classicVisibilityBoxOutsidePlane

inline function classicVisibilityBoxOutsidePlane(draw, plane)

Return the classic visibility box outside plane value.

ParameterTypeDefaultDescription
drawdynamic—draw value consumed by this operation.
planedynamic—plane value consumed by this operation.

View source

classicVisibilityBrushBounds

function classicVisibilityBrushBounds(brushModel, entity)

Return the classic visibility brush bounds.

ParameterTypeDefaultDescription
brushModeldynamic—brushModel value consumed by this operation.
entitydynamic—entity value consumed by this operation.

View source

classicVisibilityBrushLocalView

function classicVisibilityBrushLocalView(entity, viewOrigin)

Return the classic visibility brush local view value.

ParameterTypeDefaultDescription
entitydynamic—entity value consumed by this operation.
viewOrigindynamic—viewOrigin value consumed by this operation.

View source

classicVisibilityBrushModelVisible

function classicVisibilityBrushModelVisible(brushModel, entity, frame)

Report whether classic visibility brush model visible.

ParameterTypeDefaultDescription
brushModeldynamic—brushModel value consumed by this operation.
entitydynamic—entity value consumed by this operation.
framedynamic—frame value consumed by this operation.

View source

classicVisibilityBrushModelVisiblePrepared

function classicVisibilityBrushModelVisiblePrepared(brushModel, entity, planes)

Report whether classic visibility brush model visible in prepared frustum.

ParameterTypeDefaultDescription
brushModeldynamic—brushModel value consumed by this operation.
entitydynamic—entity value consumed by this operation.
planesdynamic—planes value consumed by this operation.

View source

classicVisibilityBrushWorldPoint

function classicVisibilityBrushWorldPoint(entity, localPoint)

Return the classic visibility brush world point value.

ParameterTypeDefaultDescription
entitydynamic—entity value consumed by this operation.
localPointdynamic—localPoint value consumed by this operation.

View source

classicVisibilityCacheSlot

classicVisibilityCacheSlot

Stores module-wide classic visibility cache slot state for the miniquake2 renderer classic visibility module.

View source

miniquake2.renderer.classic.visibility.ClassicVisibilityCacheSlot struct

classicVisibilityCopyAreaBits

function classicVisibilityCopyAreaBits(value)

Copy classic visibility area bits.

ParameterTypeDefaultDescription
valuedynamic—Value consumed or transformed by the operation.

View source

classicVisibilityCulledCount

function classicVisibilityCulledCount(selection)

Return the classic visibility culled count.

ParameterTypeDefaultDescription
selectiondynamic—selection value consumed by this operation.

View source

classicVisibilityFinishSelection

function classicVisibilityFinishSelection(pvs, frame)

Finish classic visibility selection with a compact public array. This keeps the diagnostic API while product rendering avoids the per-frame copy.

ParameterTypeDefaultDescription
pvsdynamic—pvs value consumed by this operation.
framedynamic—frame value consumed by this operation.

View source

classicVisibilityFinishSelectionPrefix

function classicVisibilityFinishSelectionPrefix(pvs, frame)

Finish classic visibility selection into reusable prefix storage. The count is authoritative; live rendering must not scan the unused capacity tail.

ParameterTypeDefaultDescription
pvsdynamic—pvs value consumed by this operation.
framedynamic—frame value consumed by this operation.

View source

classicVisibilityFrontFacing

function classicVisibilityFrontFacing(draw, viewOrigin)

Return the classic visibility front facing value.

ParameterTypeDefaultDescription
drawdynamic—draw value consumed by this operation.
viewOrigindynamic—viewOrigin value consumed by this operation.

View source

classicVisibilityFrontFacingFixed

inline function classicVisibilityFrontFacingFixed(draw, viewX, viewY, viewZ)

Return the classic visibility front facing fixed value.

ParameterTypeDefaultDescription
drawdynamic—draw value consumed by this operation.
viewXdynamic—viewX value consumed by this operation.
viewYdynamic—viewY value consumed by this operation.
viewZdynamic—viewZ value consumed by this operation.

View source

classicVisibilityFrustum

function classicVisibilityFrustum(frame)

Return the classic visibility frustum value.

ParameterTypeDefaultDescription
framedynamic—frame value consumed by this operation.

View source

classicVisibilityFrustumScratch

classicVisibilityFrustumScratch

Stores module-wide classic visibility frustum scratch state for the miniquake2 renderer classic visibility module.

View source

classicVisibilityInsideFrustum

function classicVisibilityInsideFrustum(draw, frame)

Report whether classic visibility inside frustum.

ParameterTypeDefaultDescription
drawdynamic—draw value consumed by this operation.
framedynamic—frame value consumed by this operation.

View source

classicVisibilityInsidePreparedFrustum

inline function classicVisibilityInsidePreparedFrustum(draw, planes)

Report whether classic visibility inside prepared frustum.

ParameterTypeDefaultDescription
drawdynamic—draw value consumed by this operation.
planesdynamic—planes value consumed by this operation.

View source

classicVisibilityMarkLeafFaces

function classicVisibilityMarkLeafFaces(map, leaf, marked)

Mark classic visibility leaf faces.

ParameterTypeDefaultDescription
mapdynamic—map value consumed by this operation.
leafdynamic—leaf value consumed by this operation.
markeddynamic—marked value consumed by this operation.

View source

classicVisibilityPlane

inline function classicVisibilityPlane(normalX, normalY, normalZ, distance)

Return the classic visibility plane value.

ParameterTypeDefaultDescription
normalXdynamic—normalX value consumed by this operation.
normalYdynamic—normalY value consumed by this operation.
normalZdynamic—normalZ value consumed by this operation.
distancedynamic—distance value consumed by this operation.

View source

classicVisibilityPointLeaf

function classicVisibilityPointLeaf(map, origin)

Return the classic visibility point leaf value.

ParameterTypeDefaultDescription
mapdynamic—map value consumed by this operation.
origindynamic—origin value consumed by this operation.

View source

classicVisibilityPvsContains

inline function classicVisibilityPvsContains(row, cluster)

Report whether classic visibility pvs contains.

ParameterTypeDefaultDescription
rowdynamic—row value consumed by this operation.
clusterdynamic—cluster value consumed by this operation.

View source

classicVisibilityPvsRow

function classicVisibilityPvsRow(map, cluster)

Return the classic visibility pvs row value.

ParameterTypeDefaultDescription
mapdynamic—map value consumed by this operation.
clusterdynamic—cluster value consumed by this operation.

View source

classicVisibilitySelectionScratch

classicVisibilitySelectionScratch

Stores module-wide classic visibility selection scratch state for the miniquake2 renderer classic visibility module.

View source

classicVisibilitySelectPvs

function classicVisibilitySelectPvs(world, frame)

Select classic visibility pvs.

ParameterTypeDefaultDescription
worlddynamic—world value consumed by this operation.
framedynamic—frame value consumed by this operation.

View source

classicVisibilitySetPlane

inline function classicVisibilitySetPlane(plane, normalX, normalY, normalZ, distance)

Update one reusable fixed-point frustum plane without allocating a record.

ParameterTypeDefaultDescription
planedynamic—plane value consumed by this operation.
normalXdynamic—normalX value consumed by this operation.
normalYdynamic—normalY value consumed by this operation.
normalZdynamic—normalZ value consumed by this operation.
distancedynamic—distance value consumed by this operation.

View source

classicVisibilitySphereInsideFrustum

function classicVisibilitySphereInsideFrustum(origin, radius, frame)

Test a conservative world-space sphere against the prepared fixed-point frustum. Alias models use this with their current/previous pose union radius so no interpolated vertex can be clipped prematurely.

ParameterTypeDefaultDescription
origindynamic—origin value consumed by this operation.
radiusdynamic—radius value consumed by this operation.
framedynamic—frame value consumed by this operation.

View source

classicVisibilityStockAlphaDraws

function classicVisibilityStockAlphaDraws(world, draws, viewOrigin)

Order visible world alpha polygons exactly like ref_gl's global alpha chain.

ParameterTypeDefaultDescription
worlddynamic—world value consumed by this operation.
drawsdynamic—draws value consumed by this operation.
viewOrigindynamic—viewOrigin value consumed by this operation.

View source

classicVisibilityStockAlphaDrawsPrefix

function classicVisibilityStockAlphaDrawsPrefix(world, draws, drawCount, viewOrigin)

Order a visible alpha prefix using world-owned scratch storage. This is the live equivalent of classicVisibilityStockAlphaDraws without allocating two face tables and an output array on every rendered frame.

ParameterTypeDefaultDescription
worlddynamic—world value consumed by this operation.
drawsdynamic—draws value consumed by this operation.
drawCountdynamic—Number of draw to process.
viewOrigindynamic—viewOrigin value consumed by this operation.

View source

classicVisibilityViewClusters

function classicVisibilityViewClusters(map, origin)

Match R_SetupFrame's second-cluster probe so crossing a solid water boundary exposes both PVS rows instead of popping the opposite side of the surface.

ParameterTypeDefaultDescription
mapdynamic—map value consumed by this operation.
origindynamic—origin value consumed by this operation.

View source

compactClassicDraws

function compactClassicDraws(values, count)

Return the compact classic draws value.

ParameterTypeDefaultDescription
valuesdynamic—values value consumed by this operation.
countdynamic—Number of items or units to process.

View source

selectClassicBrushModel

function selectClassicBrushModel(brushModel, entity, frame)

Select classic brush model.

ParameterTypeDefaultDescription
brushModeldynamic—brushModel value consumed by this operation.
entitydynamic—entity value consumed by this operation.
framedynamic—frame value consumed by this operation.

View source

selectClassicBrushModelPrepared

function selectClassicBrushModelPrepared(brushModel, entity, frame, planes)

Select a classic brush model using the frame-owned frustum and retain the local view point needed by the special-surface planner.

ParameterTypeDefaultDescription
brushModeldynamic—brushModel value consumed by this operation.
entitydynamic—entity value consumed by this operation.
framedynamic—frame value consumed by this operation.
planesdynamic—planes value consumed by this operation.

View source

selectClassicWorld

function selectClassicWorld(world, frame)

Select classic world.

ParameterTypeDefaultDescription
worlddynamic—world value consumed by this operation.
framedynamic—frame value consumed by this operation.

View source

selectClassicWorldCached

function selectClassicWorldCached(world, frame)

Product snapshots carry an area-bit array on every frame even when no door changed. Key the cached candidate list by its contents as well as cluster; treating every non-void array as an override forced a full BSP/PVS scan of roughly 7k surfaces every rendered frame.

ParameterTypeDefaultDescription
worlddynamic—world value consumed by this operation.
framedynamic—frame value consumed by this operation.

View source

selectClassicWorldCachedPrefix

function selectClassicWorldCachedPrefix(world, frame)

Cached product selection retaining the capacity-sized reusable output.

ParameterTypeDefaultDescription
worlddynamic—world value consumed by this operation.
framedynamic—frame value consumed by this operation.

View source

selectClassicWorldPrefix

function selectClassicWorldPrefix(world, frame)

Select the world into reusable prefix storage for live OpenGL submission.

ParameterTypeDefaultDescription
worlddynamic—world value consumed by this operation.
framedynamic—frame value consumed by this operation.

View source

VISIBILITY_DEG_TO_RAD

const VISIBILITY_DEG_TO_RAD = 1.74532925199433e-002

Defines the visibility deg to rad constant used by the miniquake2 renderer classic visibility module.

View source

VISIBILITY_FAR

const VISIBILITY_FAR = 8192.

Defines the visibility far constant used by the miniquake2 renderer classic visibility module.

View source

VISIBILITY_NEAR

const VISIBILITY_NEAR = 4.

Defines the visibility near constant used by the miniquake2 renderer classic visibility module.

View source