{"id":15722606,"url":"https://github.com/indiesoftby/defold-sharp-sprite","last_synced_at":"2025-10-10T10:41:03.177Z","repository":{"id":194657439,"uuid":"313368935","full_name":"indiesoftby/defold-sharp-sprite","owner":"indiesoftby","description":"Rotated Grid Super-Sampling (RGSS) for the Defold engine.","archived":false,"fork":false,"pushed_at":"2025-06-10T19:43:44.000Z","size":22648,"stargazers_count":63,"open_issues_count":1,"forks_count":4,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-06-10T20:40:55.239Z","etag":null,"topics":["defold","defold-game-engine","defold-library","defold-shaders"],"latest_commit_sha":null,"homepage":"https://indiesoftby.github.io/defold-sharp-sprite/","language":"GLSL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/indiesoftby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-11-16T16:55:14.000Z","updated_at":"2025-06-04T17:57:36.000Z","dependencies_parsed_at":"2023-09-14T13:44:44.506Z","dependency_job_id":"f8573789-388e-4dfe-bd94-6bee0ab0cf9b","html_url":"https://github.com/indiesoftby/defold-sharp-sprite","commit_stats":null,"previous_names":["indiesoftby/defold-sharp-sprite"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/indiesoftby/defold-sharp-sprite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indiesoftby%2Fdefold-sharp-sprite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indiesoftby%2Fdefold-sharp-sprite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indiesoftby%2Fdefold-sharp-sprite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indiesoftby%2Fdefold-sharp-sprite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indiesoftby","download_url":"https://codeload.github.com/indiesoftby/defold-sharp-sprite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indiesoftby%2Fdefold-sharp-sprite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003545,"owners_count":26083595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["defold","defold-game-engine","defold-library","defold-shaders"],"created_at":"2024-10-03T22:08:38.517Z","updated_at":"2025-10-10T10:41:03.171Z","avatar_url":"https://github.com/indiesoftby.png","language":"GLSL","funding_links":[],"categories":["Libraries"],"sub_categories":["Programming Language"],"readme":"[![Sharp Sprite Logo](cover.png)](https://github.com/indiesoftby/defold-sharp-sprite)\n\n# Sharp Sprite - RGSS for Defold\n\nSharp Sprite is the implementation of *Rotated Grid Super-Sampling (RGSS)* for the [Defold](https://defold.com/) engine. If you use down-scaled high-resolution images in your game and you want to get rid of blurriness (because of mipmapping) or sharpness (because of disabled mipmapping), then RGSS is for you.\n\n![RGSS vs Builtin](demo2.gif)\n\nHow does it work? RGSS samples the texture multiple times with an offset on each sample and averages the results. For this, it uses a 4x MSAA rotated grid pattern, sometimes called 4 rooks.\n\nThe second solution, that included in this repo, uses *mip biasing*. Mip biasing tells the GPU to adjust what mip level to use. The shaders use mip bias of -1.0 that pushes the mip level one full mip back to make 2D sprites look much sharper.\n\nAlso, **[check out the demo](https://indiesoftby.github.io/defold-sharp-sprite/)**. Feel free to ask questions [in the Defold forum topic](https://forum.defold.com/t/sharp-sprite-rgss-for-defold/66840).\n\n## Installation\n\nYou can use it in your own project by adding this project as a [Defold library dependency](http://www.defold.com/manuals/libraries/). Open your `game.project` file and in the dependencies field under project add the ZIP file of a [specific release](https://github.com/indiesoftby/defold-sharp-sprite/releases).\n\nSharp Sprite contains a collection of materials that are a drop-in replacement for the standard 2D materials:\n- **Mipmap Bias -1.0**: almost as fast as the standard materials. Use this first. If it fits your project well, keep it and don't try RGSS at all. Not suitable, if you use Slice-9 (will blur around the edges).\n- **RGSS**: slow, and requires OES_standard_derivatives (see below), and doesn't require mipmaps.\n- **RGSS Mipmap Bias -1.0**: faster than RGSS, but requires mipmaps. Not suitable, if you use Slice-9 (will blur around the edges).\n\n\u003e [!IMPORTANT]\n\u003e Materials \"Mipmap Bias -1.0\" and \"RGSS Mipmap Bias -1.0\" require mipmaps in your game textures. To use them, you need to create your own texture profile with mipmap generation enabled and set it in your `game.project` file. You can find an example texture profile with mipmaps in the `demo` folder of this project.\n\n### Mipmap Bias -1.0\n\n| Type | Defold Material | Sharp Sprite Material |\n| ---- | --------------- | --------------------- |\n| GUI  | `/builtins/materials/gui.material` | `/sharp_sprite/mipmap_bias/materials/gui.material` |\n| ParticleFX  | `/builtins/materials/particlefx.material` | `/sharp_sprite/mipmap_bias/materials/particlefx.material` |\n| Spine  | `/defold-spine/assets/spine.material` | `/sharp_sprite/mipmap_bias/materials/spine.material` |\n| Sprite  | `/builtins/materials/sprite.material` | `/sharp_sprite/mipmap_bias/materials/sprite.material` |\n| Tilemap  | `/builtins/materials/tile_map.material` | `/sharp_sprite/mipmap_bias/materials/tile_map.material` |\n\n### RGSS\n\n| Type | Defold Material | Sharp Sprite Material |\n| ---- | --------------- | --------------------- |\n| GUI  | `/builtins/materials/gui.material` | `/sharp_sprite/rgss/materials/gui.material` |\n| ParticleFX  | `/builtins/materials/particlefx.material` | `/sharp_sprite/rgss/materials/particlefx.material` |\n| Spine  | `/defold-spine/assets/spine.material` | `/sharp_sprite/rgss/materials/spine.material` |\n| Sprite  | `/builtins/materials/sprite.material` | `/sharp_sprite/rgss/materials/sprite.material` |\n| Tilemap  | `/builtins/materials/tile_map.material` | `/sharp_sprite/rgss/materials/tile_map.material` |\n| Font (Bitmap)  | `/builtins/fonts/font.material` | `/sharp_sprite/rgss/fonts/font.material` or `/sharp_sprite/rgss/fonts/font-singlelayer.material` |\n| Font (BMFont)  | `/builtins/fonts/font-fnt.material` | `/sharp_sprite/rgss/fonts/font-fnt.material` |\n| Label (Bitmap)  | `/builtins/fonts/label.material` | `/sharp_sprite/rgss/fonts/label.material` or `/sharp_sprite/rgss/fonts/label-singlelayer.material` |\n| Label (BMFont)  | `/builtins/fonts/label-fnt.material` | `/sharp_sprite/rgss/fonts/label-fnt.material` |\n\n### RGSS Mipmap Bias -1.0\n\n| Type | Defold Material | Sharp Sprite Material |\n| ---- | --------------- | --------------------- |\n| GUI  | `/builtins/materials/gui.material` | `/sharp_sprite/rgss_bias/materials/gui.material` |\n| ParticleFX  | `/builtins/materials/particlefx.material` | `/sharp_sprite/rgss_bias/materials/particlefx.material` |\n| Spine  | `/defold-spine/assets/spine.material` | `/sharp_sprite/rgss_bias/materials/spine.material` |\n| Sprite  | `/builtins/materials/sprite.material` | `/sharp_sprite/rgss_bias/materials/sprite.material` |\n| Tilemap  | `/builtins/materials/tile_map.material` | `/sharp_sprite/rgss_bias/materials/tile_map.material` |\n\n## Notes\n\n- If you use Slice-9 in GUI or for sprites, **use `RGSS` material in that case**, i.e. without mipmaps.\n- RGSS requires the [OES_standard_derivatives](https://www.khronos.org/registry/OpenGL/extensions/OES/OES_standard_derivatives.txt) OpenGL extension to run. It's universally supported by OpenGL, OpenGL ES 3.0, WebGL 2.0, by the most of OpenGL ES 2.0 and WebGL 1.0 devices ([Android stats](https://opengles.gpuinfo.org/listreports.php?extension=GL_OES_standard_derivatives) and by all [iOS devices](https://developer.apple.com/library/archive/documentation/OpenGLES/Conceptual/OpenGLESHardwarePlatformGuide_iOS/OpenGLESPlatforms/OpenGLESPlatforms.html)). But the shaders will work, even if derivatives are missing.\n- RGSS is sampling the texture 4 times. On mobile GPUs, it can have a significant performance impact. You should always check the game performance on your target devices!\n- RGSS is blurring at 1:1 scaling.\n- RGSS doesn't use mipmapped textures. You can turn off the mipmapping in your texture profile and save 30% of disk space.\n- RGSS can be used with mipmap bias -1.0 to get the best quality.\n- If your sprites use both Defold standard and Sharp Sprite materials, then it's a good idea to split them by tags to avoid breaking of draw batching:\n   1. Copy Sharp Sprite material to your project and [apply tag `tile_rgss` into it.](tile_rgss_1.png)\n   2. [Modify your render script to draw the tagged sprites.](tile_rgss_2.png)\n\n## Credits\n\nBased on an original idea by Ben Golus - **[Sharper Mipmapping using Shader Based Supersampling](https://medium.com/@bgolus/sharper-mipmapping-using-shader-based-supersampling-ed7aadb47bec)**.\n\nThe snake image is from [Kenney](https://kenney.nl/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findiesoftby%2Fdefold-sharp-sprite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findiesoftby%2Fdefold-sharp-sprite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findiesoftby%2Fdefold-sharp-sprite/lists"}