Scatter hundreads of thousands elements in one draw call budget, on any mesh, with zero GameObjects. Paint density with a black & white texture. Built for WebGL and mobileInfinite Scatter fills any surface with grass, flowers, rocks, debris, etc and lets you decide how much control you want over it.Drop the component on an empty GameObject, point it at a mesh and a prefab, and it scatters thousands of instances across the surface, respecting the density you painted in your mask, and skipping slopes that are too steep. Nothing is instantiated: every blade is a transform matrix rendered through GPU instancing, so your hierarchy stays empty, your draw calls stay in the dozens, and your frame allocates nothing.That makes it a fit for the platforms where traditional vegetation systems fall over: WebGL builds, mobile, and lightweight web-based experiences where a compute-shader solution simply isn't an option.It works on any MeshCollider, terrain meshes, hand-modelled hills, floating islands, cave floors, sloped rooftops and on any prefab with a mesh and a material, so it scatters rocks, flowers, debris and props just as happily as grass.HighlightsGreyscale density mask: paint where the grass grows, and how thickSlope filter: keep blades off cliffs with a single angle valuePer-instance random rotation and scale, aligned to the surface normalZero GameObjects, zero per-frame allocations, zero GC spikesOne component, five fields, no setup wizardFull C# source included, clean and commentedIn this package are also included nature assets and shaders to jumpstart thist tool right away.The shader is ShaderGraph-based and it reacts to wind folding the blades and changes their color according to the wind direction, giving life and vibrance to your scene.Press play on the Sample Scene and take a look!Remember that everything is hand-made and no AI was involved in creating these Prefabs, shaders and texturesInfinite Scatter precomputes a list of Matrix4x4 transforms at startup and submits them to Graphics.DrawMeshInstanced in batches of 1023 instances per call from LateUpdate(). The batch array is allocated once and reused every frame, so steady-state rendering produces no managed allocations and no GC pressure.Placement runs once in Start(). For each attempt, a point is sampled inside the target collider's bounds and raycast straight down onto the surface. A hit is accepted only if the surface normal is within the configured angle tolerance of world up, and if a random draw falls below the greyscale value of the density mask sampled at the hit point's UV. Accepted hits are given a rotation aligned to the surface normal plus a random yaw, a random uniform scale within the configured range, and a 0.01 unit offset along the normal to prevent z-fighting.RequirementsTarget surface: a MeshCollider with valid UV coordinates (UVs are required only if a density mask is used)Source prefab: MeshFilter + MeshRenderer; only submesh 0 and the shared material are usedMaterial with GPU Instancing enabled (the component enables it at runtime and warns if it was off)Density mask: Texture2D imported with Read/Write Enabled ON and Compression set to None (Crunch compression must be off - the pixels are read on the CPU via GetPixel)SpecificationsInstance budget: 5 to 100,000, capped by the inspector rangeDraw calls: ceil(instanceCount / 1023) - 20,000 instances render in 20 draw callsGeneration cost: up to instanceCount × 10 raycasts, paid once on scene loadNamespace: XaosInfiniteScatter; a single MonoBehaviour, no editor dependenciesRender pipeline agnostic: pipeline support comes from the material you supply (Built-in, URP, HDRP)Full, documented C# source. No third-party dependencies, no compute shadersKnown limitationsInstances are generated at runtime, in Play Mode only - there is no Edit Mode previewTransforms are baked in world space: moving the spawner after generation does not move the instancesNo frustum culling and no LOD; every instance is submitted every frame. Split large areas across multiple spawners and disable the distant onesInstances are static once generated, sa the can be edited only through a shader (that I provide)




