Skip to content

Godot Addon to set a collection of shaders mixed together in the same Sprite2D || AnimatedSprite2D || Label || ColorRect

License

Notifications You must be signed in to change notification settings

spheras/godot-sprite-shader-mixer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GODOT Sprite Shader Mixer

Ok, here we are.

License Godot

Some examples of what this addon can do:

supergodot5v2

supergodot

supergodot2

supergodot3

supergodot4

manager

Disclaimer: This project is inspired by godot-sprite-shader by duongvituan. Initially I've got and adapted a lot of shaders from there, and also from the great web page https://godotshaders.com/. I want to express my sincere gratitude for the inspiration them provided.

Description

The Godot Sprite Shader Mixer is a plugin for Godot that allows Sprite2D and AnimationSprite2D (since version 1.2 also Label and ColorRect) nodes to blend shaders from a list of available shaders. Users can select and add shaders to sprites dynamically, automatically downloading them from GitHub as needed. The plugin handles shader generation and blending, resulting in a texture that combines all selected shaders.

Features

  • Dynamic blending of shaders on Sprite2D and AnimationSprite2D nodes (since 1.2 version also Label and ColorRect).
  • Automatic shader downloading from GitHub.
  • Generation and application of combined shaders.
  • Customization of the intensity of each shader.
  • Search Manager with preview

Installation

To use this plugin, follow these steps:

  1. Download the repository or clone it into your Godot project.
  2. Enable the plugin in your project's settings.
  3. Open the "Plugins" window in Godot and configure the options as needed.

image

Usage

  1. Add a Sprite2D or AnimationSprite2D (since version 1.2 also Label and ColorRect) node to your scene with a texture or animation.

image

  1. In the Inspector tab, you will find a new section called "Create Shader Mixer."

image

  1. Once done, the section will grow. The first time you need to download (or sync) the list of available shaders at this github page. Click on "Sync List".

image

  1. Wait and you will get a list of available shaders. The list can grow over time when new shaders are available.

image

  1. Select one shader. The first time you will need to download the shader, and textures if needed.

image

  1. Wait for the download and you will see the shader applied to the texture.

image

  1. You can adjust all the parameters of the shader going directly to the shader params, at the material->shader inspector. It works like any shader, nothing special. The interesting part is that the plugin created that shader for you. But that's not all.

image

  1. Go again and select a different shader, now you can mix them. The plugin will download, and create a new shader blending both shaders!

image

  1. By the way, you can see info about the shader if you press the "List of Current Shaders" button

image

  1. You can reorder the shaders, it affects the way they are mixed. You can quit a shader from your shader code. You can also remove the downloaded shader (you can download it again later). Be free and experiment with it!

  2. The point is that the plugin creates a shader script for your texture with the shaders you select. The collection will grow, it is open to incorporate new shaders easily, just making a pull request over the shaders branch. So, consider sync the shader list to see if there are new shaders available. (explained later)

Contribution

Contributions are more than welcome! This is a tool I need for my own game. Yes, I come from Unity and I needed something like this :D. The point is that it is difficult to maintain by only one person, so contributions are more than needed. If you wish to improve this project, please:

  1. Open an issue to discuss your ideas or problems.
  2. Fork the repository, make your changes, and create a pull request.
  3. Make sure to follow the contribution guidelines and code of conduct.

HEY! I want to add a new Shader for this incredible tool!

Great! that's the idea, increase the collection of shaders. One of the positive things about this plugin is that it doesn't have the shaders inside, it downloads them from this page when the user wants to apply the shader and mix with others. Therefore, we can grow with new shaders, without affecting them.

First of all, all the shaders are in a separate branch of this project: https://github.com/spheras/godot-sprite-shader-mixer/tree/v1/shaders

I mean, if you only want to add a new shader, you only need to PR that branch. The plugin will get shaders from this branch, syncing what shaders are available. There are three main aspects to consider:

  1. The file shaders.json. This file contains the definition of all the available shaders. If you want to add a new one, you will need to add a new shader info there.
  2. The shader (.gdshader) itself. The shader info JSON contains the filename of the shader, among other info. It must be unique as possible, to avoid conflicts with other shaders.
  3. Textures. Some shader parameters need to put textures inside. The plugin sets those texture parameters with a texture image.

License

This project is licensed under the MIT License.


Thank you for your interest in Godot Sprite Shader Mixer! If you have any questions, suggestions, or issues, please feel free to contact me.

About

Godot Addon to set a collection of shaders mixed together in the same Sprite2D || AnimatedSprite2D || Label || ColorRect

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published