renderer: add generic scalar field color path

This commit is contained in:
OpenAI Codex
2026-09-10 22:41:55 +08:00
parent 9dabb95e44
commit 09ead7f201
10 changed files with 125 additions and 56 deletions

View File

@@ -1077,10 +1077,17 @@ void RenderRasterParticleLayer::update(gfx::ShaderRegistry& shaders,
}
return;
}
// Scalar-only is a valid V3 Core snapshot, but this velocity-only
// renderer stays fail-closed until the V3-03 texture contract exists.
if (formalSource && (!sourceField->hasVector() || !sourceNextField->hasVector())) {
// Particle advection consumes only physical U/V velocity. Scalar-only
// fields and direction vectors are unavailable until V3-04 defines their
// separate advection contract.
if (formalSource && (!sourceField->hasVector() || !sourceNextField->hasVector() ||
sourceField->vectorSemantics != particle::VectorSemantics::Velocity ||
sourceNextField->vectorSemantics != particle::VectorSemantics::Velocity)) {
if (layerGroup) static_cast<LayerGroup&>(*layerGroup).clearDrawables();
if (gpuResources) {
removeTargets(gpuResources->registeredTargets, changes);
gpuResources.reset();
}
return;
}
if (!layerGroup || !isLayerRenderable()) return;