Skip to content

Conversation

@xastor
Copy link

@xastor xastor commented Nov 4, 2024

I have a 2D game where the camera continually moves around, and the fact that the camera rounds its position leads to stuttering.
This change fixes the issue for me, but I also think it is good default behavior to have sub-pixel precision on the camera by default. Maybe I am wrong though? Maybe making this configurable would be better?

@Yanrishatum
Copy link
Contributor

Iirc that rounding was added in order to avoid pixel bleeding during rendering, but it's been 4 years and I don't remember exactly. I would say gate it behind heaps_h2d_enable_camera_rounding / heaps_h2d_enable_camera_rounding define, depending on which default behavior is preferable for Shiro.

@xastor
Copy link
Author

xastor commented Nov 10, 2024

Is this fine for merge? We could also check for heaps_h2d_enable_camera_rounding!=false to have the default behaviour (without a define) to not round.

@rcstuber
Copy link
Contributor

  1. Why introduce a new define if it can be done with a property of Camera?
  2. Default should be what it was until now (rounded) or else bugs will pop up in legacy code

@xastor
Copy link
Author

xastor commented Nov 11, 2024

I have made adjustments. Would this be suitable for merge?

@xastor
Copy link
Author

xastor commented Nov 11, 2024

Removed duplicate code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants