Nolkaloid
Nolkaloid
  • Видео 12
  • Просмотров 135 043
GODOT TUTORIAL : 2D Reflective water shader
Another shader tutorial for the Godot Engine. Today we are making a fancy water effect in 2D.
Fake waves : www.desmos.com/calculator/duerjwmfgy
My Twitter : NoeGameDev
My Mastodon : mastodon.gamedev.place/@noedev
Music used in the video : www.audiotool.com/user/tocka/
00:00 Intro
00:44 Scene setup
01:35 Making the reflection
04:18 Scale a Zoom
08:20 Color and Distortion
13:19 Waves
Просмотров: 20 313

Видео

GODOT TUTORIAL: Shockwave shader for noobs
Просмотров 50 тыс.4 года назад
Hey, here is a new in depth tutorial on how to make a shockwave shader in the Godot engine. Don't be scared, shaders aren't black magic :). Sorry for the inconsistent audio, I recorded the audio on my phone and rearranged it in post. Music: www.audiotool.com/user/tocka/ Godot Emote: mauriciogamedev Twitter: NoeGameDev 00:00 Intro 00:37 Animation 02:04 Creating the Shader...
Ray-casting from the screen : Look at the mouse in 3D [GODOT]
Просмотров 28 тыс.4 года назад
Quick video explaining how does ray-casting from the screen works and how to use it in your games, to make a character look at the mouse position.
Godot Tutorial: 3D fire using particles - Smoke and Sparks (Part 2)
Просмотров 8 тыс.4 года назад
Here is the promised 2nd part of the tutorial on how to make 3D fire using particles in the Godot engine. In this part we are going to add a smoke effect and some sparks. Resources (Gradients and Textures): drive.google.com/drive/folders/1HLbDZCS2zxYRpIr-bmmyTARUYvQOyfCU?usp=sharing Songs: www.audiotool.com/track/ii6bsoz18l/ www.audiotool.com/track/kv2dpy2dv1/ www.audiotool.com/track/abs_x_lux_...
Godot Tutorial: How to make 3D fire using particles (Part 1)
Просмотров 21 тыс.4 года назад
Here is the promised tutorial on how to make 3D fire using particles in the Godot engine. Tell me what to improve! Sprite-sheet: opengameart.org/sites/default/files/Smoke30Frames_0.png Fire gradient: drive.google.com/file/d/1_SF4ZrOSCNBq-L5yollYlbgdXXXA6SpT/view?usp=sharing Background music: www.audiotool.com/user/hydrant/
3D fire in the Godot engine
Просмотров 1,9 тыс.4 года назад
Hey! Instead of studying for my baccalaureate I preferred to mess around in the 3D branch of the Godot Engine and made this small campfire thingy. The models of the car and the fireplace are not by me and you can find them on Sketchfab: Fireplace: skfb.ly/6KIvp Car: skfb.ly/6HAMD
Pack In Rush TRAILER
Просмотров 1,1 тыс.4 года назад
A small game I made for the 16th edition of the Godot Wild Jam. DOWNLOAD: nolkaloid.itch.io/pack-in-rush
YouTube playback implementation in the Godot Engine
Просмотров 3,5 тыс.4 года назад
Short example of use for my youtube-dl implementation in the Godot engine. Here I use youtube-dl and ffmpeg to download and play a song from RUclips in my multiplayer game Global Cats. Note that you can also download an play videos. youtube-dl for Godot: github.com/Nobelix/godot-youtube-dl
Global Cats Water
Просмотров 5296 лет назад
Global Cats Water
Chat and command system in Global Cats
Просмотров 2236 лет назад
I improved the chat and command system to be more efficient and flexible, mostly not visible stuff... NoeGameDev
Global Cats - UPDATE: Menus
Просмотров 1746 лет назад
I created the whole interface for my game an reworked some of the networking code. You can find me on the GodotEngine Discord: discordapp.com/invite/zH7NUgz Or on Twitter: NoeGameDev
Global Cats Hell Sub Level
Просмотров 2476 лет назад
I spent my weekend creating this hell sub-level feat. soundcloud.com/obani 's tracks

Комментарии

  • @vohoff
    @vohoff 24 дня назад

    VERY good video !

  • @BADASSSAMEE
    @BADASSSAMEE Месяц назад

    How would you do this for an animated sprite though ?

  • @milkman6240
    @milkman6240 Месяц назад

    Please forgive me for this really noobish question, why does multiplying the offset by UV.y and 2 flip the image? My math isn't really that good and I'm struggling to really understand that part.

    • @Nolkaloid
      @Nolkaloid Месяц назад

      No worries, the idea is the following: Basically as we move towards UV.y = 1.0 (the bottom of the sprite), we want to read the screen that's above in a "mirrored manner". So when rendering the line at UV.y = 1.0, we want to read the screen texture at SCREEN_UV + SIZE_OF_THE_SPRITE × 2 (where SIZE_OF_THE_SPRITE is the offset as explained in the video). On the other hand, at UV.y close to 0.0, we want to read the SCREEN_TEXTURE that is just a tiny bit above. And in between I want a linear progression, so that's why we multiply by UV.y If it's still not clear I can send you a diagram explaining it visually.

  • @user-jx1ke4ek1g
    @user-jx1ke4ek1g Месяц назад

    Could you upload the godot project to download?

  • @celsladroma8048
    @celsladroma8048 Месяц назад

    this thing work on godot 4?

    • @Nolkaloid
      @Nolkaloid Месяц назад

      Yes, but you will have to modify it a bit.

  • @yacoobsc.m3269
    @yacoobsc.m3269 Месяц назад

    Sabes es de los pocos tutoriales, que sin escuchar tu voz, entiendo perfectamente lo que estas haciendo en todo momento. Es una perfecta forma de explicar, hasta para una persona sorda. Felicidades gran tutorial 😅 saludos

  • @RivenbladeS
    @RivenbladeS 2 месяца назад

    Can you do a tutorial on space distortion with physics maybe just like in geometry wars game where you throw a projectile and the lines behind warps?

  • @robertmeyer5985
    @robertmeyer5985 2 месяца назад

    Absolutely phenomenal, thank you.

  • @mistouluf8518
    @mistouluf8518 2 месяца назад

    This does not work well in version 4, there is an illustrated bug: ruclips.net/video/5DJKV5FyKNc/видео.html If you can help me?

    • @Nolkaloid
      @Nolkaloid 2 месяца назад

      Hi, this is not related to the Godot version you're using, this is expected behavior. The shader cannot read what's above the screen (it is simply not rendered). To fix that you could render the game zoomed out (×0.5) and render it at twice the resolution. Then display the result zoomed "back" in (×2.0).

    • @mistouluf8518
      @mistouluf8518 2 месяца назад

      @@Nolkaloid ok I tried it didn't work, however you are right that this product when the reflected area is outside the camera, I tested with 0.5 scale and less and multiplied the effect by 2 it doesn't change anything, do you have another solution?

    • @mistouluf8518
      @mistouluf8518 2 месяца назад

      ​@@Nolkaloid and with backbuffercopy ?

    • @mistouluf8518
      @mistouluf8518 2 месяца назад

      ​@@Nolkaloid and with backbuffercopy ?

    • @mistouluf8518
      @mistouluf8518 2 месяца назад

      @@Nolkaloid backbuffercopy alternative ?

  • @yPhil
    @yPhil 3 месяца назад

    Can it be added to a 3d scene? Apparently not, I've been trying for days now.

    • @Nolkaloid
      @Nolkaloid 3 месяца назад

      Of course it can, you need to use a full screen quad, see docs.godotengine.org/en/stable/tutorials/shaders/advanced_postprocessing.html#full-screen-quad

  • @animebinger7974
    @animebinger7974 3 месяца назад

    It seems that when it runs with + TIME, my noise texture simply "runs off" elsewhere, leaving a completely smooth surface behind. The noise distortion texture seems to run to the left, being clipped m the sprite's boundaries. In other words, it doesn't loop. Help. :c Here's my code(in godot 4) shader_type canvas_item; uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap; uniform float y_zoom; uniform vec2 scale; uniform vec4 water_color: source_color; uniform vec2 distortion_scale; uniform float intensity; uniform float speed; uniform sampler2D noise; void fragment() { float distortion = texture(noise, UV * scale * distortion_scale + TIME * speed).x ; distortion -= 0.5; float uv_height = SCREEN_PIXEL_SIZE.y / TEXTURE_PIXEL_SIZE.y; vec2 reflected_screenuv = vec2(SCREEN_UV.x - distortion * intensity * y_zoom, SCREEN_UV.y - uv_height * UV.y *scale.y * y_zoom * 2.0); vec4 reflection = texture(SCREEN_TEXTURE, reflected_screenuv); COLOR.rgb = mix(reflection.rgb, water_color.rgb, water_color.a); }

    • @Nolkaloid
      @Nolkaloid 3 месяца назад

      Is your texture set to be repeated ?

    • @animebinger7974
      @animebinger7974 3 месяца назад

      @@Nolkaloid I don't think so. How do I do that?

    • @animebinger7974
      @animebinger7974 3 месяца назад

      @@Nolkaloid I just set the texture of the sprite to repeated, but nothing changed. I'm assuming I have to set the noise texture to repeat. Not sure how to do that tho.

    • @Nolkaloid
      @Nolkaloid 3 месяца назад

      @@animebinger7974 You need to add the repeat_enable hint to the sampler2D declaration : uniform sampler2D noise : repeat_enabled; docs.godotengine.org/en/stable/tutorials/shaders/shader_reference/shading_language.html#uniforms

    • @animebinger7974
      @animebinger7974 3 месяца назад

      @@Nolkaloid Ty!!!

  • @supersquidge_vidya
    @supersquidge_vidya 3 месяца назад

    The code here doesn't work 1:1 anymore due to some stuff being changed from Godot 3 to 4; here's the GDscript that I've got working for my project that you can copy/paste. Replace $"../Player Character" with the node you want to look at your mouse. func _physics_process(delta): var space_state = get_world_3d().direct_space_state var mouse_position = get_viewport().get_mouse_position() rayOrigin = camera.project_ray_origin(mouse_position) # set the ray orign rayEnd = rayOrigin + camera.project_ray_normal(mouse_position) * 2000 # set the ray end point var player = $"../Player Character" var exclude = [player] var query = PhysicsRayQueryParameters3D.create(rayOrigin, rayEnd, 0xFFFFFFFF, exclude); var intersection = space_state.intersect_ray(query) if len(intersection) != 0: # if there is a proper ray hit get its position an rotate towards it var pos = intersection.position player.look_at(Vector3(pos.x, player.position.y, pos.z), Vector3(0, 1, 0))

    • @DD-cv1ro
      @DD-cv1ro 3 месяца назад

      Hi ! Thanks you so much, i copied your code but i still have the following error : Invalid call. Nonexistent function 'project_ray_origin' in base 'Node3D'. I'm a bit puzzled by it, i tried to remplace rayOrigin = camera.project_ray_origin(mouse_position) by rayOrigin = camera.global_position but then i get a similar error for another line : Invalid call. Nonexistent function 'project_ray_normal' in base 'Node3D'. my version is 4.2.1 Would be really cool if you could help ^^'

    • @DD-cv1ro
      @DD-cv1ro 3 месяца назад

      i fixed my issue, i was using my camera pivot instead of the camera itself... oops ! thanks a lot for your code though :D

  • @mistouluf8518
    @mistouluf8518 3 месяца назад

    bug on canvas_view Y (pan move or in game... -_-)

  • @kmj2l
    @kmj2l 3 месяца назад

    Thank you for this! Great tutorial.

  • @melpeslier
    @melpeslier 5 месяцев назад

    I've made it + I added a few wavy into the water, but there seems to be a problem for me when i move to the right, the left part of the water is laggy when going out of screen or entering screen (not the right one .. ? ) Does anyone have hints to resolve this issue ? here is the code : shader_type canvas_item; group_uniforms screen; uniform sampler2D screen_texture : hint_screen_texture, filter_linear_mipmap; uniform vec2 scale; uniform float y_zoom; group_uniforms display; uniform float reflect_scale_y = 1.13; uniform vec4 water_color : source_color; group_uniforms distortion; uniform sampler2D distortion_noise: repeat_enable; uniform vec2 distortion_scale = vec2(0.03, 0.06); uniform float distortion_intensity = 0.04; uniform float distortion_speed = 0.015 ; group_uniforms waves; uniform sampler2D wave_1_noise: repeat_enable; uniform float wave_1_speed; uniform float waves_min_intensity = 1.22; uniform float waves_hdr_value = 3.3; uniform float waves_smoothness = 0.12; group_uniforms top_wave; uniform float top_wave_amplitude = 0.02; uniform float top_wave_speed = 0.09; uniform float top_wave_period = 0.185; //float remap(float val, float in1, float in2, float out1, float out2) //{ //return out1 + (val - in1) * (out2 - out1) / (in2 - in1); //} void fragment() { vec2 uv = vec2( UV.x, UV.y * reflect_scale_y); float waves = uv.y * scale.y +sin(uv.x * scale.x / top_wave_period + TIME * top_wave_speed) * cos( 0.2 * uv.x * scale.x/top_wave_period - TIME - top_wave_speed) * top_wave_amplitude - top_wave_amplitude; float distortion_1 = texture(distortion_noise, uv * scale * distortion_scale + TIME * distortion_speed).x; float distortion_2 = texture(wave_1_noise, uv * scale * distortion_scale + TIME * wave_1_speed).x; float distortion = distortion_1 + 1.0 - distortion_2; distortion -= 0.5; float waves_intensity = smoothstep(waves_min_intensity - waves_smoothness, waves_min_intensity, distortion) * waves_hdr_value; float uv_height = SCREEN_PIXEL_SIZE.y / TEXTURE_PIXEL_SIZE.y; vec2 reflected_screen_uv = vec2(SCREEN_UV.x - distortion * distortion_intensity * y_zoom, SCREEN_UV.y - uv_height * uv.y * y_zoom * scale.y * 2.0); vec4 reflection = texture(screen_texture, reflected_screen_uv); vec3 reflected_water = mix(reflection.rgb, water_color.rgb, water_color.a); COLOR.rgb = reflected_water + vec3(waves_intensity); COLOR.a = smoothstep( 0.1, 0.35, clamp(waves, 0, 1) ); }

  • @isaiasgtgame3627
    @isaiasgtgame3627 6 месяцев назад

    It doesn't work and it doesn't give me an error: ///VAR: onready var camara = $CameraPlayer var linea_origen = Vector3() var linea_final = Vector3() ///CODE: //FUNC _PHYSICS_PROCESS(DELTA): var space_state = get_world().direct_space_state var mouse_position = get_viewport().get_mouse_position() linea_origen = camara.project_ray_origin(mouse_position) linea_final = linea_origen + camara.project_local_ray_normal(mouse_position) * 2000 var interseccion = space_state.intersect_ray(linea_origen, linea_final) if not interseccion.empty(): var pos = interseccion.position $ModelPlayer/Look.look_at(Vector3(pos.x, translation.y, pos.z), Vector3(0,1,0)) -HELP ME

  • @aleksandersanya1817
    @aleksandersanya1817 6 месяцев назад

    For some reason my dude keeps looking at the opposite direction even if I rotate every possible thing in the player scene 180 degrees. Edit: okay it seems to work if I make look_at from the video for the parent, and the child is turned around 180 degrees. Maybe this is wrong though, idk yet. Thank you anyways!

  • @R250Tv
    @R250Tv 7 месяцев назад

    Hi! I don't know why but my character faces the opposite way from the mouse, does anyone know how to fix this?

  • @applebard
    @applebard 7 месяцев назад

    Couple more Godot 4 notes: `tool` needs to be `@tool` SCREEN_TEXTURE is deprecated, but the error in the editor explains how to fix it :) Thank you for this tutorial!

    • @arva_dev
      @arva_dev 3 месяца назад

      You can fix "SCREEN_TEXTURE" using this code line. uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, repeat_disable, filter_nearest;

  • @Khio890
    @Khio890 7 месяцев назад

    For anyone trying to do this on godot 4 there are a few things you have to do differently: First you need to create a new variable called 'query' "var query = PhysicsRayQueryParameters3D.create(rayOrigin, rayEnd)" then you have to replace the var intersection shown in the video with "var intersection = space_state.intersect_ray(query)" (thanks to @rhevoramirez7969 for this) if this doesn't work or if you're getting an error that goes like "Nonexistent Function '...' in '...' " then I have no clue why but removing the rayOrigin and rayEnd variables and add "var" at the start of the rayOrigin and rayEnd In the _physics_procress() function works, and finally you have to replace "interesection.empty()" with "intersection.is_empty()"

  • @greighlinv
    @greighlinv 7 месяцев назад

    for the color picker in godot 4 uniform vec4 water_color : source_color;

  • @MaydayAcademy
    @MaydayAcademy 7 месяцев назад

    Thank you so much for these two great videos. Implemented it in Godot 4.1.1 and got most of it working. Only did not find out how to use your gradient material. So, if someone here knows, would be super happy if you could post an update here in the comments or somewhere. Many thanks ❤

  • @iFlxm3-Flamebearer
    @iFlxm3-Flamebearer 8 месяцев назад

    in godot 4 SCREEN_TEXTURE is replace by just normal TEXTURE

  • @willirittmann1917
    @willirittmann1917 8 месяцев назад

    Newbie question: I wanna create a collision for this, to make it I need to create a collision that changes it's shape (e.g: radius) over the time, or shaders also support smt like it? I believe that they only support "visual" stuffs

    • @Nolkaloid
      @Nolkaloid 8 месяцев назад

      Hi, short answer : shaders are only for visual stuff. If you want to add a collision to the shockwave you'll need to use a collision shape and change it's size in sync with the shader.

  • @neocoretec
    @neocoretec 9 месяцев назад

    First of all thank you. For (yet) unknown reasons the scale curve does not scale the particle at all. I'm using Godot 4.1.2 and up to the point where the scale curve is added, everything aligned well with your video. But the scale curve does not modify anything no matter what value I tweak. Any idea?

    • @Nolkaloid
      @Nolkaloid 9 месяцев назад

      Hi, in Godot 4 you need to go to the material of the assigned mesh in the draw passes and set "keep scale" to true in the "Billboard" section. In the GPUParticles3D node : Draw Passes > Pass 1 > Material > Billboard > Keep Scale

    • @neocoretec
      @neocoretec 9 месяцев назад

      @@Nolkaloid thank you for the immediately reply. I will try it

  • @FencerDevLog
    @FencerDevLog 9 месяцев назад

    Very nice video. I especially like the way you explain everything from the basics. I'm looking forward to more tutorials. 😎

  • @Rai2M
    @Rai2M 9 месяцев назад

    Very well explained.

  • @Playburger1337
    @Playburger1337 10 месяцев назад

    Cool that u coded this shader effect by urself :)!

  • @dijik123
    @dijik123 10 месяцев назад

    Really good

  • @noureddinealjazairi6063
    @noureddinealjazairi6063 10 месяцев назад

    Thnx so much this tutorial was exactly what i was trying to find for a long while but for some reason its not in the center and its elliptical idk why?

    • @Nolkaloid
      @Nolkaloid 10 месяцев назад

      It should be explained around 8:20

    • @noureddinealjazairi6063
      @noureddinealjazairi6063 10 месяцев назад

      @@Nolkaloid yeah I got it. It seems that I just forgot to put scaleuv instead of screenuv. Thanks. Also is there a way to exclude an object from getting affected by this shader?

    • @Nolkaloid
      @Nolkaloid 10 месяцев назад

      @@noureddinealjazairi6063 Put your node over the node that has the screen shader : deeper in the scene tree or with a higher z-index.

    • @noureddinealjazairi6063
      @noureddinealjazairi6063 10 месяцев назад

      @@Nolkaloid I think with a higher z index will work because my node is global. Thank you so much!

    • @noureddinealjazairi6063
      @noureddinealjazairi6063 10 месяцев назад

      @@Nolkaloid but for some reason I tried it and it didn't work. Is that related to it being a global node

  • @mio-xh1ln
    @mio-xh1ln 11 месяцев назад

    amazing video man, I'm using godot 4.0.3 and your tutorial works, didn't even run into a single problem! I'm curious though, the waves at the start of the video have like a white blanket on top of them, how did you do that? edit: nvm, got it myself, forgot that you mentioned it at the end of the video lol :D

  • @Zyiah
    @Zyiah Год назад

    Thank you lad!

  • @milkmadetea
    @milkmadetea Год назад

    Thanks for taking the time to upload this man. This would have taken years off my life to implement and decades off my life to animate by hand.

    • @m0-m0597
      @m0-m0597 8 месяцев назад

      i came for the cat character and stayed for the knowledge

  • @brandonstone2754
    @brandonstone2754 Год назад

    How do you get the white line on top?

  • @chippydsquirrel
    @chippydsquirrel Год назад

    SquidVille has enlightened me

  • @tonymorgan602
    @tonymorgan602 Год назад

    Hey, I'm having real problems implementing this in 4.0. Anyone else had any luck?

  • @user-fv8uv2us9r
    @user-fv8uv2us9r Год назад

    Жаль, что это для 2д( Да, база для 3д та же, но.. Как бы, сложнее Интересно как делать такое в 3д-пространстве вокруг бегущего персонажа..

  • @OLIV3R_YT
    @OLIV3R_YT Год назад

    Thanks!

  • @OLIV3R_YT
    @OLIV3R_YT Год назад

    Thanks!

  • @us3s
    @us3s Год назад

    Hi i'm super new to shaders. Is there a way to make this spawn on specific objects and have it be relative to that object instead of the screen? Or how woul dI have the shader follow an object?

  • @First_Lst
    @First_Lst Год назад

    What a great explanation. Great job.

  • @chocolatecoveredgummybears
    @chocolatecoveredgummybears Год назад

    great tutorial. would love more skill based shaders, think of diablo and poe! i have created some skills like frozen orb and whatnot, but warcry is pretty hard. not just in shaders, but for the effect. i use other nodes as well

  • @danielaguirre5078
    @danielaguirre5078 Год назад

    Thanks, i use individual nodes to make multiples ripples on screen (explosions), not the optimal way but it works for me.

  • @errormine
    @errormine Год назад

    Very well made tutorials. Some things are a bit different in Godot 4, but it still works great. Thanks so much.

  • @renji-hjk
    @renji-hjk Год назад

    yes yes yes yes the perfect shader to make dios the world just need a simple one to make black and white after the efect and perfect

  • @Developers_den
    @Developers_den Год назад

    thank you very much i was very tired of using diffrent methods and my brain eas going to explode you saved my life you are the best

  • @tschichpich
    @tschichpich Год назад

    I like that you don't just made the tutorial, but also gave some homework for us :)

  • @davidphillips9366
    @davidphillips9366 Год назад

    Would this work in Godot 4?

  • @rhevoramirez7969
    @rhevoramirez7969 Год назад

    Note: in Godot 4 its necessary to construct the query to call as argument for the intersection: var query = PhysicsRayQueryParameters3D.create(RayOrigin, RayEnd); var Intersection = SpaceState.intersect_ray(query), otherwise itwill not work ;)