For those interested in trying to apply this to a URP project with a 2D Renderer: - You'll need to be on Unity 2021 - Add a new Sorting Layer. Make it render on top of everything else (bottom of sort layer list) - In your 2D Renderer Data You'll want to change "Foremost sorting layer" (under "Camera Sorting Layer" to be the 2nd highest layer (the oldest high priority layer which rendered on top of everything else before you created your new layer) -Create the shadergraph shown in this video, but at 05:57 instead of hooking up a 'UV' node to the add node, hook up a "Screen Position" node instead. -Leave the "MainTex" texture as an exposed property, but disconnect it from the "Texture" input in the "Sample Texture 2D" and instead replace it with a 2D Texture called "_CameraSortingLayerTexture" (and ensure the Reference is called EXACTLY that. This Texture should NOT be exposed.) -You won't be creating a blit, instead you'll apply a material with this shader onto a sprite in your scene large enough to cover the whole playing area. Now you can just enable/disable this sprite whenever you want to "trigger" the ripple to start. Some of these steps may be changeable, I'm just writing what worked for me in my project. Cheers!
@@lougarczynski129 what is a full screen pass render feature what do you mean by that. edit: its one of the render features at the bottom in Renderer2D, my bad
Incredible introduction to shader graph and amazing explanations - have bookmarked this introduction and I'm sure I will be returning often just to get my bearings. Your comment at the end about driving the timing of the shock wave from a script instead of using the shader _Time actually solved my only remaining question. Thank you!
Hi, thanks for your awesome tutorial! I only have one question: what about making it Fullscreen but in HDRP pipeline? I'm trying to swith to a fullscreen-type material and use CustomPass, but I can't manage how to avoid using a specific texture (since I need instead the screen itself)! Could you please help me?
shockwave get the distance from a point clamped 0 to 1 put it through sin clamp 0 to 1 again to discard negative values for black (maybe) boom basic circle waves just add time onto the result of the distance node and you get the wave moving out from that point
Hey Bill, sorry to bother, but I was curious about localizing this shader effect to a particular location on an event. Creating the event trigger isn't a problem as I am just using a changing field value to determine off or on. What I'm struggling with is having the shader trigger and eminate from a particular location on this trigger. Any suggestions? (Would like this to affect the full screen)
I think what you are asking is how to control the "focal point" from code (or other outside shader-graph control). If that's the case, it's covered in my newest video: ruclips.net/video/A5jl5RVEjqE/видео.html if you're asking something else, please elaborate and I'll do what I can to answer.
yes. The easiest way to do that would be to take the majority of the shockwave logic and put it into a subgraph (select the nodes, right click, create subgraph). Set it up such that the percent complete and the focal point of the shockwave are inputs to the subgraph. Once that is set up, you can have this multiple times in your graph, with different focal points and progress.
@@GameDevBill "Once that is set up, you can have this multiple times in your graph, with different focal points and progress." Do you mean copy and paste it multiple times in the graph and put multiple properties on the graph aswell like perecent_01,percent_02 etc? I'm trying to build a manager script which is triggered for example when an enemy dies. So in theory it could trigger hundreds of times at once. How would you do this? I'm currently totaly lost^^" Absolutely awesome tutorial btw :)
Greetings. I found this tut extremely helpful. for some reason I cannot replicate your result. I have an assumption it has something to do with the naming of the texture2D to _mainTex. Can you please elaborate the importance of this and where it is referenced in your scene? I don't see where you added a texture to the node but yet it projects on the plane. Thank you.
Hey! Great tutorial, i have a question, how can i apply this on a bullet spawn? Cuz im modifying the size from 0 to 0.1, but always shockwave spawn on different time (like the material is always repeating).
Hi there ! Awesome video with crystal clear explanations ! Very nice ! I managed to obtain a fullscreen shockwave effect in the URP renderer2D thanks to your video and the updated version of Cyan's Custom Blit. I would like to have at some point several simultaneous shockwaves and wondered if this distortion effect could be achieved in the 2DRenderer differently ? (for example with particles)
From playing around with this, II've figured that if you multiply the step before adding the created nodes to the UV variable (which is then connected to the sample texure 2D) with a sine wave node, you get interesting effects and variations. I'm not sure if that's what you were looking for, but it may be a good place to start
Hi! Thanks a lot for doing this tutorial and explaining what each node does! Not many people do that, and it's great to be able to actually understand what's going on as a beginner. I'm trying to make the wave event based, and my plan is to remove the time variable and create a lerp function, that interpolates between the wave's start and end values (which is represented by a float). This is well, but the weird thing is that, when 0 is the value being multiplied into the time group, the wave's already 'started', i.e, the pixels get distorted. In fact, the sprite is not distorted. i.e the wave's at it's 0 progress, when the input value is -0.24. The wave ends on 4.76. My question is, where did these numbers come from? I can create an interpolation function to make the exposed value be between 0-1, but I'm afraid that whenever I tinker with other settings, these magic numbers (-0.24 and 4.76) will change. Maybe someone here has done this?
I thought about going into that more, but was feeling long on time. Basically, if you want to run a shockwave through a more 3d object, start with the shader i had at the end of the video, that i start creating at 14:06. And make these changes... Change FocalPoint, and the Direction & Distance calculations to use all 3 dimensions. Then, at the end, where I add my ring shape to Y, instead multiply that by the Normal (x,y,z) and add that to the position (x,y,z). I haven't actually built this, so i may be of on a few bits, but that should head you in the right direction
Chris - in my next tutorial (using Timeline to animate shader graphs), I take the 2D shockwave graph in this vid and update it for 3D quickly before doing the timeline stuff. So be sure to check that one out... ruclips.net/video/A5jl5RVEjqE/видео.html
Kevin - If you are animating a sprite that is partially transparent, it'll work to move the parts that have at least some opacity. But if you are talking about placing a shockwave onto some other object, sorta like a sticker, that is something else. Doable, but a slightly different technique. If you want to have a longer conversation about it, feel free to ping me @GameDevBill on the Unity forums, or reply to this thread forum.unity.com/threads/gamedevbill-tutorial-comment-thread.945515/ (or ping me on Twitter)
What if i have 10 balls ( 2d sprites ) in my scene, and i want a shock wave go through them ? , we can only apply this shader to 1 sprite , whats the solution , i hope you understand
Hi, nice tutorial. My shader works in game view but not in the scene view, is there a setting that I need to enable? I'm using Unity 2020 3.14, and I'm working on the default HDRP project with shader applied to a quad.
Thank you for your awesome tutorial videos! :) Could you please tell me - is it possible to use any variant of these shockwave shaders with an Experimental 2D Renderer? -I was hoping for a full-screen version, but I could not configure it according to your other article, which describes the connection of the Blit script from Cyan - when using the "Experimental 2D Renderer", the data asset simply does not have the "Add Renderer Feature" function. And although the list of features is visible in debug mode, there is no way to add a Blit "manually" ... I apologize for the google translate.
Honestly I have not done any work with the experimental 2D renderer yet, so I'm not sure how to get a full screen shader set up there. I'll add it to my list to research, but being experimental, I'd expect it to be short on features, and probably often-changing.
@@GameDevBill I beg you. Please could you make a video about how to implement this (link below) to 2d game with URP. 6:36 ruclips.net/video/UsGuN69g2NI/видео.html It works without URP but how to set up with it. I am so desperate
I will immediately apologize for my English, I use google translate. How do I spawn this shockwave in place of a player in a 2D game. I tried to take a player position through WorldToScreenPoint and its other forms, but the place of the wave spawn is somewhere in the corner of the screen all the time?
This is incredible, however, how does one make a fixed zone where an effect can happen on a sprite? for ex. take a sprite tree with branches, leaves and all. say we added wind effect shader, what nodes would help to avoid the branches or barks and things that shouldn't move opposed to things that need to move? is there a better way to control zones?
Hello, thank you for the tutorial! and may I ask you some question please? I wish I can switch on and off this effect using key press, how can I set full screen effect's properties through script? I am trying to reference ForwardRendererData->RendererFeature->BlitMaterial on script but I cannot find the way to do this... at last, thanks again and sorry for my bad english..
I've been working on a video to show how to do this for objects, but hadn't thought of testing it on full screen effects. If you can access the material, you can use things like SetFloat to set shader inputs (replace the Time node with an input). But, as I said, I hadn't thought about how exactly this would work for a full screen effect. I'll be sure to test that and include it in my next video. This is the SetFloat thing I was talking about: docs.unity3d.com/ScriptReference/Material.SetFloat.html
Does this work over transparent objects? I made a similar effect from a different tutorial and it makes transparent things disappear when the effect is over them
Depending on your renderer, there are ways to turn a full acreen shader on or off (see gamedevbill.com/full-screen-shaders-in-unity/ for info on setting this up in different renderers), but likely the easier solution is a shader parameter. This could either be a dedicated param to the shader, or just the already existing percentage input. That percentage input that does the animation now could be set to some value that doesn't distort the image, like -0.5, or maybe 1.5. You should be able to play with it to find some value that equates to "off"
Bill, let me ask you something. I'm using HDRP. In your web, you write "Note that the shader has to be code based.(...)only code shaders will work." Does this mean this effect in impossible to achieve in HDRP? 😥
Sorry, I should have been more clear. In HDRP, any _full screen_ effect must be done with a code shader, not a shader graph. So if you are doing it on an object, HDRP or URP is the same. If you are doing it on the full screen, URP is as-shown, but for HDRP you'd need a code version. I cover all the different ways to set up full screen shaders here: gamedevbill.com/full-screen-shaders-in-unity/ I believe you can also use a shader graph to generate a code shader in HDRP, though I've only actually tested that in URP. I cover how to do that in URP here: ruclips.net/video/beSRCSRS6mI/видео.html (this video is about geometry shaders, but you can ignore most of the rest of the video)
@@GameDevBill Thank you very much for the detailed answer! I'll continue trying. So far, I managed to do this same effect in HDRP (or very similar) applying it to a circle sprite, child of the camera, that simply grows from the center 😊 But I'll try the full-screen way. Thank you very much. I love your videos.
I could not understand how you render this sprite without choosing MainTex, at 08:02 in the video sprite is rendering on scene with the shader effect but MainTex is empty in Inspection. Could you please help me to understand what is going on. When I choose MainText, it works fine as a material on plane but it is filling whole screen when I am using as screen effect. Related point in the video: ruclips.net/video/dFDAwT5iozo/видео.html
Hey dude , that was what I have been waiting for a long time. But seems like something is missing ... I need a code example to trigger this effect . Enabling or disabling this effect from the code should be nice , but also triggering it for once would also be a real solution. For now I will try to add a start time to the shader and command the effect via the material,but something more reliable would be appriciated ...
I thought about covering that, but decided to pull it for time. There isn't a good way to "trigger" it from code, but you can "drive" it from code. The difference I'm referring to is "trigger" would mean your code just says "start" and the shader users its own Time from there. This is hard as you don't know if you'll trigger it mid-cycle. Driving it is a lot easier. The main option is to replace the use of Time with Vector1 input. I don't have a video on how to drive this from code yet, but I do have a related write up. A while ago I covered this for code driven shaders here (in the "custom inputs" section): gamedevbill.com/shader-series-3-shaders-in-unity/. The game code should be the same for a shader graph or a code shader. The other option to drive inputs is to make the input a Color instead of a Vector1, then use something like DOTween pro to drive it. That's actually what I'm doing in the video because it lets me easily sync the knife flight and the animation. I plan to make a video on this trick soon.
@@GameDevBill Thanks for the answer. I added a parameter to the shader. Instead of using Time node, I am giving a vector1 parameter to the material. So that I can decide which part of the cycle will be processed by the shader. I am changing the parameter to simulate the progress. Seems like working for know . As long as I keep the parameter at 0 state , nothing happens, when I tween it from 0 to 1 , a cycle is processed smoothly. Which gave me full control on the effect on scripting side. I was crippled on URP full screen shader effect untill you made that blit video. Thanks dude . Brackeys gave up fighting with changes in unity , It is nice to have people keep on fighting with it.
Just wanted to let you know that your question inspired my latest video: ruclips.net/video/A5jl5RVEjqE/видео.html It takes this shader, makes it more 3D, then shows how to drive it from code or Timeline.
I'm using URP. In this video, I'm on version 8, and just updated the description to talk a little about what is different in URP & Shader Graph version 10.x
@@GameDevBill Thanks, despite what they say about "It won't work!", I'm trying to see what happens when distortion is present on the quest Beat Saber walls.
I got the 2d one to work but am having trouble with the 3d one. Any help would be appreciated. Does anybody have the completed 3d working? I have followed the yt and the write up. There are things missing.
I think 2d cameras in URP will still follow the same steps I outline here: ruclips.net/video/4apbNiPC3yQ/видео.html. AFAIK there's only one camera type in URP, and it becomes "2D" by setting it to Orthographic instead of Perspective. Assuming that's the case, it should just work with the above instructions.
unfortunately this just makes my object jitter from side to side. not really sure why it's not rippling the vertex shader from the middle like the 2d ripple at the beginning. also, this doesn't seem to work on other objects i have in the scene.
Hi, Hope you see this, I followed your tutorial until 7:50, after that I inverted the time, so it's a ring from outside to the center, but I wanted to the ring slowly faded near the center, so I added a Lerp after "One Minus" and "Multiply" with the A being the Wave effect and B Zero, but I'm having a problem with the T. Tried to link with all the Time Node and no one give me the effect that I wanted, tried to split the "Subtract" node and get the Alpha or RGB value, but didn't work either. Changing manually the X of Lerp I achieve the effect, but I can't find an automatic way to do that. I'm new in the Shader Graph, and I'm just playing around to learn, if you or someone else can help me, I'll be very grateful.
It's a bit hard to follow the changes exactly. If you reply to my forum thread here forum.unity.com/threads/gamedevbill-tutorial-comment-thread.945515/ and post a screenshot of your updated graph, I can take a look.
Less helpful answer: I'm working on a video to cover exactly this right now. Likely out in a week or two. Slightly more helpful: replace the Time node with an input. Once that is there, you would tween the input from 0 to 1 after a trigger. This could be done a number of ways, including from code. Again, more details coming in my next video
Likely this is due to a setting in the scene view. The absolute best way to verify the shader is working is to enter play mode (and make sure your camera sees the thing affected). If that works, then your shader works, and it's a matter of fixing the scene view to cooperate. In 2019 and older the setting is called "animated materials" under the "Toggle..." menu at the top bar of the scene view. In 2020.2 or newer I believe it's "always refresh", though I'm not totally sure of that. I haven't spent much time in 2020.2 yet. If nothing happens in play mode, then the shader isn't working, and we've got a different problem.
For those interested in trying to apply this to a URP project with a 2D Renderer:
- You'll need to be on Unity 2021
- Add a new Sorting Layer. Make it render on top of everything else (bottom of sort layer list)
- In your 2D Renderer Data You'll want to change "Foremost sorting layer" (under "Camera Sorting Layer" to be the 2nd highest layer (the oldest high priority layer which rendered on top of everything else before you created your new layer)
-Create the shadergraph shown in this video, but at 05:57 instead of hooking up a 'UV' node to the add node, hook up a "Screen Position" node instead.
-Leave the "MainTex" texture as an exposed property, but disconnect it from the "Texture" input in the "Sample Texture 2D" and instead replace it with a 2D Texture called "_CameraSortingLayerTexture" (and ensure the Reference is called EXACTLY that. This Texture should NOT be exposed.)
-You won't be creating a blit, instead you'll apply a material with this shader onto a sprite in your scene large enough to cover the whole playing area. Now you can just enable/disable this sprite whenever you want to "trigger" the ripple to start.
Some of these steps may be changeable, I'm just writing what worked for me in my project.
Cheers!
You SIR! Have made my day! Thank you so much!!!
You can do this in 2022 with a full screen pass render feature
Tutorial from the instructions the guy gave above: ruclips.net/video/-spc1GJAtLY/видео.html
@@lougarczynski129 what is a full screen pass render feature what do you mean by that.
edit: its one of the render features at the bottom in Renderer2D, my bad
Incredible introduction to shader graph and amazing explanations - have bookmarked this introduction and I'm sure I will be returning often just to get my bearings. Your comment at the end about driving the timing of the shock wave from a script instead of using the shader _Time actually solved my only remaining question. Thank you!
Glad it helped!! :)
You are a savior!! Really helped me out on my project for my internship. Thanks a Ton for this tutorial.
So glad it helped. Thanks for the kind words :)
Very cool, thank you a very straightforward and clear tutorial structure!
Glad it was helpful!
Hi, thanks for your awesome tutorial! I only have one question: what about making it Fullscreen but in HDRP pipeline?
I'm trying to swith to a fullscreen-type material and use CustomPass, but I can't manage how to avoid using a specific texture (since I need instead the screen itself)! Could you please help me?
Perfect tutorial, exactly what I was looking for
I'm not looking for this effect but just enjoy watching your video
I appreciate that :)
shockwave
get the distance from a point
clamped 0 to 1
put it through sin
clamp 0 to 1 again to discard negative values for black (maybe)
boom basic circle waves
just add time onto the result of the distance node and you get the wave moving out from that point
Thanks man! You have helped a lot, especially with the blit on your site. Much appreciated!
Glad to hear it!
this is awesome, thank you for the comprehensive tutorial
Glad it was helpful!
Hey Bill, sorry to bother, but I was curious about localizing this shader effect to a particular location on an event. Creating the event trigger isn't a problem as I am just using a changing field value to determine off or on. What I'm struggling with is having the shader trigger and eminate from a particular location on this trigger. Any suggestions? (Would like this to affect the full screen)
I think what you are asking is how to control the "focal point" from code (or other outside shader-graph control). If that's the case, it's covered in my newest video: ruclips.net/video/A5jl5RVEjqE/видео.html
if you're asking something else, please elaborate and I'll do what I can to answer.
Such a great tutorial
thank you for your time making this
You're very welcome! I'm glad you liked it
Fantastic! Thanks for doing these. Would love to see more :D
Thanks for the kind words, more tutorials are to come!
Amazing tutorial! Was wondering if there is any way to allow for multiple shockwaves at once.
yes. The easiest way to do that would be to take the majority of the shockwave logic and put it into a subgraph (select the nodes, right click, create subgraph). Set it up such that the percent complete and the focal point of the shockwave are inputs to the subgraph. Once that is set up, you can have this multiple times in your graph, with different focal points and progress.
@@GameDevBill "Once that is set up, you can have this multiple times in your graph, with different focal points and progress." Do you mean copy and paste it multiple times in the graph and put multiple properties on the graph aswell like perecent_01,percent_02 etc? I'm trying to build a manager script which is triggered for example when an enemy dies. So in theory it could trigger hundreds of times at once. How would you do this? I'm currently totaly lost^^" Absolutely awesome tutorial btw :)
Greetings. I found this tut extremely helpful. for some reason I cannot replicate your result. I have an assumption it has something to do with the naming of the texture2D to _mainTex. Can you please elaborate the importance of this and where it is referenced in your scene? I don't see where you added a texture to the node but yet it projects on the plane. Thank you.
Hey! Great tutorial, i have a question, how can i apply this on a bullet spawn? Cuz im modifying the size from 0 to 0.1, but always shockwave spawn on different time (like the material is always repeating).
I see that beautiful Desmos graph!
Lol, sharp eye 😃
Can you post a pic of the complete 3d vector graph? OR post the shader file somewhere?
Hi there ! Awesome video with crystal clear explanations ! Very nice !
I managed to obtain a fullscreen shockwave effect in the URP renderer2D thanks to your video and the updated version of Cyan's Custom Blit. I would like to have at some point several simultaneous shockwaves and wondered if this distortion effect could be achieved in the 2DRenderer differently ? (for example with particles)
Excellent tutorial. Keep them coming (especially 2D stuff!).
I've slowed down a bit, but am planning to get back to it soon. Thanks for the kind words
Well explained! Thank you for the tutorial, Mr Bill :D
Glad it was helpful!
How can we alter the sine wave like you mention around 9:00? Would love to have this work with multiple ripples.
From playing around with this, II've figured that if you multiply the step before adding the created nodes to the UV variable (which is then connected to the sample texure 2D) with a sine wave node, you get interesting effects and variations. I'm not sure if that's what you were looking for, but it may be a good place to start
Hi! Thanks a lot for doing this tutorial and explaining what each node does! Not many people do that, and it's great to be able to actually understand what's going on as a beginner.
I'm trying to make the wave event based, and my plan is to remove the time variable and create a lerp function, that interpolates between the wave's start and end values (which is represented by a float). This is well, but the weird thing is that, when 0 is the value being multiplied into the time group, the wave's already 'started', i.e, the pixels get distorted. In fact, the sprite is not distorted. i.e the wave's at it's 0 progress, when the input value is -0.24. The wave ends on 4.76.
My question is, where did these numbers come from? I can create an interpolation function to make the exposed value be between 0-1, but I'm afraid that whenever I tinker with other settings, these magic numbers (-0.24 and 4.76) will change.
Maybe someone here has done this?
Sweet! Any quick thoughts on how this could be done as a 3D shockwave? Like a big weapon smashing the ground
I thought about going into that more, but was feeling long on time.
Basically, if you want to run a shockwave through a more 3d object, start with the shader i had at the end of the video, that i start creating at 14:06. And make these changes...
Change FocalPoint, and the Direction & Distance calculations to use all 3 dimensions.
Then, at the end, where I add my ring shape to Y, instead multiply that by the Normal (x,y,z) and add that to the position (x,y,z).
I haven't actually built this, so i may be of on a few bits, but that should head you in the right direction
@@GameDevBill does the sprite shader work even if the sprite it’s transparent? I need the shockwave effect to be overlaying on something else
Chris - in my next tutorial (using Timeline to animate shader graphs), I take the 2D shockwave graph in this vid and update it for 3D quickly before doing the timeline stuff. So be sure to check that one out... ruclips.net/video/A5jl5RVEjqE/видео.html
Kevin - If you are animating a sprite that is partially transparent, it'll work to move the parts that have at least some opacity. But if you are talking about placing a shockwave onto some other object, sorta like a sticker, that is something else. Doable, but a slightly different technique. If you want to have a longer conversation about it, feel free to ping me @GameDevBill on the Unity forums, or reply to this thread forum.unity.com/threads/gamedevbill-tutorial-comment-thread.945515/ (or ping me on Twitter)
@@GameDevBill Oooh fantastic! I'll check it out now :)
Very Nice Video. I have a Question How can I make it triggerble when I enter a space Bar
Great tutorial. Thanks a lot. Could you please explain the normalization of the uv map.
What if i have 10 balls ( 2d sprites ) in my scene, and i want a shock wave go through them ? , we can only apply this shader to 1 sprite , whats the solution , i hope you understand
Hi, nice tutorial. My shader works in game view but not in the scene view, is there a setting that I need to enable? I'm using Unity 2020 3.14, and I'm working on the default HDRP project with shader applied to a quad.
I found my solution, I need to enable always refresh on the scene view drop-down button.
Glad you got it working :)
Thank you for your awesome tutorial videos! :)
Could you please tell me - is it possible to use any variant of these shockwave shaders with an Experimental 2D Renderer?
-I was hoping for a full-screen version, but I could not configure it according to your other article, which describes the connection of the Blit script from Cyan - when using the "Experimental 2D Renderer", the data asset simply does not have the "Add Renderer Feature" function.
And although the list of features is visible in debug mode, there is no way to add a Blit "manually" ...
I apologize for the google translate.
Honestly I have not done any work with the experimental 2D renderer yet, so I'm not sure how to get a full screen shader set up there. I'll add it to my list to research, but being experimental, I'd expect it to be short on features, and probably often-changing.
@@GameDevBill Sad, very sad...
Well, maybe someday. I will hope... :)
Thank you! :)
@@GameDevBill I beg you. Please could you make a video about how to implement this (link below) to 2d game with URP. 6:36 ruclips.net/video/UsGuN69g2NI/видео.html
It works without URP but how to set up with it. I am so desperate
Thanks for the suggestion, I'll check it out
I will immediately apologize for my English, I use google translate. How do I spawn this shockwave in place of a player in a 2D game. I tried to take a player position through WorldToScreenPoint and its other forms, but the place of the wave spawn is somewhere in the corner of the screen all the time?
Great tutorial! Any hint on how to stack multiple ripples?
Ohhhh let's gooo thx a lot really! By the way I am the one that asked for this video...
Glad to do it, and thanks so much for the suggestion! It really helps to know what people are interested in 😀
@@GameDevBill thank you actually 😊
This is incredible, however, how does one make a fixed zone where an effect can happen on a sprite?
for ex. take a sprite tree with branches, leaves and all. say we added wind effect shader, what nodes would help to avoid the branches or barks and things that shouldn't move opposed to things that need to move? is there a better way to control zones?
Hi, this shock wave was exactly what I was looking for. Now I would really like a shader for laser beam, or something like Ghost Buster Proton Pack.
Ooh, good ideas, thanks 👻👻
Hello, thank you for the tutorial! and may I ask you some question please?
I wish I can switch on and off this effect using key press, how can I set full screen effect's properties through script?
I am trying to reference ForwardRendererData->RendererFeature->BlitMaterial on script but I cannot find the way to do this...
at last, thanks again and sorry for my bad english..
I've been working on a video to show how to do this for objects, but hadn't thought of testing it on full screen effects. If you can access the material, you can use things like SetFloat to set shader inputs (replace the Time node with an input). But, as I said, I hadn't thought about how exactly this would work for a full screen effect. I'll be sure to test that and include it in my next video.
This is the SetFloat thing I was talking about: docs.unity3d.com/ScriptReference/Material.SetFloat.html
@@GameDevBill Thanks for the explain! I will try another way to make it :)
FYI, my latest video covers how to do this, both from script or from Timeline...
ruclips.net/video/A5jl5RVEjqE/видео.html
For those looking for an answer: reference the Blit object that is part of the Renderer data, then access it through Blit.settings.blitMaterial
Does this work over transparent objects?
I made a similar effect from a different tutorial and it makes transparent things disappear when the effect is over them
You had me at the t shirt
:)
Do you think you could try doing something like DIO's time stop effect in part 3 of Jojo's Bizarre Adventure? Really cool tutorial, good job.
Thanks! As to Jojo, I've never actually watched that. If you have a clip of the effect you're talking about, I'd love to check into it
@@GameDevBill ruclips.net/video/DefXS17jZwE/видео.html&ab_channel=WorldClass here you are 0.12s :)
There's a lot of cool stuff going on in that clip! I'll ponder ways to make some of that happen. Thanks for the idea
This is almost EXACTLY what I was looking for. Any chance this is easy to make into a square shape?
Awesome video, but I have a question... how can I trigger the Shockwave for the whole screen in code? I don't want it to permanently run.
Depending on your renderer, there are ways to turn a full acreen shader on or off (see gamedevbill.com/full-screen-shaders-in-unity/ for info on setting this up in different renderers), but likely the easier solution is a shader parameter. This could either be a dedicated param to the shader, or just the already existing percentage input. That percentage input that does the animation now could be set to some value that doesn't distort the image, like -0.5, or maybe 1.5. You should be able to play with it to find some value that equates to "off"
awesome video
Bill, let me ask you something. I'm using HDRP. In your web, you write "Note that the shader has to be code based.(...)only code shaders will work." Does this mean this effect in impossible to achieve in HDRP? 😥
Sorry, I should have been more clear. In HDRP, any _full screen_ effect must be done with a code shader, not a shader graph. So if you are doing it on an object, HDRP or URP is the same. If you are doing it on the full screen, URP is as-shown, but for HDRP you'd need a code version. I cover all the different ways to set up full screen shaders here: gamedevbill.com/full-screen-shaders-in-unity/
I believe you can also use a shader graph to generate a code shader in HDRP, though I've only actually tested that in URP. I cover how to do that in URP here: ruclips.net/video/beSRCSRS6mI/видео.html (this video is about geometry shaders, but you can ignore most of the rest of the video)
@@GameDevBill Thank you very much for the detailed answer! I'll continue trying. So far, I managed to do this same effect in HDRP (or very similar) applying it to a circle sprite, child of the camera, that simply grows from the center 😊
But I'll try the full-screen way. Thank you very much. I love your videos.
I could not understand how you render this sprite without choosing MainTex, at 08:02 in the video sprite is rendering on scene with the shader effect but MainTex is empty in Inspection. Could you please help me to understand what is going on. When I choose MainText, it works fine as a material on plane but it is filling whole screen when I am using as screen effect.
Related point in the video: ruclips.net/video/dFDAwT5iozo/видео.html
Hey, I think I was the one who asked for this! 😁
Cool! Requests always appreciated 😄
Hey dude , that was what I have been waiting for a long time. But seems like something is missing ... I need a code example to trigger this effect . Enabling or disabling this effect from the code should be nice , but also triggering it for once would also be a real solution. For now I will try to add a start time to the shader and command the effect via the material,but something more reliable would be appriciated ...
I thought about covering that, but decided to pull it for time. There isn't a good way to "trigger" it from code, but you can "drive" it from code. The difference I'm referring to is "trigger" would mean your code just says "start" and the shader users its own Time from there. This is hard as you don't know if you'll trigger it mid-cycle. Driving it is a lot easier. The main option is to replace the use of Time with Vector1 input. I don't have a video on how to drive this from code yet, but I do have a related write up. A while ago I covered this for code driven shaders here (in the "custom inputs" section): gamedevbill.com/shader-series-3-shaders-in-unity/. The game code should be the same for a shader graph or a code shader.
The other option to drive inputs is to make the input a Color instead of a Vector1, then use something like DOTween pro to drive it. That's actually what I'm doing in the video because it lets me easily sync the knife flight and the animation. I plan to make a video on this trick soon.
@@GameDevBill Thanks for the answer. I added a parameter to the shader. Instead of using Time node, I am giving a vector1 parameter to the material. So that I can decide which part of the cycle will be processed by the shader. I am changing the parameter to simulate the progress. Seems like working for know . As long as I keep the parameter at 0 state , nothing happens, when I tween it from 0 to 1 , a cycle is processed smoothly. Which gave me full control on the effect on scripting side. I was crippled on URP full screen shader effect untill you made that blit video. Thanks dude . Brackeys gave up fighting with changes in unity , It is nice to have people keep on fighting with it.
Just wanted to let you know that your question inspired my latest video: ruclips.net/video/A5jl5RVEjqE/видео.html
It takes this shader, makes it more 3D, then shows how to drive it from code or Timeline.
Спустя целый день я нашёл то что искал ShockWave для первого лица спасибо тебе!
поц красавчик
since the shader is running continuously, how do you make it so that it only triggers the shockwave effect once?
Just substitute the time with controlled variable
So nice thanks
What render pipeline do you use? ):
I'm using URP. In this video, I'm on version 8, and just updated the description to talk a little about what is different in URP & Shader Graph version 10.x
@@GameDevBill Thanks, despite what they say about "It won't work!", I'm trying to see what happens when distortion is present on the quest Beat Saber walls.
I got the 2d one to work but am having trouble with the 3d one. Any help would be appreciated.
Does anybody have the completed 3d working?
I have followed the yt and the write up. There are things missing.
Thats what i am looking for. Thank you buddy. Allah bless you
I would love to know how you apply the shader on a 2d camera
I think 2d cameras in URP will still follow the same steps I outline here: ruclips.net/video/4apbNiPC3yQ/видео.html. AFAIK there's only one camera type in URP, and it becomes "2D" by setting it to Orthographic instead of Perspective. Assuming that's the case, it should just work with the above instructions.
really i will be wait every monday please can you explain how to make a Silhouette shader really you explaining shader so good
I've slowed down, but hope to start creating new videos again soon. A silhouette shader is a good suggestion!
Got to the 5min30 timestamp and from there, it doesn't work for me (unity 2020, urp)
thanks! . prograss made for PORTλL : lost in space! ( i mentioned it beacuse i saw you wearing half life merch ;) )
How i can start the effect by input?
Amazing tutorial. can you do a shader that, attached to a game object does on colliding objects the Thanos effect ? possibly on a 2d scenario
Good idea. It definitely can be done. I'll see if I could make something like that work!
@@GameDevBill thank you man. if you do that I will throw a 7 days party!
unfortunately this just makes my object jitter from side to side. not really sure why it's not rippling the vertex shader from the middle like the 2d ripple at the beginning. also, this doesn't seem to work on other objects i have in the scene.
how can i stop effect? don't want to play full screen
How did you manage to make it fullscreen? In hdrp
Hi, Hope you see this, I followed your tutorial until 7:50, after that I inverted the time, so it's a ring from outside to the center, but I wanted to the ring slowly faded near the center, so I added a Lerp after "One Minus" and "Multiply" with the A being the Wave effect and B Zero, but I'm having a problem with the T. Tried to link with all the Time Node and no one give me the effect that I wanted, tried to split the "Subtract" node and get the Alpha or RGB value, but didn't work either. Changing manually the X of Lerp I achieve the effect, but I can't find an automatic way to do that. I'm new in the Shader Graph, and I'm just playing around to learn, if you or someone else can help me, I'll be very grateful.
It's a bit hard to follow the changes exactly. If you reply to my forum thread here forum.unity.com/threads/gamedevbill-tutorial-comment-thread.945515/ and post a screenshot of your updated graph, I can take a look.
@@GameDevBill Posted 👍
How do o enable ths ripe effect on a keypress
Less helpful answer: I'm working on a video to cover exactly this right now. Likely out in a week or two.
Slightly more helpful: replace the Time node with an input. Once that is there, you would tween the input from 0 to 1 after a trigger. This could be done a number of ways, including from code. Again, more details coming in my next video
@@GameDevBill thanks
The promised video is out! (took longer than a week or two)...
ruclips.net/video/A5jl5RVEjqE/видео.html
at 6:02 when I go to scene , nothing happened , I have done exactly same as you , Does anyone Has the same problem or know the solution?
Likely this is due to a setting in the scene view. The absolute best way to verify the shader is working is to enter play mode (and make sure your camera sees the thing affected). If that works, then your shader works, and it's a matter of fixing the scene view to cooperate.
In 2019 and older the setting is called "animated materials" under the "Toggle..." menu at the top bar of the scene view. In 2020.2 or newer I believe it's "always refresh", though I'm not totally sure of that. I haven't spent much time in 2020.2 yet.
If nothing happens in play mode, then the shader isn't working, and we've got a different problem.
half life shirt
where can i buy it?
ha, unfortunately I made the shirt myself. So not available anywhere yet :)
My material is just white when I make that first shockwave test. What am I missing?
Its really hard to understand the math going on here 😥😥