playcanvas / playcanvas/engine
Support 9-slice and pixel-perfect on UI custom shader example
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
Description
The current UI custom shader example uses this line to generate screen position of the vertex: https://github.com/playcanvas/engine/blob/ab73ebbf1c9eda8a41aca73eb2336b8b33f412be/examples/src/examples/user-interface/custom-shader.tsx#L32 which is based on this line: https://github.com/playcanvas/engine/blob/ab73ebbf1c9eda8a41aca73eb2336b8b33f412be/src/graphics/program-lib/chunks/transform.vert.js#L86
Perhaps it would be better to have it support 9-slice and pixel-perfect use-cases too. This might be easier to do once standard refactoring is done.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with examples/src/examples/user-interface/custom-shader.tsx at the screen-position calculation and compare it with src/graphics/program-lib/chunks/transform.vert.js. Read the surrounding transform logic and any standard refactoring related to these paths first. Done means the custom shader example supports both 9-slice and pixel-perfect UI use cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100