NOTICE: Uses .net 7. Does not use standard lighting, instead uses a custom object to create a light direction. This is intended so that the artists have full control over the light angle like in a lot of anime toon shading applications. Repository has documentation.A toon shader system that comes with a custom light solution, and is based off of various anime toon shading techniques. Basic how to use: Add a CharacterLight object, then add the materials you want to control to the array of ShaderMaterials.
Three shaders to generate 3D animated planets and stars in Godot 4:- Planet body generation shader- Cloud generation shader- Astmosphere generation shaderThe project contains seven example planets:- No atmosphere planet- Terrestrial planet- Ice planet- Lava planet- Sand planet- Gaseous planet- StarFAQ and more information: https://naejimer.itch.io/godot-3d-planet-generator
This contains a simple atmosphere shader usable on planets. I developped this for a tech demo I'm working on, so I thought of making it an addon.- Comes in two versions, one with fake colors and another with light scattering- Can be seen from inside like regular fog if you want to land on the planet- Switches to a cube mesh when seen from far away so multiple atmospheres can be drawn at lower cost- Includes experimental volumetric cloudsChanges in 0.4:- Added `force_fullscreen` option to allow previewing the inside of the atmosphere in the editor- Added atmosphere ambient color to v2 atmosphere so nights are no longer pitch black- Added `*_shader_parameter()` methods, deprecated `*_shader_param` methods- Slightly improved clouds alpha blending- Decoupled alpha from color in v2 atmosphere so it no longer stops rendering in the dark side of planets- Fixed properties list not updating when setting a different shaderChanges in 0.3:- Added more realistic atmosphere model based on Sebastian Lague's Coding Adventure- Added automatic optical depth baking using a viewport (Vulkan renderer not needed)- Added raymarched and animated clouds (current version is imperfect due to tradeoffs)- Added NoiseCubemap resource to generate procedural cloud coverage textures- Added small demoChanges in 0.2:- Ported to Godot 4- Added option to blend ground depth with a sphere, to hide precision lost at high distances
Voxel rendering for Godot 4 based on an efficient 2-level DDA algorithm implemented 100% on the GPU as a fragment shader.This approach allows for good performance and opens up the possibility of making runtime changes to voxels at a relatively low cost.Please see the detailed description on GitHub.
Simple shader that allows for create animations similar to palette cycling. Make a grayscale sprite and a gradient, put a ShaderMaterial on the sprite and assign the gradient and it will animate. See the example project for usage.Caveats for best effect:- the node with shader should have texture_filter set to Nearest- number of colors in the gradient and base texture should match- gray shades in the base texture should be uniformly distributed (i.e. with equal increments between colors)Check out the repo page for animated example.
Fake interior shader with use single texture for roomPort of this shader: https://forum.unity.com/threads/interior-mapping.424676/#post-2751518Interior mapping shader which instead of cubemap, it uses texture atlas with room tiles that are front room view automatically mapped into a cube. The alpha channel value - uniform for whole tile - is used to determine the rear wall's relative distance.
Split texture, stochastic sampling, triplanar projection shader for Godot4
A shader that changes sprite colors based on provided palette. Top row of palette are color references; these colors are sampled from the original image and replaced by colors from subsequent rows. The shader will cycle between palette rows, resulting in an animation. By default, the reference row is also part of the animation, but it can be skipped. 2-row palette with first row skipped results in a static palette swap.The shader will automatically adjust to palette size, so it requires minimal setup (just drop palette image and it works). It uses integer comparison for the colors, so it's fast and perfectly accurate. I also made sure that the code is optimized.You can use the alpha from palette colors or keep the original. When using palette alpha, keep in mind that transparent pixels are sampled too. Only RGB values are sampled, alpha is used only for final image.Warning: Be sure to set texture_filter property to Nearest. Also, while the palette size is only limited by maximum texture size, having too many columns (hundreds/thousands) will impact performance.The shader comes bundled with a file PaletteGenerator.gd. It's an editor script for quick generating palettes from images. Select a Sprite or any node with texture property and in Script Editor do File -> Run to generate a palette template.Check the example project for some usage examples or check the repo for more details.
# motion-blur-godot-4.0A motion blur plugin created by Bauxitedev, ported to Godot 4.0To use this plugin in your game, do the following:1) Copy the motion-blur folder to your project directory.2) Select the camera you want to apply motion blur to, and click the 'link' button above the scene tree to instance a scene.3) Select the 'motion_blur.tscn' file, and click Open.If you want to customize the blur:1) Select the motion_blur node2) Click 'Surface Material Override' in the inspector under MeshInstance3D.3) Click 'Shader Parameters'4) Mess with the Intensity, Iteration Count, and Start Radius until you have the effect you'd like.Original plugin by Bauxitedev for Godot 3:https://godotengine.org/asset-library/asset/211
This addon aims to help Godot developers writing custom written shaders by providing high-level functions which are often used inside gdshaderinclude files.
This addon comes with Visual Shader library of nodes such as a huge library of blending modes, SDF (signed distance field) shapes, procedural noise and patterns, UV utilities and other nodes.
The Glow Boarder Effect Renderer contains shader setup with a glowing boarder effect for selected objects. The user can turn the glow border effect on and off and select glow color for individual objects.
This is a shader that implements a chroma key effect. Chroma keying is a technique used to remove a specific color (usually green or blue) from an image or video, making it transparent and allowing other content to show through.The shader provides RGB Comparison options for the chroma key effect.
Original Addon for Godot 3 by CaptainProton42 ported to Godot 4A flexible toon shader for the Godot Engine with many features:🤸Flexibility through parameters like number of cuts/bands, steepness, and wrap🎨 Supports custom color ramps🌈 Affected by the colors of light sources and ambient light in the scene💡 Allows for multiple light sources⛱️ Supports shadows and attenuation✨ Visual extras like specular reflections and rim lighting🖼️ Supports textures for albedo and specularNew:✏️ Experimental toon hatching shader (available as a separate material)
Adds many premade 2D effects (such as noise, blur, emboss, zoom, custom shapes, etc.) to build-in VisualShader editor. You can find basic usage examples in the "addons/shaderV/examples" folder.Copy the contents of "addons/shaderV" into the same folder in your project. Custom visual shader nodes work the same way as standard visual shader nodes.As all shaders sources are .gdshaderinc files, it is also possible to use this plugin with usual text shaders.
Instead of fading to alpha, this shader fades to dither to achieve the same effect.
A fast viewport scaler for 3D and 2D Godot Engine games that allows you to upscale or downscale the screen for increased performance or higher quality visuals. Supports up to 200% native resolution or down to 10%. At 50% scaling on a 3D game, you could potentially get 200% to 300% of native performance, which is key to getting higher quality graphics on low-end hardware. At scales like 90%, you could gain 25% performance with very minimal picture quality loss. Going above 100% does increase quality, however the performance cost is large and might only make sense for users with very high-end graphics cards.- Add the SuperScaling.tscn scene to your main scene tree, it should be just below the root node.- You can leave the rest of your scene tree the same, this add-on no longer requires any special node setup.- To have UI or HUD elements rendered at native resolution, you should add them to the UI Nodes property.- Select Enable on Play, this will start the scaling add-on when you play the game (cannot be viewed in editor).- Set Usage to either 3D or 2D depending on your game type.- MSAA and FXAA are controlled by the SuperScaling add-on and the project settings do not take effect.- The SuperScaling add-on does add some anti-aliasing, however you may want to also enable MSAA or FXAA or both. For the best quality and performance, it is recommended to use 4x MSAA. At higher render scales, using FXAA can help soften the image. At scales of 75% or below, it is recommended to disable FXAA as it can worsen picture clarity.- Shadow Atlas controls the shadow map size for omni and spot lights. If you only use a directional light you can set this to 1.- To control the scale of the render, use the Scale Factor setting on the top of the inspector for SuperScaling.- 1.0 for the Scale Factor corresponds to 100% of the native resolution. 0.5 will be 50% and 2.0 will be 200%.- Setting the Scale Factor lower than 1.0 will lessen the picture quality slightly, but with much higher performance.- Note that setting the Scale Factor above 1.0 results in higher definition but will have substantially lesser performance.- Please experiment with your game and your desired minimum spec to find an appropriate setting.- Also consider exposing the scale to users (within limits), so that they may tailor the experience to their level of hardware.- Smoothness controls the mix between the two scaling algorithms. 0.0 is more sharp and 1.0 is softer.- In general, leaving the Smoothness value at the default of 0.5 will have the best compatiblity at all scales.- You should avoid setting Smoothness to the extremes. Values between 0.25 and 0.75 work best.- However, this is an artistic choice and you should experiment to find the best value for your game.- In the project settings, for 3D games, the Stretch Mode should be set to disabled and Stretch Aspect to ignore.- For 2D games, the best project settings are 2d for Stretch Mode and keep_height for Stretch Aspect.- Native resolution UI nodes for 3D games can be anywhere, as long as they are added to the UI Nodes property.- For 2D games, you will need to create a Node2D and place your UI elements inside that. Then set the Z Index to 1 or above.- Be sure that Use VSync is set to On in the project settings for the smoothest performance. Turning Use VSync to Off can result in stuttering and an overall choppy experience.- One thing to note, SuperScaling will take control of your game while enabled, and you will no longer be able to edit as you play. Meaning changing variables in the inspector at run-time will not result in visible changes (though you can click the Remote tab on the left and edit values, if really necessary).- So it is recommended to leave Enable on Play off while developing, and only enable the add-on when you need to test the graphics or performance.- Since the add-on moves your game nodes into a dynamically generated viewport, using get_node() with absolute paths will no longer function. It is recommended to try to use relative paths as much as possible when getting nodes, and this is supported. There are some cases, though, where special care must be taken. In the case of scripts on the root node, and also when calling in or out of the dynamic viewport (e.g. for a UI node to affect a game object, or vice versa), since the node paths will change at run-time. In these cases, rather than absolute paths, you can use the find_node() function, which will work regardless of where the nodes might be. For example get_tree().get_root().find_node("Player", true, false). For this to work, though, all the nodes you are interested in getting this way must have unique names.
A cloud shader for Godot Engine1.3 update:* Implemented draw cloud shadow.1.2 update:* Added feature displaying to ground side.
Godot Stereo 3D adds stereoscopic 3D support to Godot Engine (red/cyan anaglyph 3D glasses) in game and in editor. Works as a screen-space shader based on the depth buffer (2D to 3D conversion) so is very fast. Requires GLES3. The best 3D glasses to use with this add-on are called Pro-Ana (red/cyan). They make plastic and paper versions and are very affordable.- Place the Stereo3D.tscn scene inside your main game tree. - If used in combination with Godot Super Scaling, the Stereo3D node should be inside your game world.- In the Stereo3D inspector settings, check the Enable box to turn stereo on or off in game or in editor.- Set Z Near to the z_near of your camera.- Set Z Far to the z_far of your camera.- The Separation controls the distance between the eyes. 0 is no distance and 100 is the maximum.- Setting Separation too high may cause discomfort, so leaving it around the default of 50 is recommended.- The Convergence controls the distance to the parallax plane the eyes are focused on (on the z axis). - Higher values for Convergence will result in a greater 3D effect, but setting it too high may cause discomfort.- The Pop Out setting controls the overlap between the left/right images. This makes the image more 3D or more comfortable.- Typically lower Pop Out settings are easier to focus on. However, if you use transparent surfaces or reflections (e.g. glass windows) then it is better to set Pop Out to the maximum so that the transparent pass closer matches the 3D render.- If you have overlapping transparent surfaces in your game, you need to set the Render Priority of the transparent material to 1 or above (for example, in a racing game, viewed from the 3rd person, the front window could have Render Priority of 0 and the back 1).- For cut-out textures (like decals or grass) the Render Priority should be above 0, the Depth Draw Mode set to Opaque Pre-Pass, Transparent set to false, and enable Use Alpha Scissor on the material. If the decal texture is on top of a transparent material (e.g. a sticker on a window) then the Depth Draw Mode must be set to Never.- If you use reflection probes, the reflections will be captured with the results of the post-process and will be incorrect. In these cases, you should leave the Stereo3D disabled in game, then on _ready() in your game, wait a certain amount of time (enough for the captures to take place) before enabling Stereo3D.- You must control whether Stereo3D is enabled or not within the inspector settings for the add-on. The eye icon in the tree is disabled by design.- Note, since this is a post-process effect (2D to 3D conversion) and not a true dual camera stereo render, you may see some artifacts (typically halos around objects or duplicated textures). This is unavoidable with a screen-space shader, and is why it performs so fast. Changing the Stereo3D settings so that the 3D effect is less can mitigate some of these artifacts.
This is procedural fire shader for 2D/3D.1.1 update* Added fire direction parameter.
A shader that changes sprite colors based on provided palette. Top row of palette are color references; these colors are sampled from the original image and replaced by colors from subsequent rows. The shader will cycle between palette rows, resulting in an animation. By default, the reference row is also part of the animation, but it can be skipped. 2-row palette with first row skipped results in a static palette swap.The shader will automatically adjust to palette size, so it requires minimal setup (just drop palette image and it works). It uses integer comparison for the colors, so it's fast and perfectly accurate. I also made sure that the code is optimized.You can use the alpha from palette colors or keep the original. When using palette alpha, keep in mind that transparent pixels are sampled too. Only RGB values are sampled, alpha is used only for final image.Warning: Be sure to import all used textures with "filter" disabled, otherwise the shader won't work properly. Also, while the palette size is only limited by maximum texture size, having too many columns (hundreds/thousands) will impact performance.The shader comes bundled with a file PaletteGenerator.gd. It's an editor script for quick generating palettes from images. Select a Sprite or any node with texture property and in Script Editor do File -> Run to generate a palette template.Check the example project for some usage examples or check the repo for more details.