stride3d/stride · error · ArgumentOutOfRangeException
Render Stages required for voxelization, only
Error message
Render Stages required for voxelization, only
What it means
VoxelRenderer.Collect throws ArgumentOutOfRangeException when the number of grouped passes required for a processed voxel volume exceeds the number of configured VoxelStages. Each grouped pass needs its own render stage to write into; fewer stages than passes makes the volume impossible to render. The message reports how many stages are required versus how many were provided.
Solutions
- Add render stages to the VoxelRenderer's VoxelStages list so count >= the number of required grouped passes printed in the message.
- Reduce the number of voxel lights/passes for the volume (e.g. merge or limit lights).
- Validate stage configuration at design time so runtime collection never sees more passes than stages.
Example fix
// before
var renderer = new VoxelRenderer { VoxelStages = { stage1 } }; // volume needs 2 stages
// after
var renderer = new VoxelRenderer { VoxelStages = { stage1, stage2 } }; // at least as many stages as grouped passes Defensive patterns
Strategy: validation
Validate before calling
if (voxelRenderer.VoxelStages.Count < requiredPassCount)
throw new InvalidOperationException("Add more render stages to VoxelRenderer"); Try / catch
try { voxelRenderer.Collect(...); }
catch (ArgumentOutOfRangeException ex) { /* parse required count from message; reconfigure stages */ } Prevention
- Configure at least as many render stages in VoxelStages as grouped passes your volumes need.
- Limit voxel lights per volume to match the stage count.
- Validate renderer configuration in the editor before play.
When it happens
Trigger: A voxel volume whose lights/properties group into more passes than the renderer's VoxelStages list contains (e.g. volume lit by many lights while only 1-2 render stages are configured).
Common situations: Misconfigured VoxelRenderer component with too few render stages for the scene's voxel lights; adding lights to a voxel volume without extending the render stage list; copying a setup from a simpler scene.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- Custom strides is not supported with packed PixelFormats
- Cannot perform this action when the physics engine is set…
- PerView VoxelizerStorer layout differs between different…
- Graphics Profile Level 11 or higher required for…
- No Voxel Volume Component selected for voxel light.
AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14).
Data as JSON: /api/errors/01f5c94b82ae690f.
Report an issue: GitHub.
Appendix: source
Thrown at sources/engine/Stride.Voxels/Voxels/GraphicsCompositor/VoxelRenderer.cs:175
{
processedVolume.groupedPasses[group].Add(passA);
added = true;
break;
}
}
if (!added)
{
List<VoxelizationPass> newGroup = new List<VoxelizationPass>
{
passA
};
processedVolume.groupedPasses.Add(newGroup);
}
}
if (VoxelStages.Count < processedVolume.groupedPasses.Count)
{
throw new ArgumentOutOfRangeException(processedVolume.groupedPasses.Count.ToString() + " Render Stages required for voxelization, only " + VoxelStages.Count.ToString() + " provided.");
}
//Finish preparing the passes, collecting views and setting up shader sources and shadows
for (int group = 0; group < processedVolume.groupedPasses.Count; group++)
{
foreach(var pass in processedVolume.groupedPasses[group])
{
pass.renderStage = VoxelStages[group];
pass.source = pass.storer.GetVoxelizationShader(pass, processedVolume);
pass.view.RenderStages.Add(pass.renderStage);
Context.RenderSystem.Views.Add(pass.view);
Context.VisibilityGroup.TryCollect(pass.view);
if (pass.requireShadows)
{
ShadowMapRenderer?.RenderViewsWithShadows.Add(pass.view);
}View on GitHub (pinned to 96fad776d2)