Expand description
Warp-mesh geometry and MD2’s per-vertex UV formula (milkdropfs.cpp
CPlugin::ComputeGridAlphaValues, vertex setup in plugin.cpp AllocateMilkDropDX9).
The engine evaluates per-pixel code (if any) for every grid vertex and hands the resulting
variables to warp_vertex_uv; presets without per-pixel code use warp_mesh_uniform.
The result is the warp_uv grid in crate::FrameInput.
Conventions (identical to MD2):
- grid is
(gx+1) x (gy+1)vertices, row-major, row 0 is stored at clip y = -1 (bottom of the screen). UVv = 0is the top of the texture, so row 0 samplesv ~ 1. x/yare clip-space coordinates (x*0.5+0.5/y*-0.5+0.5are the preset-spacex/yseen by per-pixel code, before the aspect correction).
Structs§
- Mesh
Geometry - Static mesh data: vertex positions and MD2’s
rad/angper-vertex attributes. - Vertex
Vars - The ten per-vertex motion variables after (optional) per-pixel code
(
pv_zoom, pv_zoomexp, pv_rot, pv_warp, pv_cx, pv_cy, pv_dx, pv_dy, pv_sx, pv_sy). - Warp
Anim - Warp-animation terms computed once per frame in
ComputeGridAlphaValues.
Constants§
- MAX_
MESH_ CELLS - Largest warp mesh (cells per axis) accepted.
Functions§
- aspect_
xy (m_fAspectX, m_fAspectY)from texture size (plugin.cpp).- texel_
offset_ uv texel_offset(texels) -> UV offset for a texture size, asRenderConfigdefines it.- warp_
mesh_ uniform - The default per-vertex path (no per-pixel code): every vertex uses the same frame variables.
- warp_
vertex_ uv - MD2’s per-vertex UV (the non-blending branch of
ComputeGridAlphaValues).