Sets per-entity quad ray spread factor (creates volumetric cone/frustum, 1.0=parallel, >1.0=spreading, <1.0=converging). Takes quadrayEntity (quad ray source entity handle), spreadFactor (spread multiplier, clamped minimum 0.1, default 1.0). Returns nothing. Sets entity.quadRaySpreadFactor (per-entity spread parameter, applied in ray tracing shader). Use to create spotlight cone effect (spreadFactor >1.0 for expanding rays), parallel rays (spreadFactor 1.
Sets per-entity quad ray spread factor (creates volumetric cone/frustum, 1.0=parallel, >1.0=spreading, <1.0=converging). Takes quadrayEntity (quad ray source entity handle), spreadFactor (spread multiplier, clamped minimum 0.1, default 1.0). Returns nothing. Sets entity.quadRaySpreadFactor (per-entity spread parameter, applied in ray tracing shader). Use to create spotlight cone effect (spreadFactor >1.0 for expanding rays), parallel rays (spreadFactor 1.0 for uniform god rays), or converging beams (spreadFactor <1.0 for focusing rays, unusual effect). Spread factor: 1.0 = parallel rays (default, rays remain same width along length, typical god rays), >1.0 = spreading cone (rays expand outward, spotlight/flashlight effect), <1.0 = converging rays (rays narrow inward, unusual focusing effect, like reverse spotlight). Clamped minimum: values <0.1 clamped to 0.1 (prevents extreme convergence, ensures visible rays). Per-entity setting: each quad ray source has independent spread (customize per light, sun parallel 1.0 while spotlight spreading 2.0), applied in shader (ray width multiplied by spreadFactor along trace length). Use cases: (1) Spotlight cone (spreadFactor 1.5-2.5 for expanding flashlight or stage light cone), (2) Parallel god rays (spreadFactor 1.0 for uniform sunlight beams, no spreading), (3) Narrow beam (spreadFactor 0.8-0.95 for slightly converging laser-like beam), (4) Wide volumetric cone (spreadFactor 3.0+ for very wide spotlight effect), (5) Animated spread (animate spreadFactor 1.0-2.0 for breathing spotlight effect). Common patterns: sunlight = spreadFactor 1.0 parallel rays; flashlight = spreadFactor 1.8 expanding cone; laser = spreadFactor 0.9 narrow beam; wide spotlight = spreadFactor 2.5 large cone. Typical values: converging 0.5-0.95 (narrowing rays, unusual effect), parallel 0.95-1.05 (uniform rays, default), spreading 1.1-2.0 (moderate cone, typical spotlight), wide 2.0-4.0 (large cone, wide area light), extreme 4.0+ (very wide, unusual effect). Spread calculation: ray width at distance d = baseWidth * (1.0 + (spreadFactor - 1.0) * d / rayLength) where baseWidth from occlusion silhouette, linear expansion over distance. Interaction with direction: direction sets ray casting angle (where rays point), spread affects ray width (how much rays expand/contract), combine both (set direction for beam angle, set spread for cone shape). Interaction with source mesh: mesh size affects base ray width (larger mesh = wider base, spreadFactor scales from there), mesh shape affects ray origin (complex mesh = varied ray origins, spread applied uniformly). Validation: only affects isQuadRaySource entities (non-quad-ray entities ignored), silent if entity not found (invalid handle no-op), automatic minimum clamping (spreadFactor <0.1 clamped to 0.1 prevents extreme values). Related: b3dLoadQuadRayMesh creates quad ray source (load mesh, then configure spread), b3dSetQuadRayDirection sets ray direction (direction combined with spread for angled cone), b3dScaleEntity scales mesh (affects base ray width, spread multiplies from scaled size), b3dSetQuadRaysLength sets ray length (spread expands over this distance, longer length = more visible spread).