Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(code): Gentling the Zoom #10087

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions source/StarField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ void StarField::Draw(const Point &pos, const Point &vel, double zoom, const Syst
bool isParallax = (parallaxSetting == Preferences::BackgroundParallax::FANCY ||
parallaxSetting == Preferences::BackgroundParallax::FAST);

// This slows down the effect of the player's zoom when they go past 0.25 to prevent tiling
Zitchas marked this conversation as resolved.
Show resolved Hide resolved
if(baseZoom < 0.35)
baseZoom = baseZoom + ((0.35 - baseZoom) / 2);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason we're using this scaling in particular instead of a logarithmic curve?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not particularly. I tried a few different formulas until I got one that looked good, and this was it.

I've tried a range of values from 0.4 to 0.2, and found that 0.25 and 0.35 look the best, with the latter being a bit better in my opinion than the former.


// Draw the starfield unless it is disabled in the preferences.
if(Preferences::Has("Draw starfield") && density > 0.)
{
Expand Down
Loading