Git Product home page Git Product logo

godot-2d-dithering's Introduction

2D dithering shaders for Godot 4

Introduction

A small collection of ordered dithering 2D shaders for Godot 4, based on Surma's article on Ditherpunk. Two-colored palettes are supported.

Demos

Bayer Level 0 (Inverted) Bayer Level 0 (Normal) Bayer Level 0 (No sRGB to RGB conversion)
Bayer Level 1 (Inverted) Bayer Level 1 (Normal) Bayer Level 1 (No sRGB to RGB conversion)
Bayer Level 2 (Inverted) Bayer Level 2 (Normal) Bayer Level 2 (No sRGB to RGB conversion)
Bayer Level 3 (Inverted) Bayer Level 3 (Normal) Bayer Level 3 (No sRGB to RGB conversion)
Blue Noise Blue Noise Blue Noise (No sRGB to RGB conversion)

Usage

For 2D:

  1. Add the "materials" folder to your Godot project.
  2. Drag and drop the desired material onto a Sprite node.

For 3D:

  1. Add the "materials" folder to your Godot project.
  2. Add a SubViewport node to the scene.
  3. Add a Camera3D node as a child of the SubViewport node.
  4. Add a SubViewportContainer node to the scene.
  5. Add another SubViewport node as a child of the SubViewportContainer node.
  6. Add a TextureRect node as a child of the second SubViewport node.
  7. In the Texture property of the TextureRect node, select "New ViewportTexture" and choose the SubViewport node that contains the Camera3D.
  8. Drag and drop the desired material onto the CanvasItem section of the TextureRect node.
  9. The scene tree should have the following structure:
Node3D
[...]
  SubViewport
    Camera3D
  SubViewportContainer
    SubViewport2
      TextureRect
[...]

Sources and credits

The test images come from Surma's article on Ditherpunk and Wikimedia. The blue noise textures are from Christoph Peter's article on the topic.

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.