void SphSystemData2::deserialize(const std::vector<uint8_t>& buffer) { auto fbsSphSystemData = fbs::GetSphSystemData2(buffer.data()); auto base = fbsSphSystemData->base(); deserializeParticleSystemData(base); // SPH specific _targetDensity = fbsSphSystemData->targetDensity(); _targetSpacing = fbsSphSystemData->targetSpacing(); _kernelRadiusOverTargetSpacing = fbsSphSystemData->kernelRadiusOverTargetSpacing(); _kernelRadius = fbsSphSystemData->kernelRadius(); _pressureIdx = static_cast<size_t>(fbsSphSystemData->pressureIdx()); _densityIdx = static_cast<size_t>(fbsSphSystemData->densityIdx()); }
int ConvolutionShader::kernelSize() const { return (2*kernelRadius() + 1)*(2*kernelRadius() + 1); }