playcanvas / playcanvas/engine

Tile Sprites render incorrectly when pixels per unit is low and margins are small

Open
#4,213 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: sprites
Dominant language
JavaScript
Stars
16.8k
Forks
2k
Avg merge
4h 32m
Merged PRs (30d)
222

Description

Project: https://playcanvas.com/project/919232/overview/tiled-sprite-project

When the pixles per unit is 1 and the margins are close or the same as the boundary of the sprite, the mesh is larger than the sprite bounds

eg
image
image

Renders like this:
image

Whereas a sprite with the boundaries
image

Renders correctly
image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the linked tiled-sprite project using pixels per unit of 1 and margins near the sprite boundary. Trace the tile-sprite mesh generation and verify that the mesh bounds match the sprite bounds in the failing case while preserving the correctly rendered boundary case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.