Skip to content

fix(code): sharper hedgehog rendering on Retina displays#2219

Draft
thmsobrmlr wants to merge 2 commits into
mainfrom
posthog-code/fix-hedgehog-retina-fidelity
Draft

fix(code): sharper hedgehog rendering on Retina displays#2219
thmsobrmlr wants to merge 2 commits into
mainfrom
posthog-code/fix-hedgehog-retina-fidelity

Conversation

@thmsobrmlr
Copy link
Copy Markdown
Contributor

Summary

  • Patch @posthog/hedgehog-mode to use linear instead of nearest texture sampling on sprite sources.
  • On Retina (DPR=2) displays, Pixi's backing buffer is 2x while the source sprites are 80x80, so nearest sampling rendered each texel as a chunky 2x2 block. Linear sampling interpolates, giving a smoother result.
  • Registered under patchedDependencies in pnpm-workspace.yaml; verified the patch applies cleanly on pnpm install.

Tradeoff

This trades the pixel-art crispness for slight softness. If we want to keep the pixel-art aesthetic, the alternative is shipping 2x source sprites upstream.

Test plan

  • On a MacBook Pro Retina display, enable hedgehog mode under Settings → Fun and confirm the hedgehog is no longer blocky.
  • On a standard-DPI display, confirm rendering still looks reasonable.

Generated-By: PostHog Code
Task-Id: 9a2867a2-c109-474c-a88b-393a2023e9f3

Patch @posthog/hedgehog-mode to use linear instead of nearest texture
sampling. Pixi renders at devicePixelRatio, so on Retina the 80x80
source sprites were being upscaled with chunky 2x2 texel blocks.

Generated-By: PostHog Code
Task-Id: 9a2867a2-c109-474c-a88b-393a2023e9f3
Generated-By: PostHog Code
Task-Id: 9a2867a2-c109-474c-a88b-393a2023e9f3
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.

1 participant