Giter Club home page Giter Club logo

defold-sharp-sprite's Introduction

Sharp Sprite Logo

Sharp Sprite - RGSS for Defold

Sharp Sprite is the implementation of Rotated Grid Super-Sampling (RGSS) for the Defold 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:

RGSS vs Builtin

How 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.

Also, check out the demo.

Installation

You can use it in your own project by adding this project as a Defold library dependency. Open your game.project file and in the dependencies field under project add:

https://github.com/indiesoftby/defold-sharp-sprite/archive/main.zip

Or point to the ZIP file of a specific release.

Sharp Sprite contains materials that are drop-in replacement for the standard 2D materials:

  • /builtins/materials/gui.material/sharp_sprite/materials/gui.material
  • /builtins/materials/particlefx.material/sharp_sprite/materials/particlefx.material
  • /builtins/materials/spine.material/sharp_sprite/materials/spine.material
  • /builtins/materials/sprite.material/sharp_sprite/materials/sprite.material
  • /builtins/materials/tile_map.material/sharp_sprite/materials/tile_map.material
  • /builtins/fonts/font.material/sharp_sprite/fonts/font.material or /sharp_sprite/fonts/font-singlelayer.material
  • /builtins/fonts/font-fnt.material/sharp_sprite/fonts/font-fnt.material
  • /builtins/fonts/label.material/sharp_sprite/fonts/label.material or /sharp_sprite/fonts/label-singlelayer.material
  • /builtins/fonts/label-fnt.material/sharp_sprite/fonts/label-fnt.material

Cons

  • RGSS requires the OES_standard_derivatives OpenGL extension to run. It's universally supported by WebGL 1.0, by the most of OpenGL ES 2.0 devices (Android stats and by all iOS devices).
  • 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!
  • Sharp Sprite's implementation of RGSS is blurring at 1:1 scaling.

Tips

Credits

Based on an original idea by Ben Golus - Sharper Mipmapping using Shader Based Supersampling.

The snake image is from Kenney.

defold-sharp-sprite's People

Contributors

aglitchman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.