MiniQuake

src/miniquake/render/gl_warp.ml

Package
miniquake.render.gl_warp
Reachable
Yes

Imports

Declarations

BoundPoly

function BoundPoly(vertices)

Implements the `BoundPoly` operation for `miniquake.render.gl_warp` (bound poly).

ParameterTypeDefaultDescription
verticesdynamic—The vertices input consumed by `BoundPoly`.

View source

CurrentSubdivideSize

function CurrentSubdivideSize()

Return subdivide size.

View source

DEFAULT_SUBDIVIDE_SIZE

const DEFAULT_SUBDIVIDE_SIZE = 128.

Defines the default subdivide size value used by `miniquake.render.gl_warp`.

View source

EmitBothSkyLayers

function EmitBothSkyLayers(polygons, viewOrigin, realtime)

Add both sky layers to the destination state.

ParameterTypeDefaultDescription
polygonsdynamic—The polygons input consumed by `EmitBothSkyLayers`.
viewOrigindynamic—The view origin input consumed by `EmitBothSkyLayers`.
realtimedynamic—Time value used by the operation.

View source

EmitSkyPolys

function EmitSkyPolys(polygons, viewOrigin, currentSpeedScale)

Add sky polys to the destination state.

ParameterTypeDefaultDescription
polygonsdynamic—The polygons input consumed by `EmitSkyPolys`.
viewOrigindynamic—The view origin input consumed by `EmitSkyPolys`.
currentSpeedScaledynamic—The current speed scale input consumed by `EmitSkyPolys`.

View source

EmitWaterPolys

function EmitWaterPolys(polygons, realtime)

Add water polys to the destination state.

ParameterTypeDefaultDescription
polygonsdynamic—The polygons input consumed by `EmitWaterPolys`.
realtimedynamic—Time value used by the operation.

View source

floorValue

function floorValue(value)

Implements the `floorValue` operation for `miniquake.render.gl_warp` (floor value).

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `floorValue`.

View source

gl_subdivide_size

gl_subdivide_size

gl_model.c owns this archived cvar in MiniQuake. Keep its current numeric value at the warp boundary so every subdivision path observes changes made through the console instead of baking the default into generated polygons.

View source

GL_SubdivideSurface

function GL_SubdivideSurface(vertices, sVector, tVector, subdivideSize)

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

ParameterTypeDefaultDescription
verticesdynamic—The vertices input consumed by `GL_SubdivideSurface`.
sVectordynamic—The s vector input consumed by `GL_SubdivideSurface`.
tVectordynamic—The t vector input consumed by `GL_SubdivideSurface`.
subdivideSizedynamic—Size of the requested data or resource.

View source

InterpolatedTurb

function InterpolatedTurb(indexValue)

Interpolate adjacent entries in GLQuake's canonical turbulence table. This preserves the original wave shape while removing visible 256-step texture coordinate jumps in the optional Enhanced presentation.

ParameterTypeDefaultDescription
indexValuedynamic—The index value input consumed by `InterpolatedTurb`.

View source

interpolateVertex

function interpolateVertex(first, second, fraction)

Implements the `interpolateVertex` operation for `miniquake.render.gl_warp` (interpolate vertex).

ParameterTypeDefaultDescription
firstdynamic—The first input consumed by `interpolateVertex`.
seconddynamic—The second input consumed by `interpolateVertex`.
fractiondynamic—The fraction input consumed by `interpolateVertex`.

View source

R_DrawSkyChain

function R_DrawSkyChain(surfacePolygons, viewOrigin, realtime)

Apply the Quake-compatible r draw sky chain behavior.

ParameterTypeDefaultDescription
surfacePolygonsdynamic—The surface polygons input consumed by `R_DrawSkyChain`.
viewOrigindynamic—The view origin input consumed by `R_DrawSkyChain`.
realtimedynamic—Time value used by the operation.

View source

R_InitSky

function R_InitSky(texture, palette)

Apply the Quake-compatible r init sky behavior.

ParameterTypeDefaultDescription
texturedynamic—Texture resource processed by the operation.
palettedynamic—The palette input consumed by `R_InitSky`.

View source

R_InitSkyPixels

function R_InitSkyPixels(texture, palette)

Apply the Quake-compatible r init sky pixels behavior.

ParameterTypeDefaultDescription
texturedynamic—Texture resource processed by the operation.
palettedynamic—The palette input consumed by `R_InitSkyPixels`.

View source

SetSubdivideSize

function SetSubdivideSize(value)

Update module state for subdivide size.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `SetSubdivideSize`.

View source

SkyTexCoords

function SkyTexCoords(position, viewOrigin, currentSpeedScale)

Implements the `SkyTexCoords` operation for `miniquake.render.gl_warp` (sky tex coords).

ParameterTypeDefaultDescription
positiondynamic—Position used by the operation.
viewOrigindynamic—The view origin input consumed by `SkyTexCoords`.
currentSpeedScaledynamic—The current speed scale input consumed by `SkyTexCoords`.

View source

SmoothWaterTexCoords

function SmoothWaterTexCoords(originalS, originalT, realtime)

Return smoothly interpolated water coordinates for the Enhanced profile.

ParameterTypeDefaultDescription
originalSdynamic—The original s input consumed by `SmoothWaterTexCoords`.
originalTdynamic—The original t input consumed by `SmoothWaterTexCoords`.
realtimedynamic—Time value used by the operation.

View source

SubdividePolygon

function SubdividePolygon(vertices, subdivideSize)

Implements the `SubdividePolygon` operation for `miniquake.render.gl_warp` (subdivide polygon).

ParameterTypeDefaultDescription
verticesdynamic—The vertices input consumed by `SubdividePolygon`.
subdivideSizedynamic—Size of the requested data or resource.

View source

subdivideRecursive

function subdivideRecursive(vertices, output, subdivideSize)

Implements the `subdivideRecursive` operation for `miniquake.render.gl_warp` (subdivide recursive).

ParameterTypeDefaultDescription
verticesdynamic—The vertices input consumed by `subdivideRecursive`.
outputdynamic—Destination collection that receives subdivided polygons.
subdivideSizedynamic—Size of the requested data or resource.

View source

SurfaceWarpVertices

function SurfaceWarpVertices(vertices, sVector, tVector)

Implements the `SurfaceWarpVertices` operation for `miniquake.render.gl_warp` (surface warp vertices).

ParameterTypeDefaultDescription
verticesdynamic—The vertices input consumed by `SurfaceWarpVertices`.
sVectordynamic—The s vector input consumed by `SurfaceWarpVertices`.
tVectordynamic—The t vector input consumed by `SurfaceWarpVertices`.

View source

TURBSCALE

const TURBSCALE = 40.7436654315252

Defines the turbscale value used by `miniquake.render.gl_warp`.

View source

turbsin

turbsin

Exact table from gl_warp_sin.h. Looking up this table, rather than calling sin at render time, is observable in texture-coordinate command traces.

View source

warpFloat

function warpFloat(value)

gl_warp.c stores all polygon, direction, and texture-coordinate values in float fields. Explicitly cross the IEEE-754 binary32 boundary at the same assignments so the MiniLang backend cannot retain additional precision.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `warpFloat`.

View source

WaterTexCoords

function WaterTexCoords(originalS, originalT, realtime)

Implements the `WaterTexCoords` operation for `miniquake.render.gl_warp` (water tex coords).

ParameterTypeDefaultDescription
originalSdynamic—The original s input consumed by `WaterTexCoords`.
originalTdynamic—The original t input consumed by `WaterTexCoords`.
realtimedynamic—Time value used by the operation.

View source

WrappedSpeedScale

function WrappedSpeedScale(realtime, speed)

Implements the `WrappedSpeedScale` operation for `miniquake.render.gl_warp` (wrapped speed scale).

ParameterTypeDefaultDescription
realtimedynamic—Time value used by the operation.
speeddynamic—The speed input consumed by `WrappedSpeedScale`.

View source