GODOT(v3.5) how to add glow to sections of a sprite

  Рет қаралды 19,993

Rungeon

Rungeon

Күн бұрын

Пікірлер: 104
@felipefacundes1
@felipefacundes1 5 ай бұрын
What would this gdshader code look like for Godot 4? Because in Godot 4, it no longer works that way. If you could share the code, I would appreciate it.
@rungeon83
@rungeon83 5 ай бұрын
Hey, sadly this is an issue with Godot 4 as they've changed to Vulkin, so right now (I've checked) it doesn't seem able to do it using the enviromentnode, but maybe there is a shader that can do it, but it's more complicated now, which is annoying!!
@wagwan0
@wagwan0 4 жыл бұрын
Seeing some brackeys tutorial reflecting to godot feels nice.
@rungeon83
@rungeon83 4 жыл бұрын
Thank you :D yeah we need more Godot tutorials for sure! I'll be doing my best to make some that are a little more advanced.
@Chevifier
@Chevifier 4 жыл бұрын
@@rungeon83 I really want to start doing tutorials to I recently decided to fully convert to Godot from Unity because I just love the node based workflow.
@rungeon83
@rungeon83 4 жыл бұрын
@@Chevifier Well I started years ago before game engines, but I did go to Unity, then to game maker (as I was only doing 2d anyway and unity at the time was awful for 2d) and then back to Unity 2019 and HATED it, then tried Godot, I was really reluctant, but thought "I'll dedicate a month" and OMG I LOVE Godot. The node structure is great, but when you first use it, people tend to hate it, and I get it... but then after a month or so it's like I can't live without it haha. Just went through you're videos, dude your vids are much better quality than mine, you should jump on the Godot :D Also with Godot being new, there aren't crazy loads of Godot youtubers, so I have no doubt that's the only reason I get views but hey! I love teaching and am not doing it for views or subs, just wanna help as I HATE information not being aviaible that should be. Sorry for the essay!!
@rungeon83
@rungeon83 4 жыл бұрын
@@Chevifier P.S I should warn you Godot 3D is CRAP! It's much better than gamemakers and you can make 3d games, but it's awful compared to Unity. BUT I believe 100% this is gonna change with the release of version 4, updated to a much better visual work flow in Vlukin instead of opengl.
@Chevifier
@Chevifier 3 жыл бұрын
@@rungeon83 Not sure why im just seeing youre reply 2 months later sorry, I change my channel name to something more creative....my name😅, congrats on hitting 1k milestone btw. I really should get off my a$$🤜🤛
@gustbraga2736
@gustbraga2736 4 жыл бұрын
If the glow in your project works only on editor and not when you run the actual game, check if your Project Settings > Quality > Framebuffer Allocation is set to 3D. When you set it to 2D, the post-processing effects in shaders will not be available in the Enviroment, for what I understood. Great tutorial by the way, really pushed my game to the next level :)
@rungeon83
@rungeon83 4 жыл бұрын
Awesome bit of advance right here! I didn't know this myself! Thanks for the information, any tips like this is greatly appricated :)
@an_averagegamer
@an_averagegamer 8 ай бұрын
For everyone following this tutorial in godot 4.x hint_color has been renamed to source_color if you are encountering any errors try this change.
@hendrikwagner1508
@hendrikwagner1508 5 ай бұрын
thanks broo
@rungeon83
@rungeon83 2 ай бұрын
Thank you!
@Sean-gx1sf
@Sean-gx1sf 2 жыл бұрын
Thanks for this; this masking effect has a lot of applications outside of glow effects, it has been an awesome tool in general for me
@rungeon83
@rungeon83 2 жыл бұрын
This is fantastic to hear, you're most welcome, I'd love to see how you use it, please feel free to post links or join the discord server :)
@theothetorch8016
@theothetorch8016 2 жыл бұрын
I like to think that that's Aang from Avatar: The Last Airbender. Great show. Cool vid.
@rungeon83
@rungeon83 2 жыл бұрын
I've not seen it but saw adverts and I see what you mean. Thanks for the kind words man :)
@beebster7
@beebster7 3 жыл бұрын
You actually described the creation of your shader very well! Thank you, will come in handy.
@rungeon83
@rungeon83 3 жыл бұрын
Hey! Glad you found this helpful! I need to touch up on my shader stuff!
@JC-px9mk
@JC-px9mk 2 жыл бұрын
dude that was explained better than anything ive found so far. Thank you so much, I really appreciate it and love your style of explaining code. It makes me understand things and not just copying. Have a great time
@rungeon83
@rungeon83 2 жыл бұрын
This is awesome to hear, I use to copy and not take things in when I first started so I know how important it is to learn. Thanks for the kind words man!
@Crisisdarkness
@Crisisdarkness 2 жыл бұрын
This is one of the best shaders I have seen, I am very grateful, it can be applied to so many things, for example decoration objects, weapons, creature eyes, powers, this can give a lot of juice to the game, thank you so much bro
@rungeon83
@rungeon83 2 жыл бұрын
Hey man, you're so welcome bud! I've already seen someone use this (modified) in a game that's now on steam, which blows me away it really does! Glad you find it helpful!
@june_rain_video_game_company
@june_rain_video_game_company 4 жыл бұрын
WOW. This effect is beautiful. I am so glad i found your channel.
@rungeon83
@rungeon83 4 жыл бұрын
Hey! Thanks for the awesome comment!
@lynext2734
@lynext2734 4 жыл бұрын
Subscribed. Keep the good work up :)
@rungeon83
@rungeon83 4 жыл бұрын
Hey thank you :D
@ShekspirWell
@ShekspirWell 4 жыл бұрын
Wow, dude, It's awesome!
@rungeon83
@rungeon83 4 жыл бұрын
Hey thank you :)
@aurickmikleton8354
@aurickmikleton8354 4 жыл бұрын
Great tutorial, I definatley learned a lot from it.
@rungeon83
@rungeon83 4 жыл бұрын
Hey thanks for the awesome idea :D
@miriamgonzales331
@miriamgonzales331 3 жыл бұрын
From my mother CEL this tutorial Is great thank you very much !!!
@rungeon83
@rungeon83 3 жыл бұрын
Your mother is welcome :)
@hriday684
@hriday684 3 жыл бұрын
I was making a game in Unity, and then I realized that a big watermark right in the beginning wasn't really good for a project of my ambition. So I decided to switch to Godot. And this is exactly what I needed - I was actually having problems with the Brackeys video. I still haven't tried this one, though, and I'm a beginner at Godot. Edit: Are you using Godot mono? Because that's what I'm using...
@rungeon83
@rungeon83 3 жыл бұрын
Hey welcome to Godot! You'll find the community here a lot more willing to help (when they can), in my experience the best thing about Godot is the community, they're just awesome, the sharing of code etc, while Unity they have stores to sell assets which means people don't wanna share hard work, i get it! I'm using Godot Mono yes, I use mostly GDScript, however for certain things I'll use C#, I'd rather have C# there to use on more complicated problems, than it not be there. Good luck! I hope to see you make the next Godot big game :D
@hriday684
@hriday684 3 жыл бұрын
@@rungeon83 Thanks :)
@ccgb92
@ccgb92 4 жыл бұрын
Great tutorial, thanks
@rungeon83
@rungeon83 4 жыл бұрын
:D much appreciated!
@the_first_hunter
@the_first_hunter 3 жыл бұрын
Hey man, good tutorial Quick question, how does the glow applies only to that sprite?
@rungeon83
@rungeon83 3 жыл бұрын
You set the threshold of the glow in the worldenviroment node, then you change the modulate of the sprite so that it goes above that threshold, this way only that sprite will glow
@the_first_hunter
@the_first_hunter 3 жыл бұрын
@@rungeon83 thanks :D
@LudoD100
@LudoD100 3 жыл бұрын
Thanks a lot for this very inspiring tutorial. One question though : would this technique work with an AnimationPlayer rather than an AnimatedSprite ?
@rungeon83
@rungeon83 3 жыл бұрын
Honestly I'm not sure from the top of my head, the shader param passes the omission texture, j guess if you broke them up to single frames and pass the omission texture frame into the shader at the same time when the bronal texture frame is in the animation player it should work... Sorry that's confusing. I've learnt a better way of doing this that should work, I will do a tutorial as it's negates the shader.
@LudoD100
@LudoD100 3 жыл бұрын
@@rungeon83 thanks a lot for the quick answer. It is for the sword of my character that I want to glow and be able to change color by code. I’ll try with a second AnimationPlayer containing only the blade, will apply the glow on it and play it at the same time. Thanks for all those tutorials ! Looking forward to the next one.
@gamingghost7335
@gamingghost7335 3 жыл бұрын
thank you
@IvanSkodje
@IvanSkodje 4 жыл бұрын
Perfection
@rungeon83
@rungeon83 4 жыл бұрын
Thank you!
@Nnay3000
@Nnay3000 4 жыл бұрын
It does seems to work on a TileMap texture but only in the editor and I had to tweak the if to make it work : if (emission_color.r > 0.1). I can't figure out why in-game it does not show the glow, only the emission texture.
@glutentaco
@glutentaco 4 жыл бұрын
This is 🔥
@rungeon83
@rungeon83 4 жыл бұрын
Thanks man :D
@luislodosm
@luislodosm 3 жыл бұрын
Great
@rungeon83
@rungeon83 3 жыл бұрын
Thank you :D
@rafaelgpontes
@rafaelgpontes 4 жыл бұрын
Does this mean that shader processes the whole spritesheet and Godot slices it for each animation frame?
@rungeon83
@rungeon83 4 жыл бұрын
The shader returns the position of the animation frame, which will match up with the position of the Emission_texture frame in godot. If you changed your animation, then you would also have to change the emission texture in the shaderparams (this can be done in code quite easily though)
@xCratuss
@xCratuss 2 жыл бұрын
hi, i followed your tutorial step for step and even rewatched it a couple of times but i still have the issue that when i add my glow color in the shader (COLOR = (emmission_color + glow_color)) it removes the greyscale of my emmision texture. the glow effect works correctly but the part of the texture that's glowing is only a white field without any texture on it. I tested some things and what i notice is: When i mupliply the colors (COLOR = (emmission_color * glow_color)) instead of add them, the texture comes back but the glow is gone. Without the glow color at all the greyscale is working as well. (COLOR = emmission_color) Do you have any idea how i can fix it? maybe it's a change in godot? The tutorial is from 2020 so maybe they changed something in the shader structure.
@rungeon83
@rungeon83 2 жыл бұрын
Oh wow yeah good call on the 2020, a lot has changed, and in all honesty it sounds like you're more advanced at this stuff than me! I know this might be a stupid question! But are you using GLSE 3? and have you downloaded my Github project (it's in the description) If that project is not working, then I would say it must be a change, I'm going to download it now and make sure it still works, thank you for pointing this out :) I'll get back to you with the results.
@rungeon83
@rungeon83 2 жыл бұрын
Hey so I retried it and I'm not having an issue, I have tried a new project, where you can do this WITHOUT the shader, so was thinking maybe this might help you? Instead of making the emission map with black, you remove all the black from it, you then put that as a nother animationsprite ontop of the player animationsprite and changed the selfmodulate property to high numbers (use raw values) This way, it's kinda easier because when you switch animations, you can change both animationsprites , rather than having to import a new texture into a shader each time which is more work. I will upload the project for you to download, have a look at it :) If you're having issues, please join the discord, we have a godot expert way more clued up than me. www.dropbox.com/sh/25r1fjw8ehntmme/AADT9lhauv_Eom3LwRmbcDLUa?dl=0
@Chevifier
@Chevifier 4 жыл бұрын
shaders always scare me but Ive been here learning them like crazy. 1 1think im realizing now is that shaders seem to be like one big complex loop function with the loop count the size of the pixels of an image(maybe im wrong)
@rungeon83
@rungeon83 4 жыл бұрын
Shaders are easily the hardest thing for me, everyone says check out the book of shaders, but then I got a little stuck in chapter 3 or 4 haha Shaders are like magic, they do things that should eat your system up, but because it runs on the GPU it's mega fast.
@skaruts
@skaruts 3 жыл бұрын
It's even better than a loop: it's threads. The GPU is a bajillion microscopic processors working all at the same time on each pixel. :)
@rattleheadx
@rattleheadx 4 жыл бұрын
Great tutorial, but I've hit a snag using this process... If you apply this technique to a variety of different sprites, Godot complains because you're only supposed to have one WorldEnvironment. So, for example, in the project I'm working on, the player's ship has an explosion animation that uses this effect. The player's weapon shots also use this effect. The shot is a separate scene that gets instanced when the player fires. This causes Godot to throw warnings because the player ship has it's own WorldEnvironment and every shot that gets instanced also has a WorldEnvironment node. How does one get around this limitation? I tried using the Local To Scene option, but that doesn't seem to apply to this particular issue.
@rungeon83
@rungeon83 4 жыл бұрын
Hey thank you for the comment! So you are only meant to have one WorldEnviroment per level, this is a global effect. I would suggest putting it as a singleton, and remove it from all your other scenes, this way it'll ensure only one copy can exist at all times. I hope this can help. :)
@rattleheadx
@rattleheadx 4 жыл бұрын
@@rungeon83 Thanks for the quick response! I'll experiment with that and see if we can make it work with our project. If we were to need the ability to do per-scene shader effects that can be adjusted independently rather than from a single WorldEnvironment, do you know of any other methods for this?
@rungeon83
@rungeon83 4 жыл бұрын
Brandon Luffman hey sorry for the late reply! kzbin.info/www/bejne/oGbZaYKMnNOfsKM this tutorial will show you how to apply glow to multiple objects at different levels using just one worldenrviroment node. Is this what you meant? This way you could have all your bullets glow slightly, maybe you have a fire object that could be really bright glow and a player charter that doesn't glow, all using one WorldEnviroment
@rattleheadx
@rattleheadx 4 жыл бұрын
@@rungeon83 Great! I'll check that out. Right now we're trying attaching the WorldEnvironment node to the level's node tree, and that works. We just don't have adjustments for intensity, etc. on an individual sprite basis. But, it is working out okay so far. I'll check that video out though. Thank you very much! :-D
@RamHomier
@RamHomier 4 жыл бұрын
​@@rattleheadx Hey I am not sure I have the ultimate answer here but I am also trying to control glow on individual elements, controls in my case not sprite but should work the same. I believe you can play with the modulate value of the node and you can control the intensity of the glow that way. Try values of 2,3,4 and 5 it is increasing the glow.
@nitrogamesstudios5276
@nitrogamesstudios5276 2 жыл бұрын
How do you tell the shader, hey look out the blue pixels and change those by red????
@erena.4659
@erena.4659 4 жыл бұрын
Would be nice if you could show how to do this in the visual thingy :D
@rungeon83
@rungeon83 4 жыл бұрын
haha Honestly I never used Visual Shaders/Coding, it seems way harder to my brain than writing out code :(
@fecu2394
@fecu2394 4 жыл бұрын
You're better off using clamp, max and min in shaders than branching on if statements.
@rungeon83
@rungeon83 4 жыл бұрын
I'm checking if a value is more than 0, how would you use clamping to simulate this so I can avoid using a condition statement? I'm new to branchless programming but understand why it's faster as the CPU tries to do future work before hand and if it has a branch then it can't know so it slows the method down. Any help on how I'd do this would be great. Thanks for the comment and the idea :D
@rungeon83
@rungeon83 4 жыл бұрын
I prob should point out that this is for beginners, so conditional statements for now are okay and shaders are crazy fast as is. But it would be a nice topic to expand upon.
@fecu2394
@fecu2394 4 жыл бұрын
@@rungeon83 Ah, I'm wishing I hadn't brought this up, it's a tricky issue. :) First, you have to be careful with branchless programming because you're always second guessing the compiler which, as often as it can, renders things branchless anyway. Tequivalent in memory, iAs you say, the CPU preloads instructions but at the branch it can't do that so it has to wait for the evaluation so I theory - not always in practice - this is faster. simultaneously
@fecu2394
@fecu2394 4 жыл бұрын
Oh, no. I wrote such a long explanation and I must have highlighted and deleted most of it when I hit send. Ugh, it took ages too... Grr.
@sestalacto
@sestalacto 4 жыл бұрын
thanks a lot :D
@rungeon83
@rungeon83 4 жыл бұрын
Not a problem! :D
@adriantome278
@adriantome278 4 жыл бұрын
How can i implement it if i wanna add more animations?
@rungeon83
@rungeon83 4 жыл бұрын
When you change the animation in animation sprite, you also have to pass the emission map for that animation into the shader in code. So If key jump is pressed: Change animation sprite to the animation Change uniformed texture in the shader to the emission texture of that animation.
@adriantome278
@adriantome278 4 жыл бұрын
@@rungeon83 Lot of thanks!!
@rungeon83
@rungeon83 4 жыл бұрын
@@adriantome278 I just checked over my code, but if this helps export(Texture) var run_emission_texture func _process(delta): if(Input.is_action_just_pressed("ui_accept")): $AnimatedSprite.animation = "run" var mat = $AnimatedSprite.material mat.set_shader_param("emission_teture",run_emission_texture) This is how you'd do it, I hope that can help, if you have any issues, give me a shout.
@glutentaco
@glutentaco 4 жыл бұрын
I noticed this isn't working on Android in godot. Any thoughts? It looks like shaders in general don't work too well...
@rungeon83
@rungeon83 4 жыл бұрын
Jason Baker that's because this is gles3, I made a tutorial on how to get an effect like this on android using gles2 if you look at my very latest video. Hope this helps and thanks for the comment :D
@glutentaco
@glutentaco 4 жыл бұрын
@@rungeon83 Thanks! I'll check it out. I'm a noob to Godot and game design in general. But, isn't gles3 supported on a lot of android devices since Nougat? Is the engine the reason?
@glutentaco
@glutentaco 4 жыл бұрын
@@rungeon83 Also, I'm designing a 2d game for both mobile and pc. If I switch to GLES2, will I regret it? I am reading mixed opinions on reddit. Curious about your opinion. Thanks mate!
@rungeon83
@rungeon83 4 жыл бұрын
@@glutentaco Not a problem, i'm no expert myself to be honest. I haven't heard of Android supporting GLES3 but there might be some newer ones that do, not sure. I do know that if you are releasing on mobile, then 100% go GLES2. You could branch of and have 2 versions 1 for pc 1 for mobile. It's not as much work as it sounds.
@glutentaco
@glutentaco 4 жыл бұрын
@@rungeon83 Thanks! That's actually not a bad idea. I'll look into it. Love the content. Thanks for taking the time to share.
@turbotegs2102
@turbotegs2102 3 жыл бұрын
what if I want the glow to be more pixelated?
@rungeon83
@rungeon83 3 жыл бұрын
I see what you mean, this I don't think you can do it without additional work, such a pixelated glow shader. I also think you might be able to fake glow, so you draw a pixelated gradient glow and then place it directly on top of the sprite you wish to glow. Infact I KINDA did this myself but it was a light. I'll link you up. kzbin.info/www/bejne/qJPUfYV3l7qnbJo at 19:20 of that video, might give you some ideas
@turbotegs2102
@turbotegs2102 3 жыл бұрын
@@rungeon83 thanks for replying and the link you shared is exactly what I am doing rn but have been on the lookout for a shader that could do it for me, because I'm lazy...
@rungeon83
@rungeon83 3 жыл бұрын
@@turbotegs2102Hahaha nothing wrong with lazy :D. Ill keep an eye out for a pixel glow shader
@turbotegs2102
@turbotegs2102 3 жыл бұрын
@@rungeon83 I've only ever seen a pixel shader but there is no way of applying that to the glow as I know right now ty for your help though
@gravitowl
@gravitowl 4 жыл бұрын
How to do this for 3D?
@rungeon83
@rungeon83 4 жыл бұрын
Good question, as I've only ever once used 3d in godot, I can't tell you. But have you tried this in 3d? Maybe it's as simple as adding the worldenviroment node, the glow is actually a 3d effect but yes I'd be interested if you do produce this. Let me know if you do :)
@gravitowl
@gravitowl 4 жыл бұрын
@@rungeon83 Well i think you need to change sampler2D to sampler3D and than i need a 3d texture, as idk how to make it otherwise and i don't know how that works. First time i even met shaders in godot in this video..
@POLCODERA
@POLCODERA 4 жыл бұрын
The lesson is good, but why doesn't it work on Android? Translation from the translator.
@rungeon83
@rungeon83 4 жыл бұрын
It's because android uses GLES2 while this is only going to work with GLES3, I found this out after I made the tutorial.
@POLCODERA
@POLCODERA 4 жыл бұрын
@@rungeon83 , thank you for your quick response!
@POLCODERA
@POLCODERA 4 жыл бұрын
@@rungeon83 Can you do a lesson on GLES2?
@rungeon83
@rungeon83 4 жыл бұрын
@@POLCODERA I'm not sure how I would do this effect on GLES2 as it doesn't support this glow. I think there might be a work around, leave it with me and If I'm able I'll make the video :)
@rungeon83
@rungeon83 4 жыл бұрын
ooooh kay, I kinda have a work around, and it seems to work okay in GLSE2 but with a little less control, but it's better than nothing. I'll try make the vid in a moment :)
Starter state machines in Godot 4
10:58
The Shaggy Dev
Рет қаралды 59 М.
Un coup venu de l’espace 😂😂😂
00:19
Nicocapone
Рет қаралды 10 МЛН
1 сквиш тебе или 2 другому? 😌 #шортс #виола
00:36
Бенчик, пора купаться! 🛁 #бенчик #арти #симбочка
00:34
Симбочка Пимпочка
Рет қаралды 2,9 МЛН
GODOT TUTORIAL : 2D Reflective water shader
18:43
Nolkaloid (Noé Le Cam)
Рет қаралды 21 М.
4 Godot 4 Devs Make 4 Games in 44 Hours
25:19
DevLogLogan
Рет қаралды 527 М.
BETTER 2D visuals in 7 EASY TIPS
10:38
MrEliptik
Рет қаралды 71 М.
Make a 2D "Ghost" effect in Godot
16:34
Mister Taft Creates
Рет қаралды 27 М.
GODOT TUTORIAL: Shockwave shader for noobs
15:48
Nolkaloid (Noé Le Cam)
Рет қаралды 53 М.
I Made a Minecraft Clone in C++
10:15
WSAL Evan
Рет қаралды 70 М.
How Games Make VFX (Demonstrated in Godot 4)
5:46
PlayWithFurcifer
Рет қаралды 350 М.
I Made My First Game in Godot in 3 Weeks...
26:21
Jack Sather
Рет қаралды 389 М.
Godot Shader Tutorial (1): Intro to Shader Programming
23:09
GDQuest
Рет қаралды 149 М.
Using Composition to Make More Scalable Games in Godot
10:13
Firebelley Games
Рет қаралды 235 М.