Skip to main content

Posts

Showing posts with the label 2D shaders

Simple yet powerful Shaders in GODOT

Watch the Video Tutorial https://youtu.be/j_fCGoaoRmg     Hit Flash Effect Shader This is a very simple shader and mostly used to make the player white indicating a hit or damage. shader_type canvas_item; uniform float quantity : hint_range(0.0, 1.0); void fragment(){ vec4 base = texture(TEXTURE, UV); vec4 new_color = vec4(1.0,1.0,1.0, base.a); COLOR = mix(base,new_color,quantity); }   Grayscale Shader                        GrayScale can be useful in many cases,  like if you    have a shop and some items are locked then You can turn them grayscale.  Or maybe   use it to turn the entire scene grayscale when the  player dies, similar to GTA V. shader_type canvas_item; uniform float quantity : hint_range(0.0, 1.0); void fragment(){ vec4 original = texture(TEXTURE, UV); float mean = (base.x + base.y + base.z) / 3.0; vec4 gray = vec4(mean, mean ,mean, original.a);...

Create Tesla gun / Laser gun in Godot

  hello everyone, I am here again with another visual effect tutorial in Godot this time i have made a really cool tesla gun that fires lightning. It is very similar to creating a Laser because the main mechanics is almost the same in both the cases. I have used the line2D node to create the main lightning and then applied a simple shader code in it. and this lightning is going to be fully interactable with other object as well and the collision is checked by the Raycast2D node. I will say that it look great because of the Kenny image pack. you can download the image pack from here: https://godotengine.org/asset-library... Here is the video tutorial- I hope this video helps you in your project or if you have learnt something new from this.

Create 2D Fire in Godot

Godot particles are so great that it makes very easy to create amazing things like particles.  Here are some of the images that you need- Particle Pack  by Kenney Vleugels https://godotengine.org/asset-library/asset/783 Here is the full tutorial video of how it is done -  Godot particles system is very powerful to create many amazing effects one of them is creating fire in Godot using only particle 2D and no code required and when you add particles power with some post processing effects then you get some really good results. In this video i have shown how you can create some realistic looking fire.

How to create 2D grass wind motion using shaders in Godot

I have just started learning Shaders, and it is very difficult in the beginning but after couple of days I finally start understanding it. so I made this grass animation shader for 2D because most of the video I found is for 3D. making grass wind motion is very simple and easy to make. it is just a single line in the VERTEX function. I have also cover basics as well, so if you have no experience in shaders then also you can understand it too. Here is the Shaders code: shader_type canvas_item; uniform float speed = 2.0; uniform float dis = 20.0; void vertex(){ VERTEX.x += sin(TIME * speed) * dis * (UV.y-1.0); } here is a video tutorial