Unity Volumetric Light Shader Graph LWRP

  Рет қаралды 65,865

MrTriPie

MrTriPie

Күн бұрын

In this Unity tutorial we'll make a shader to create fake volumetric lights/light shafts/god rays using the light weight render pipeline's shader graph.
Downloads: drive.google.com/open?id=1Lpp...
Twitter: / mrtripie

Пікірлер: 116
@lando6583
@lando6583 2 жыл бұрын
followed this tutorial a year ago, and today I found a completely different use for this shader! Thank you so much again for this.
@T0xIcNigHtMarE
@T0xIcNigHtMarE 4 жыл бұрын
100% worth the watch. very well put together n i'm glad somebodies making shader graph tutorials, there's too many possibilities with it for there not too be more videos out there. loved the tutorial.
@haxpor
@haxpor 4 жыл бұрын
Wow! Discovered so many nodes in this single videos. As well good technique to make use from foundations, and no need to look for specific feature provided by Unity! Thanks!
@adailsoncarlos3122
@adailsoncarlos3122 5 жыл бұрын
Man, your channel is awesome! Im learning so much, thank you! keep the videos!
@boggledeggnoggler5472
@boggledeggnoggler5472 4 жыл бұрын
You are a badass. Thank you so much for this. I've been using HDRP in my VR project and recently decided I should switch to URP. But I didn't want to have ditch my beautiful volumetric light in my level. Now I don't have to!
@pacusz7771
@pacusz7771 2 жыл бұрын
Cool, this is a great resource to learn! Keep up the good work.
@lando6583
@lando6583 3 жыл бұрын
excellent tutorial. very concise and well thought out!
@AtmosMr
@AtmosMr 2 жыл бұрын
Wow. Great stuff. New to volumetric shaders but great to see you work though it. I'll check out your channel.
@gameexplorer4963
@gameexplorer4963 5 жыл бұрын
Simple and nice. Keep up the great work!
@danialzamary7044
@danialzamary7044 4 жыл бұрын
That was great! I kinda had this problem making fog in lwrp with the camera set on forward, this really helped.
@MrTriPie
@MrTriPie 4 жыл бұрын
Thanks! Glad it helped
@Bannock88
@Bannock88 5 жыл бұрын
Very informative, and I enjoyed the dry humor. Thanks for sharing!
@MrTriPie
@MrTriPie 5 жыл бұрын
Thank you!
@zhaoxuefei3829
@zhaoxuefei3829 3 жыл бұрын
very creative man, I love it so much
@drewmileham202
@drewmileham202 5 жыл бұрын
Really awesome that you left download files :) Thanks for this tutorial!
@MrTriPie
@MrTriPie 5 жыл бұрын
You're welcome, glad you liked it!
@joshpolman201
@joshpolman201 5 жыл бұрын
Thanks man, great tutorial.
@TheExoticCerdos
@TheExoticCerdos 4 жыл бұрын
Very nice! Well done!
@CaptainCling
@CaptainCling 2 жыл бұрын
Great video. I cannot wait to try it out.
@werti4894
@werti4894 5 жыл бұрын
great tutorial!
@sean8306
@sean8306 3 жыл бұрын
Great tut, worked like a charm thank you. My scene camera didnt have Depth Texture switched on so didnt show in game at first, thought I'd mention it in case anyone else has that issue.
@stor314
@stor314 3 жыл бұрын
thank youuu!!!!!!!
@wywarren
@wywarren 3 жыл бұрын
On 2021.1.16f1 After switching on depth texture for URP it disappears for the game window. Scene is still rendering fine. This is on a MacBook Pro 16. At first I thought it was because I was targeting WebGL but after switching to Standalone it still happens. Not sure if it’s not supported on certain hardware or not.
@Auraregent
@Auraregent 5 жыл бұрын
Great tutorial thank you !
@VinsentVH
@VinsentVH 5 жыл бұрын
That's so good, subscribed :) Thanks alot!
@MrTriPie
@MrTriPie 5 жыл бұрын
Thanks :)
@PascalAchermann
@PascalAchermann 5 жыл бұрын
Thank you very much for sharing! Would love to see more LWRP and shader Tutorials :)
@MrTriPie
@MrTriPie 5 жыл бұрын
Thank you! I'm not sure there will be much more on Unity. I was thinking about switching back to it from unreal since they're adding the new render pipelines and I find C# to be quicker to work with than blueprint/c++, but I just don't feel as comfortable about using it on a longer project as I do unreal.
@PascalAchermann
@PascalAchermann 5 жыл бұрын
@@MrTriPie alright, well it's always a big step to switch the tool. i anyway follow you and i see if something turns up :)
@StratoChigo
@StratoChigo 4 жыл бұрын
10/10 tutorial, thanks
@hneo13
@hneo13 2 ай бұрын
Amazing tutorial, thanks for sharing
@aidennymes6335
@aidennymes6335 Жыл бұрын
exactly what i was looking for ! thanks a lot
@balasubramanimudaliar1336
@balasubramanimudaliar1336 2 жыл бұрын
Thanks for great explanation.
@hitman17011986
@hitman17011986 3 жыл бұрын
This was awesome
@mszczesnik
@mszczesnik 5 жыл бұрын
Very nice tutorial.
@MrTriPie
@MrTriPie 5 жыл бұрын
Thank you!
@lukdev
@lukdev 2 ай бұрын
dude, what gem this tutorial. TNKSSSS!!!
@ksam2000
@ksam2000 4 жыл бұрын
nice execution
@MrTriPie
@MrTriPie 4 жыл бұрын
Thanks!
@EpicGamer63637
@EpicGamer63637 Жыл бұрын
Simple and excellent :)
@jackwolf7479
@jackwolf7479 4 жыл бұрын
very helpful THANK YOU!!
@MrTriPie
@MrTriPie 4 жыл бұрын
Glad it helped!
@wen-hanku1776
@wen-hanku1776 5 жыл бұрын
very helpful!! thanks!
@MrTriPie
@MrTriPie 5 жыл бұрын
Thank you!
@hrishikeshkumar2264
@hrishikeshkumar2264 5 жыл бұрын
great video thanks
@MrTriPie
@MrTriPie 5 жыл бұрын
Thank you!
@ajef6119
@ajef6119 4 жыл бұрын
hey, I'm using your graph in a project, an while it works great in most cases, when there is objects with a material set to transparent that are being rendered inside or in the frame of the cone of light they look really weird. Is there a way to fix this ?
@watergames8449
@watergames8449 4 ай бұрын
protect this man at all costs.
@oliverweiss7175
@oliverweiss7175 5 жыл бұрын
Thank you for sharing! It helps a lot. I am having difficulties to understand the logic behind the Scene Depth, Camera Far Plane and Screen Position calculation. Can you explain a little bit further what is happening here? Thank you!
@farianderson168
@farianderson168 3 жыл бұрын
is there any trick to make this cast volumetric shadows? :D for example when an object crosses under the light we shouldn't see any volumetric lights after it.
@vieirapereira1298
@vieirapereira1298 2 жыл бұрын
awesome!!
@NikhilJolly
@NikhilJolly 4 жыл бұрын
Amazing tutorial! Would have really loved an explanation on the nodes you used. Btw, I am facing a problem where if I use an "Unlit - Transparent" type shader behind this lovely volumetric light, it doesn't render over it (the overlapping part clips entirely). Any idea why?
@MrTriPie
@MrTriPie 4 жыл бұрын
Its likely an issue with sorting the order to render the objects (multiple transparent objects tend to have this issue). I'm not really sure if there is a great solution for this, one thing that might improved be to force it to always render it on top (maybe by putting it in a different layer and setting up the cameras to render that layer on top (I think you need 2 cameras, 1 rendering all other layers, and the other only your volumetric one). But that isn't a perfect solution. Avoiding transparent objects when possible helps.
@soma78
@soma78 2 жыл бұрын
excellent ! thank you
@zig8925
@zig8925 3 жыл бұрын
You could also fix the low poly look, by choosing "Shade smooth" in blender, before exporting the mesh
@arsizhifenerprozhod
@arsizhifenerprozhod 2 жыл бұрын
I exported the smoothed mesh, still having hard edges, maybe the smothness is ignored when rendering transparent emission?
@zig8925
@zig8925 2 жыл бұрын
@@arsizhifenerprozhod You might have forgotten to auto smooth, which makes every angle below a certain threshhold smooth. It's also worth noting that when you shade something smooth, the otuline of the object will not change, only the way thil filling looks if you think of it as 2d
@GameShorts484
@GameShorts484 2 жыл бұрын
thank you so much
@gabdar22
@gabdar22 5 жыл бұрын
This is a great tutorial, though I think for future ones I'd love to hear explanations as to why you're using what node. I'm trying to figure out how to reverse the fade and can't for the life of me figure out how, and I think understanding what each node is for would be super useful
@MrTriPie
@MrTriPie 5 жыл бұрын
Thank you! I'll try to explain things better next time. For reversing things, doing a 1 - whatever you're trying to reverse usually does the trick (for example, white is 1, so 1-1=0 black, and vice versa)
@gabdar22
@gabdar22 5 жыл бұрын
@@MrTriPie Thanks for the reply!
@caio3726
@caio3726 4 жыл бұрын
Can you recreate this in the Amplify Shader? I've tried following a long about 5 times, but it never looks like yours.
@DimensionX985
@DimensionX985 2 жыл бұрын
Thanks . I benefited a lot from you. Keep it up ❤️🤍💙
@talismanskulls2857
@talismanskulls2857 2 жыл бұрын
Or a simple way is turn the material shader setting to mobile/particles/additive. Then all you do is create the texture in something like Photoshop and create a variety of color tones as gradient and then set them as sprites. That way the mesh ceases to receive shadows.
@bugge1947
@bugge1947 2 жыл бұрын
I've got a problem where the Fresnel effect fades from the view height and up instead of the edges? I've even downloaded your shader and I've still got the same problem.
@vincentdemers6066
@vincentdemers6066 2 жыл бұрын
Following this and for some reason when the material is over the sky depending on the angle its white only in the area that overlays the sky. If its over another mesh its fine.
@mohamedhamdy6722
@mohamedhamdy6722 5 жыл бұрын
good work . but the question is . why we modeling the cone in blender if were model it in Maya (pro builder)?
@MrTriPie
@MrTriPie 5 жыл бұрын
Thank you! Simply, it's the modeling program I'm most used to, and I have blender videos on my channel already. It's as simple as models get, so it should be easy to convert to your favorite program, and if someone isn't already used to any modeling program, it's free.
@Lupain
@Lupain 3 жыл бұрын
Holy shit I never really worked on shaders before, this seems so be so complicated and confusing for me>_> Your tutorial is nonetheless very great and it helps me alot, thank you!
@DiegoMaisy
@DiegoMaisy Жыл бұрын
People who domain nodes are ET. Good tutorial!
@KillerGameDev
@KillerGameDev 3 жыл бұрын
Ive went through this tutotial so many times...I can seem to get past the part where we need to blur the edges. I get some weird functionality at that point. When your mesh is white, mine is black. Tweaking the opacity ofcourse only makes it transparent. I figured maybe it was a setting, but when I get to 8:30 in the video, my light is just invisible regardless of my settings. I tried following the same steps in amplify shader and im getting the same result. Am I missing something?? im using 2019.4.17f1 and urp
@freetimedevelopment
@freetimedevelopment Күн бұрын
Same to me, I currently try to figure out what happens...
@chalogonzalez4468
@chalogonzalez4468 4 жыл бұрын
Will this work on a sphere? I need this shader for torches.
@MrTriPie
@MrTriPie 4 жыл бұрын
If you removed the gradient going from top to bottom it should. Although it sounds like something might have changed since there's comments saying they had trouble getting it to work in newer versions
@easygamestudio2826
@easygamestudio2826 3 жыл бұрын
Will game objects illuminated by this light generate shadows?
@MrTriPie
@MrTriPie 3 жыл бұрын
Assuming you have a spot light in the same position, regular cast shadows, yes. But unlike more complex volumetric effects, there won't be a volumetric shadow (the light you can see in the air won't be blocked). So this effect should be placed carefully to make sure that kind of issue isn't too noticable.
@BitwiseMobile
@BitwiseMobile 8 ай бұрын
I need a mesh like this for a frustrum collider I'm using on security cameras in my scene.
@danlee7923
@danlee7923 4 жыл бұрын
My unity doesn't have unlit graph, where can I find it? I have 2018.4.19 LTS
@MrTriPie
@MrTriPie 4 жыл бұрын
Do you have universal render pipeline installed (used to be LWRP)? docs.unity3d.com/Packages/com.unity.render-pipelines.universal@7.1/manual/InstallURPIntoAProject.html#installing-urp
@danlee7923
@danlee7923 4 жыл бұрын
@@MrTriPie it says, URP only works in 2019. My package manager doesn't have it. I don't want to upgrade to 2019 because the camera panning is terrible, I mean 100 mile pan terrible. This is the reason I am currently using 2018, but my current project doesn't have a rendering pipeline and I can't find one.
@MrTriPie
@MrTriPie 4 жыл бұрын
I think you could probably find the old beta versions of the LWRP, but it may have some issues. If you want to stick to 2018 and the standard pipeline I don't know very much about writing shaders in text code. One option might be to get Amplify Shader Editor add-on as it has support for the standard pipeline, luckily it's on sale now: assetstore.unity.com/packages/tools/visual-scripting/amplify-shader-editor-68570
@AU-cs6er
@AU-cs6er 4 жыл бұрын
Have you tried using this approach using universal render pipeline? I followed your instructions, but unfortunately, it's not rendering the shader at all. I'm developing a VR scene using 2019.3.0b6.
@MrTriPie
@MrTriPie 4 жыл бұрын
I haven't tried it. I've been using Unreal for a while now, when Unity had the LWRP taken out of preview I tried it a bit to see if I wanted to switch and made this video. My opinion of it at the time was that it should have been in preview still, I had multiple times in the course of a few days playing with it where the shader editor wasn't working properly (I think one of the problems was it sometimes wouldn't open certain shaders until I restarted Unity). There were also things that didnt seem to work the way I expected it too and I couldn't figure out, not sure if they weren't working correctly or I just couldn't find any documentation that would explain them to me yet. Anyway, between those problems, changes that users would want, and maybe changes that had to do with the HDRP, I wouldn't be surprised if the URP has changed a lot and broken some stuff. If you figure out what parts seem to break the shader, maybe we could figure out how to fix it.
@sixdegreesofcrispybacon
@sixdegreesofcrispybacon 4 жыл бұрын
I managed to get some results here under URP today (Unity 2019.3) by setting AlphaClipThreshold in the Unlit Master node to zero. Also, had to go check in the Inspector for Project > Settings > Universal RP - High Quality that Depth Texture was set (it wasn't)
@petermartin9394
@petermartin9394 4 жыл бұрын
@@sixdegreesofcrispybacon Thanks, fixed my problem.
@sixdegreesofcrispybacon
@sixdegreesofcrispybacon 4 жыл бұрын
@@petermartin9394 I'm glad I decided to post then. Nice one. (Y) Now, make sure you show us what you get up to, eh? ;-)
@haxpor
@haxpor 4 жыл бұрын
@@sixdegreesofcrispybacon Thanks six! By the way, new user like me or others might be confused as it is at Inspect panel window after locating and clicking on the project's UniversalRenderPipelineAsset file, click on it then toggle on Generate->Depth Texture. Thanks btw.
@dansv9778
@dansv9778 4 жыл бұрын
It shows purple on my URP project
@sureztv5836
@sureztv5836 2 жыл бұрын
Can you replicate this sin Amplify Shader Editor
@flyingroads3498
@flyingroads3498 2 жыл бұрын
Hello please do this titorial for new unity. It is diferent here. 2.8
@levasfilm
@levasfilm 4 жыл бұрын
How come I See nothing when I run Unity...Do I need more Light in the Scene ??
@MrTriPie
@MrTriPie 4 жыл бұрын
Maybe. One guy was saying this doesn't seem to work in the newest version, so if he did it right, that may be it
@rave9665
@rave9665 4 жыл бұрын
I may have a solution, my problem was I could see it fine in the scene view, but not in play/build. Hope this helps: Looking at the nodes FresnelEffect>Clamp>Lerp, the Lerp(output) goes into a multiply node on input B. the output of this multiply goes into another multiply node, also on Input B. Again, the output goes into another multiply node on Input B. The full path im looking at goes FresnelEffect>Clamp>Lerp>Multi>Multi>Multi I took the Lerp output, skipped the first 2 multiply nodes, and put it straight into the 3rd multiply node's input B. That's it (Save asset) I don't know exactly how scene depth works, but I reckon this was the problem in my use of the shader. This was left out by skipping the first multiply. I also skipped the second multiply becuase my camera would never reach the shader to clip it, if you still wanted this effect then only skip the first multiply. My version of Unity is 2019.2.17f1
@NexusCool1
@NexusCool1 4 жыл бұрын
would this work with hdrp
@MrTriPie
@MrTriPie 4 жыл бұрын
Probably, but I believe HDRP would support volumetric lighting/fog, which should give better results
@hereticstanlyhalo6916
@hereticstanlyhalo6916 3 жыл бұрын
Wouldn't the effect break if a player walks through it because it's a mesh? Edit*: Lol, just realized he made it disapear as you get closer, but still, wouldn't that break the illusion of being volumetric if it just fades away?
@MrTriPie
@MrTriPie 3 жыл бұрын
I don't think the player is likely to be paying enough attention to it to notice, and lots of games have things such as fake volumeric Godrays, fog clouds and other particles fade out when approaching them so they don't clip with the camera. Some games even have more solid things do it to get out of the way the camera, such as the Witcher 3 fading out trees and bushes. So the player is likely to be used to the effct too. In the end it's better than nothing when you can't use a full volumeric effect, and you can always tweak instances to make sure they aren't bothering players.
@FelipeGomesRocket
@FelipeGomesRocket 4 жыл бұрын
The part with the texture, instead put a texture itself, why not make it procedural?
@MrTriPie
@MrTriPie 4 жыл бұрын
In Unreal engine the procedure noise is usually more performance expensive than using a texture, I'm assuming it's the same case in Unity, but it might not be.
@earlygamer3590
@earlygamer3590 5 жыл бұрын
The question is how does this perform in mobile devices?
@MrTriPie
@MrTriPie 5 жыл бұрын
Not sure, I would assume that higher end devices would do fine with it, but lower end ones might struggle with it, perhaps they could run a simplified version of it?
@muhammadikram8009
@muhammadikram8009 5 жыл бұрын
can we use this in mobile devices?
@MrTriPie
@MrTriPie 5 жыл бұрын
I believe you should be able to,
@muhammadikram8009
@muhammadikram8009 5 жыл бұрын
I will try then tell you. By the way forgot to tell you that this was a great tutorial
@ginner9635
@ginner9635 3 жыл бұрын
@@MrTriPie yes you can:) its been two years already since the video released, but i hope you will see this and help me if you can! I'm stuck on trying to "cut off" the mesh of volumetric light, that intersects with other mesh. I am using a dynamic light source (flashlight) and when i point it at some objects, it obviously goes through them and player can see that other part of the lightbeam. Is it possible to fade it after intersection?
@MrTriPie
@MrTriPie 3 жыл бұрын
@@ginner9635 I can't believe its already been 2 years. I don't think there would be any way to do this only using shaders, you could try doing something like this: Create a LOW resolution texture for the light cone, and every frame or two do several raycasts from the start of the cone to the ends along the sides to regenerate the texture. It may be a bit expensive on mobile, so you'd have to tweak it a bit. I'm also not sure if it would end up looking strange in a different way as its not a true volumetric, but this is only way I can think of to attempt this.
@ginner9635
@ginner9635 3 жыл бұрын
@@MrTriPie wow man, i didn't even hope you'll answer! Thank you very much! yeah, you're right - it is too expensive on mobiles:-/ I thought maybe there was a way to do it through the shader graph:(
@KENISEG
@KENISEG 2 жыл бұрын
its URP or what?
@MrTriPie
@MrTriPie 2 жыл бұрын
The Universal Render Pipeline used to be called the Lightweight Render Pipeline, so hopefully this video is still compatible
@Lukas_CG
@Lukas_CG 4 жыл бұрын
Based on your accent, I think you're from Ohio
@MrTriPie
@MrTriPie 4 жыл бұрын
Haha, nope!
@Lukas_CG
@Lukas_CG 4 жыл бұрын
MrTriPie dammit!
@bumate90
@bumate90 4 жыл бұрын
Damn, it is really not that simple.
@jamqdlaty
@jamqdlaty 4 жыл бұрын
Why doesn't it have "fake" in the title?
A new way to generate worlds (stitched WFC)
10:51
Watt Designs
Рет қаралды 521 М.
Flow Map tutorial with Unity Shader Graph
28:52
PolyToots
Рет қаралды 52 М.
Я не голоден
01:00
К-Media
Рет қаралды 9 МЛН
小蚂蚁被感动了!火影忍者 #佐助 #家庭
00:54
火影忍者一家
Рет қаралды 43 МЛН
World’s Largest Jello Pool
01:00
Mark Rober
Рет қаралды 113 МЛН
Making a pawn that can actually turn into a queen | Blender 4.0
12:43
Fake Godrays to save render time :)
2:57
Kammerbild
Рет қаралды 32 М.
DISSOLVE using Unity Shader Graph
10:33
Brackeys
Рет қаралды 670 М.
When Your Game Is Bad But Your Optimisation Is Genius
8:52
Vercidium
Рет қаралды 1,4 МЛН
Stop, Intel’s Already Dead! - AMD Ryzen 9600X & 9700X Review
13:47
Linus Tech Tips
Рет қаралды 1,1 МЛН
An introduction to Shader Art Coding
22:40
kishimisu
Рет қаралды 952 М.
The Clever Way to Count Tanks - Numberphile
16:45
Numberphile
Рет қаралды 792 М.
10 Minutes vs. 10 Years of Animation
19:29
Isto Inc.
Рет қаралды 785 М.
Unlocking The Power Of Unity's Scriptable Render Pipeline
21:05
Game Dev Guide
Рет қаралды 200 М.
Я не голоден
01:00
К-Media
Рет қаралды 9 МЛН