Expand description
Port of MD2’s procedural noise textures (plugin.cpp AddNoiseTex / AddNoiseVol,
fCubicInterpolate, dwCubicInterpolate).
MD2 seeds its generator from QueryPerformanceCounter; here every texture is generated
from the renderer’s seeded Rng, so the algorithm (value range, 8-bit packing quirks,
cubic smoothing lattice) is MD2’s and the content is deterministic per seed. To match the
reference render bit-for-bit, inject its dumped noise with Renderer::inject_noise (feature diagnostics).
Sizes (plugin.cpp Init): noise_lq 256/zoom 1, noise_lq_lite 32/1, noise_mq 256/4,
noise_hq 256/8, noisevol_lq 32/1, noisevol_hq 32/4.
Constants§
- ALL_
NOISE - All six textures in
NoiseTex::index()order.
Functions§
- builtin_
image_ noise - The built-in 2D textures projectM’s
TextureManagerhas registered before it scans any directory (TextureManager::Preload): a shape’simage=of exactly one of these names samples it and never reaches the file lookup. (idlem/idleheadphonesare embedded PNGs; the 3Dnoisevol_*volumes bound to a 2D sampler are undefined behaviour upstream.)nameis compared as is: projectM’s lookup is case-sensitive. - gen_
noise_ tex AddNoiseTex:sizexsizeRGBA8, row 0 first.- gen_
noise_ vol AddNoiseVol:size^3 RGBA8, slice (z) major, then row, then x.- generate
- Generate one of the six built-in textures as RGBA8 (2D: row 0 first; 3D: z-major slices).
- noise_
spec (size, zoom_factor, is_volume)for each built-in noise texture.