Ok, here we are.
Some examples of what this addon can do:
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.
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.
- 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
To use this plugin, follow these steps:
- Download the repository or clone it into your Godot project.
- Enable the plugin in your project's settings.
- Open the "Plugins" window in Godot and configure the options as needed.
- Add a Sprite2D or AnimationSprite2D (since version 1.2 also Label and ColorRect) node to your scene with a texture or animation.
- In the Inspector tab, you will find a new section called "Create Shader Mixer."
- 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".
- Wait and you will get a list of available shaders. The list can grow over time when new shaders are available.
- Select one shader. The first time you will need to download the shader, and textures if needed.
- Wait for the download and you will see the shader applied to the texture.
- 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.
- Go again and select a different shader, now you can mix them. The plugin will download, and create a new shader blending both shaders!
- By the way, you can see info about the shader if you press the "List of Current Shaders" button
-
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!
-
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)
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:
- Open an issue to discuss your ideas or problems.
- Fork the repository, make your changes, and create a pull request.
- Make sure to follow the contribution guidelines and code of conduct.
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:
- 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.
- 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.
- Textures. Some shader parameters need to put textures inside. The plugin sets those texture parameters with a texture image.
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.