Skip to content

Commit da17216

Browse files
committed
feat: first release
1 parent 9e453de commit da17216

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+5213
-61
lines changed

Packages/manifest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"com.coffee.development": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/Development",
44
"com.coffee.nano-monitor": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/NanoMonitor",
55
"com.unity.ide.rider": "3.0.34",
6-
"com.unity.render-pipelines.universal": "12.1.12",
76
"com.unity.test-framework": "1.1.33"
87
}
98
}

Packages/packages-lock.json

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,6 @@
2424
"com.unity.ugui": "1.0.0"
2525
}
2626
},
27-
"com.unity.burst": {
28-
"version": "1.8.4",
29-
"depth": 1,
30-
"source": "registry",
31-
"dependencies": {
32-
"com.unity.mathematics": "1.2.1"
33-
},
34-
"url": "https://packages.unity.com"
35-
},
3627
"com.unity.ext.nunit": {
3728
"version": "1.0.6",
3829
"depth": 1,
@@ -49,50 +40,6 @@
4940
},
5041
"url": "https://packages.unity.com"
5142
},
52-
"com.unity.mathematics": {
53-
"version": "1.2.6",
54-
"depth": 1,
55-
"source": "registry",
56-
"dependencies": {},
57-
"url": "https://packages.unity.com"
58-
},
59-
"com.unity.render-pipelines.core": {
60-
"version": "12.1.12",
61-
"depth": 1,
62-
"source": "builtin",
63-
"dependencies": {
64-
"com.unity.ugui": "1.0.0",
65-
"com.unity.modules.physics": "1.0.0",
66-
"com.unity.modules.jsonserialize": "1.0.0"
67-
}
68-
},
69-
"com.unity.render-pipelines.universal": {
70-
"version": "12.1.12",
71-
"depth": 0,
72-
"source": "builtin",
73-
"dependencies": {
74-
"com.unity.mathematics": "1.2.1",
75-
"com.unity.burst": "1.8.4",
76-
"com.unity.render-pipelines.core": "12.1.12",
77-
"com.unity.shadergraph": "12.1.12"
78-
}
79-
},
80-
"com.unity.searcher": {
81-
"version": "4.9.1",
82-
"depth": 2,
83-
"source": "registry",
84-
"dependencies": {},
85-
"url": "https://packages.unity.com"
86-
},
87-
"com.unity.shadergraph": {
88-
"version": "12.1.12",
89-
"depth": 1,
90-
"source": "builtin",
91-
"dependencies": {
92-
"com.unity.render-pipelines.core": "12.1.12",
93-
"com.unity.searcher": "4.9.1"
94-
}
95-
},
9643
"com.unity.test-framework": {
9744
"version": "1.1.33",
9845
"depth": 0,
@@ -125,12 +72,6 @@
12572
"source": "builtin",
12673
"dependencies": {}
12774
},
128-
"com.unity.modules.physics": {
129-
"version": "1.0.0",
130-
"depth": 2,
131-
"source": "builtin",
132-
"dependencies": {}
133-
},
13475
"com.unity.modules.ui": {
13576
"version": "1.0.0",
13677
"depth": 2,

Packages/src/.coffee.internal.sed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
s/Coffee.Internal/Coffee.UIDynamicSamplerInternal/g

Packages/src/.releaserc.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"branches": [
3+
"main",
4+
"[0-9]+.x",
5+
{
6+
"name": "preview",
7+
"prerelease": true
8+
}
9+
],
10+
"tagFormat": "${version}",
11+
"plugins": [
12+
"@semantic-release/commit-analyzer",
13+
"@semantic-release/release-notes-generator",
14+
"@semantic-release/changelog",
15+
[
16+
"@semantic-release/npm",
17+
{
18+
"npmPublish": false
19+
}
20+
],
21+
"@semantic-release/git",
22+
"@semantic-release/github"
23+
]
24+
}

Packages/src/CHANGELOG.md

Whitespace-only changes.

Packages/src/CHANGELOG.md.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Packages/src/LICENSE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2025 mob-sakai
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Packages/src/LICENSE.md.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Packages/src/README.md

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
# <img height="26" src="https://github.com/user-attachments/assets/89d75386-0fbb-43d7-81e8-df6e5339213a"/> UI Dynamic Sampler <!-- omit in toc -->
2+
3+
[![](https://img.shields.io/npm/v/com.coffee.ui-dynamic-sampler?label=openupm&registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.coffee.ui-dynamic-sampler/)
4+
[![](https://img.shields.io/github/v/release/mob-sakai/UIDynamicSampler?include_prereleases)](https://github.com/mob-sakai/UIDynamicSampler/releases)
5+
[![](https://img.shields.io/github/release-date/mob-sakai/UIDynamicSampler.svg)](https://github.com/mob-sakai/UIDynamicSampler/releases)
6+
![](https://img.shields.io/badge/Unity-2020.3+-57b9d3.svg?style=flat&logo=unity)
7+
![](https://img.shields.io/badge/Unity-6000.0+-57b9d3.svg?style=flat&logo=unity)
8+
[![](https://img.shields.io/github/license/mob-sakai/UIDynamicSampler.svg)](https://github.com/mob-sakai/UIDynamicSampler/blob/main/LICENSE.md)
9+
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-orange.svg)](http://makeapullrequest.com)
10+
[![](https://img.shields.io/github/watchers/mob-sakai/UIDynamicSampler.svg?style=social&label=Watch)](https://github.com/mob-sakai/UIDynamicSampler/subscription)
11+
[![](https://img.shields.io/twitter/follow/mob_sakai.svg?label=Follow&style=social)](https://twitter.com/intent/follow?screen_name=mob_sakai)
12+
13+
<< [📝 Description](#-description-) | [📌 Key Features](#-key-features) | [🎮 Demo](#-demo) | [⚙ Installation](#-installation) | [🚀 Usage](#-usage) | [🤝 Contributing](#-contributing) >>
14+
15+
## 📝 Description <!-- omit in toc -->
16+
17+
This package provides a component to reduce jaggies in UI elements.
18+
19+
For example, when displaying a 2048x2048 texture at just 100x100 pixels, diagonal lines may appear jagged.
20+
This effect is particularly noticeable on low-DPI displays (such as standard non-Retina screens) where individual pixels are more visible.
21+
22+
![](https://github.com/user-attachments/assets/7eb7527e-5a08-417b-907d-2f94dda7d592)
23+
24+
In such cases, jaggies can be reduced by generating a thumbnail texture that matches the display size or by using mipmaps.
25+
However, these approaches increase asset size and complicate asset management.
26+
Moreover, depending on the UI element's size, these approaches may cause blurring or fail to sufficiently reduce jaggies.
27+
28+
![](https://github.com/user-attachments/assets/042dcf2b-7220-47d6-9864-7c1bb59a9a2b)
29+
30+
The `UIDynamicSampler` component dynamically pre-samples textures based on the current UI element size, effectively reducing jaggies without increasing asset size.
31+
Additionally, it caches sampling results to maintain performance.
32+
33+
![](https://github.com/user-attachments/assets/804b5995-1dd3-4569-a1b5-3e9030818c3b)
34+
35+
- [📌 Key Features](#-key-features)
36+
- [🎮 Demo](#-demo)
37+
- [⚙ Installation](#-installation)
38+
- [Install via OpenUPM](#install-via-openupm)
39+
- [Install via UPM (with Package Manager UI)](#install-via-upm-with-package-manager-ui)
40+
- [Install via UPM (Manually)](#install-via-upm-manually)
41+
- [Install as Embedded Package](#install-as-embedded-package)
42+
- [🚀 Usage](#-usage)
43+
- [Getting Started](#getting-started)
44+
- [🤝 Contributing](#-contributing)
45+
- [Issues](#issues)
46+
- [Pull Requests](#pull-requests)
47+
- [Support](#support)
48+
- [License](#license)
49+
- [Author](#author)
50+
- [See Also](#see-also)
51+
52+
<br><br>
53+
54+
## 📌 Key Features
55+
56+
- **Real-time anti-jaggies for uGUI**: Dynamically samples textures based on UI element size to reduce jaggies.
57+
- **No Increase in Asset Size**: Performs sampling dynamically, eliminating the need for additional thumbnails or mipmaps, keeping asset management simple.
58+
- **High Performance with Caching**: Caches sampling results to reduce unnecessary computations.
59+
- **Improved Visibility on Low-DPI Displays**: Provides clearer rendering even on lower-resolution screens where jaggies are more noticeable.
60+
- **Easy to Use**: Simply add the `UIDynamicSampler` component to apply the effect.
61+
62+
<br><br>
63+
64+
## 🎮 Demo
65+
66+
![](https://github.com/user-attachments/assets/ed4393d2-276e-4672-b9c7-bd450d1219d5)
67+
68+
[WebGL Demo](https://mob-sakai.github.io/UIDynamicSampler/)
69+
70+
<br><br>
71+
72+
## ⚙ Installation
73+
74+
_This package requires **Unity 2020.3 or later**._
75+
76+
### Install via OpenUPM
77+
78+
- This package is available on [OpenUPM](https://openupm.com/packages/com.coffee.ui-dynamic-sampler/) package
79+
registry.
80+
- This is the preferred method of installation, as you can easily receive updates as they're released.
81+
- If you have [openupm-cli](https://github.com/openupm/openupm-cli) installed, then run the following command in your
82+
project's directory:
83+
```
84+
openupm add com.coffee.ui-dynamic-sampler
85+
```
86+
- To update the package, use Package Manager UI (`Window > Package Manager`) or run the following command with
87+
`@{version}`:
88+
```
89+
openupm add com.coffee.ui-dynamic-sampler@1.0.0
90+
```
91+
92+
### Install via UPM (with Package Manager UI)
93+
94+
- Click `Window > Package Manager` to open Package Manager UI.
95+
- Click `+ > Add package from git URL...` and input the repository URL:
96+
`https://github.com/mob-sakai/UIDynamicSampler.git?path=Packages/src`
97+
![](https://github.com/user-attachments/assets/f88f47ad-c606-44bd-9e86-ee3f72eac548)
98+
- To update the package, change suffix `#{version}` to the target version.
99+
- e.g. `https://github.com/mob-sakai/UIDynamicSampler.git?path=Packages/src#1.0.0`
100+
101+
### Install via UPM (Manually)
102+
103+
- Open the `Packages/manifest.json` file in your project. Then add this package somewhere in the `dependencies` block:
104+
```json
105+
{
106+
"dependencies": {
107+
"com.coffee.ui-dynamic-sampler": "https://github.com/mob-sakai/UIDynamicSampler.git?path=Packages/src",
108+
...
109+
}
110+
}
111+
```
112+
113+
- To update the package, change suffix `#{version}` to the target version.
114+
- e.g.
115+
`"com.coffee.ui-dynamic-sampler": "https://github.com/mob-sakai/UIDynamicSampler.git?path=Packages/src#1.0.0",`
116+
117+
### Install as Embedded Package
118+
119+
1. Download the `Source code (zip)` file from [Releases](https://github.com/mob-sakai/UIDynamicSampler/releases) and
120+
extract it.
121+
2. Move the `<extracted_dir>/Packages/src` directory into your project's `Packages` directory.
122+
![](https://github.com/user-attachments/assets/187cbcbe-5922-4ed5-acec-cf19aa17d208)
123+
- You can rename the `src` directory if needed.
124+
- If you intend to fix bugs or add features, installing it as an embedded package is recommended.
125+
- To update the package, re-download it and replace the existing contents.
126+
127+
<br><br>
128+
129+
## 🚀 Usage
130+
131+
### Getting Started
132+
133+
1. [Install the package](#-installation).
134+
135+
2. Add a `UIDynamicSampler` component to a UI element (Image, RawImage) from the
136+
`Add Component` in the inspector or `Component > UI > UIDynamicSampler` menu.
137+
![](https://github.com/user-attachments/assets/d4c886c5-d4bb-47fa-b5ad-f65cc765a0e5)
138+
139+
3. Compare how jaggies appear in low DPI display environments.
140+
![](https://github.com/user-attachments/assets/c61a5cde-f67c-43d1-a31c-cfe86cb3a556)
141+
142+
4. Enjoy!
143+
144+
<br><br>
145+
146+
## 🤝 Contributing
147+
148+
### Issues
149+
150+
Issues are incredibly valuable to this project:
151+
152+
- Ideas provide a valuable source of contributions that others can make.
153+
- Problems help identify areas where this project needs improvement.
154+
- Questions indicate where contributors can enhance the user experience.
155+
156+
### Pull Requests
157+
158+
Pull requests offer a fantastic way to contribute your ideas to this repository.
159+
Please refer to [CONTRIBUTING.md](https://github.com/mob-sakai/UIDynamicSampler/tree/develop/CONTRIBUTING.md)
160+
and [develop branch](https://github.com/mob-sakai/UIDynamicSampler/tree/develop).
161+
162+
### Support
163+
164+
This is an open-source project developed during my spare time.
165+
If you appreciate it, consider supporting me.
166+
Your support allows me to dedicate more time to development. 😊
167+
168+
[![](https://user-images.githubusercontent.com/12690315/66942881-03686280-f085-11e9-9586-fc0b6011029f.png)](https://github.com/users/mob-sakai/sponsorship)
169+
[![](https://user-images.githubusercontent.com/12690315/50731629-3b18b480-11ad-11e9-8fad-4b13f27969c1.png)](https://www.patreon.com/join/2343451?)
170+
171+
<br><br>
172+
173+
## License
174+
175+
* MIT
176+
177+
## Author
178+
179+
* ![](https://user-images.githubusercontent.com/12690315/96986908-434a0b80-155d-11eb-8275-85138ab90afa.png) [mob-sakai](https://github.com/mob-sakai) [![](https://img.shields.io/twitter/follow/mob_sakai.svg?label=Follow&style=social)](https://twitter.com/intent/follow?screen_name=mob_sakai) ![GitHub followers](https://img.shields.io/github/followers/mob-sakai?style=social)
180+
181+
## See Also
182+
183+
* GitHub page : https://github.com/mob-sakai/UIDynamicSampler
184+
* Releases : https://github.com/mob-sakai/UIDynamicSampler/releases
185+
* Issue tracker : https://github.com/mob-sakai/UIDynamicSampler/issues
186+
* Change log : https://github.com/mob-sakai/UIDynamicSampler/blob/main/Packages/src/CHANGELOG.md

Packages/src/README.md.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)