| 440 | } |
| 441 | |
| 442 | void SimulationManager::reconstructImpulseResponses() |
| 443 | { |
| 444 | PROFILE_FUNCTION(); |
| 445 | |
| 446 | mEnergyFieldsForReconstruction.clear(); |
| 447 | mEnergyFieldsForCPUReconstruction.clear(); |
| 448 | mAirAbsorptionModels.clear(); |
| 449 | mImpulseResponses.clear(); |
| 450 | |
| 451 | for (auto& source : mSourceData[0]) |
| 452 | { |
| 453 | if (!source->reflectionInputs.enabled) |
| 454 | continue; |
| 455 | |
| 456 | if (mSceneType == SceneType::RadeonRays && |
| 457 | mIndirectType == IndirectEffectType::TrueAudioNext && |
| 458 | source->reflectionInputs.baked) |
| 459 | { |
| 460 | mEnergyFieldsForCPUReconstruction.push_back(source->reflectionState.accumEnergyField.get()); |
| 461 | } |
| 462 | else |
| 463 | { |
| 464 | mEnergyFieldsForReconstruction.push_back(source->reflectionState.accumEnergyField.get()); |
| 465 | } |
| 466 | |
| 467 | mAirAbsorptionModels.push_back(source->reflectionInputs.airAbsorptionModel); |
| 468 | mImpulseResponses.push_back(source->reflectionState.impulseResponse.get()); |
| 469 | } |
| 470 | |
| 471 | if (mEnergyFieldsForReconstruction.empty() && mEnergyFieldsForCPUReconstruction.empty()) |
| 472 | return; |
| 473 | |
| 474 | if (mSceneType == SceneType::RadeonRays && |
| 475 | mIndirectType == IndirectEffectType::TrueAudioNext && |
| 476 | mEnergyFieldsForCPUReconstruction.size() > 0) |
| 477 | { |
| 478 | mCPUReconstructor->reconstruct(static_cast<int>(mImpulseResponses.size()), mEnergyFieldsForCPUReconstruction.data(), |
| 479 | mDistanceAttenuationCorrectionCurves.data(), mAirAbsorptionModels.data(), |
| 480 | mImpulseResponses.data(), mSharedData->reflection.reconstructionType, |
| 481 | mSharedData->reflection.duration, mSharedData->reflection.order); |
| 482 | } |
| 483 | |
| 484 | if (mEnergyFieldsForReconstruction.size() > 0) |
| 485 | { |
| 486 | mReconstructor->reconstruct(static_cast<int>(mImpulseResponses.size()), mEnergyFieldsForReconstruction.data(), |
| 487 | mDistanceAttenuationCorrectionCurves.data(), mAirAbsorptionModels.data(), |
| 488 | mImpulseResponses.data(), mSharedData->reflection.reconstructionType, |
| 489 | mSharedData->reflection.duration, mSharedData->reflection.order); |
| 490 | } |
| 491 | } |
| 492 | |
| 493 | void SimulationManager::estimateReverb() |
| 494 | { |
nothing calls this directly
no test coverage detected