Skip to content

Commit

Permalink
Adjust distant-based scaling of sound visualizations
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkrupinski committed Dec 1, 2023
1 parent 66c59de commit f57f73a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/FeatureHelpers/Sound/SoundVisualization.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

template <typename SoundType>
struct SoundVisualization {
[[nodiscard]] static constexpr float getScale(float clipSpaceZ) noexcept
[[nodiscard]] static constexpr float getScale(float z) noexcept
{
return (std::max)(1.0f - clipSpaceZ / 1000.0f, SoundType::kMinScale);
constexpr auto kMaxScale{1.0f};
return std::clamp(500.0f / (z + 400.0f), SoundType::kMinScale, kMaxScale);
}

[[nodiscard]] static constexpr float getOpacity(float timeAlive) noexcept
Expand Down

0 comments on commit f57f73a

Please sign in to comment.