Unity Shader Graph - Changing Parameters in Script

  Рет қаралды 52,036

Dapper Dino

Dapper Dino

Күн бұрын

Пікірлер: 85
@Blinkers2007GameDev
@Blinkers2007GameDev Жыл бұрын
This is the best video I have ever seen on changing shader graphs. The guy helped me making my paintball game 1000 times more than any drawing paint on surface tutorial ever did! Thank you for this!
@SayyidahHumairah
@SayyidahHumairah Жыл бұрын
Thank you so much for making this tutorial. I finally finished my project after getting stuck for days
@coolcucumber4239
@coolcucumber4239 3 жыл бұрын
OMG! I spent 2 hours trying to find out how to change the shader parameters, and you just showed me. Thank you so much!!
@josiahvarughese6432
@josiahvarughese6432 4 жыл бұрын
The tip about the parameter names was the end to a long period of banging my head against the wall, thank you 🙏 .
@brunogattai9262
@brunogattai9262 2 жыл бұрын
This video saved my life, thank you very much
@dayliss413
@dayliss413 6 жыл бұрын
Thanks for making this video! I've never used shaders before so I would have been lost on the issue you show at 6:29 for a LONG time.
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 6 жыл бұрын
It took me ages in the first place so I'm glad that I can help others not waste their time :D
@ryanfranks9441
@ryanfranks9441 6 жыл бұрын
You have some of the best tutorials on the internet. Is it possible to do a black hole warp style shader with shader graph?
@wholesomedokichannel8603
@wholesomedokichannel8603 4 жыл бұрын
So that was the trick... using these weird reference names !! Thanks man, saved my life !
@marekmichalovic8711
@marekmichalovic8711 5 жыл бұрын
Thank you, the part around 6:20 solved my problem! Great tutorial!
@darksecret6050
@darksecret6050 3 жыл бұрын
Same😕
@dafabulousdude8541
@dafabulousdude8541 4 жыл бұрын
You can change the reference name of the properties in the shader graph. For every property there’s a „Reference“ box where you can change the name.
@poperblx
@poperblx 6 жыл бұрын
ohmygod finally. i have been stuck in the same problem for days lol. thankyou! you earn a like and a subscribe
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 6 жыл бұрын
Thank you so much :)
@mbalrog6
@mbalrog6 5 жыл бұрын
I was watching you do the "This game Lies" Game Jam earlier. How funny I had to look for a way to access a shader parameter and the best info I found was your video. That is way cool. Good Job on the video. I did not know to look for such a crazy string name. I did exactly what you did. Your video was super, super, useful. I am creating a parallelax shader for LWR (Lit Sprite 2D Renderer) at least trying to.(This is mbalrog6)
@Miguel_Silva_
@Miguel_Silva_ 3 жыл бұрын
Instead of using SetFloat directly on the material, you can animate the slider in the material's instance in the object and trigger this animation by a Mecanim parameter. In this way, the changes will be individual for each object and not for all objects with the same material, in addition to all the control that the animation allows.
@thebiggestdick69
@thebiggestdick69 Жыл бұрын
or you can use gameObject.GetComponent().material.SetFloat("property", float value); It may be also SkinnedMeshRenderer or SpriteRenderer Note: properties names usually are the same as in the inspector but with "_" at the beginning
@Overdrink7
@Overdrink7 Жыл бұрын
Really usefull as I wanted to modify the shader but only for one instance ! ty
@Robot0451
@Robot0451 Жыл бұрын
@@thebiggestdick69 This helped me alot thanks
@PatrikBergsten
@PatrikBergsten 6 ай бұрын
@@thebiggestdick69Note that MeshRenderer.material returns a copy of the material and is internally tracked so this will create a memory leak on the c++ engine side. Calling Meshrenderer.material in Awake/Start will create the copy, manipulating the material as needed with MeshRenderer.sharedMaterial (sharedMaterial is now a reference to the copy in this MeshRenderer), and then in OnDestroy calling Destroy on the material and setting the reference to null or calling Resources.UnloadUnusedAssetsAll (can be somewhat expensive) will avoid the memory leak. The same is true for meshes, Texture2Ds, and some other UnityEngine.Objects that gets created at runtime.
@williamfhallett5052
@williamfhallett5052 5 жыл бұрын
Love this video. SO seldomly have I found exact answers to what I'm looking for in such brief order.
@jpmadulid1746
@jpmadulid1746 4 жыл бұрын
Thank you for this video. Solved my problem. Was trying to change the texture of the shader on my skybox material. The properties ID in the shader is all I needed. thanks.
@Th3M729
@Th3M729 3 ай бұрын
Thank you for sharing your knowledge and experience!!!
@flaviodg2323
@flaviodg2323 2 жыл бұрын
Just what I needed! Thanks 🙏
@spiral9316
@spiral9316 5 жыл бұрын
you are a geniouuus! thank you man! what i wanted how i wanted the correct way, super helpful.!! wow your channel its a gold mine!!
@PaulJonesy
@PaulJonesy Жыл бұрын
Nice video, very helpful.
@heybishop
@heybishop 3 жыл бұрын
Thank you kindly! Just what I needed.
@johni3080
@johni3080 3 жыл бұрын
thanks you so much, I really needed this!
@jamiljawhar4711
@jamiljawhar4711 3 жыл бұрын
Thanx man, you made the things lot easier.
@jiggliniggly654
@jiggliniggly654 5 жыл бұрын
I'm working with your same shader, and I need precisely your code XDDD Good Tutorial!
@brils4997
@brils4997 2 жыл бұрын
Thank you so much mate!
@CleisonRodriguesComposer
@CleisonRodriguesComposer 3 жыл бұрын
Thank you! You help me a lot.
@SlayerDUDE1993
@SlayerDUDE1993 4 жыл бұрын
Is it possible to access PBR master output shader properties from a script? For instance I want to be able to switch my shader from 1 sided to 2 sided.
@grmurr346
@grmurr346 2 жыл бұрын
Just a heads up, if you're using Unity 2020 you'll want to use the reference of the property
@ahmedmoubarik168
@ahmedmoubarik168 4 жыл бұрын
Thank you + Subscribed
@martinstatelov3969
@martinstatelov3969 3 жыл бұрын
Awesome tutorial, thank you!
@アラン-b4t
@アラン-b4t 5 жыл бұрын
Very Help for me , Thanks!
@lovelesstsukashi8786
@lovelesstsukashi8786 6 жыл бұрын
First of all, tyvm for the video, it was really helpful. I ran into an issue, which was the shadow. After dissolving, the shadow remains there. Is there any way to make it "dissolve" too, or any trick to make it not look so wrong?
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 6 жыл бұрын
I don't think you have access to shadow properties in shader graph so if you wanted to make the effect but with the shadow being effected too then I would recommend learning how to do it from scratch with shader code :D
@KillerGameDev
@KillerGameDev 3 жыл бұрын
This is cool! But Im curious, can you do material property blocks with a shader graph? Im newish to shaders in general so double-new to shader graphs, but I read that if I have two objects which need the same material but with only a color or texture change, to use material property blocks for performance reasons. I THINK I was seeing people say that just setting the color or float or what not instantiates a new material versus just loading the current material with a small change. However, I cant seem to apply this method to shader graphs. Could you point me in the right direction? Also, taking your online multiplayer networking course on udemy right now. Pretty cool! :D
@rouxboat9067
@rouxboat9067 4 жыл бұрын
the only problem i am having is that i have multiple objects with the same shader, and they all change at the same rate, not individually. (by clicking on each one it lowers a thickness value.)
@Miguel_Silva_
@Miguel_Silva_ 3 жыл бұрын
Instead of using SetFloat directly on the material, you can animate the slider in the material's instance in the object and trigger this animation by a Mecanim parameter. In this way, the changes will be individual for each object and not for all objects with the same material, in addition to all the control that the animation allows.
@danielyyi
@danielyyi 3 жыл бұрын
@@Miguel_Silva_ how do u animate a material?
@Letsgomagic
@Letsgomagic 4 жыл бұрын
This was great, I was wondering how to access shader properties in script 😁😁
@imaginemeng4375
@imaginemeng4375 5 жыл бұрын
Thanks for making this useful video!
@Moonriderr
@Moonriderr 3 жыл бұрын
Thank you
@ajaygamedeveloper6148
@ajaygamedeveloper6148 4 жыл бұрын
Hi! I have a shader which blurs UI and it uses "_Size" for amount of blur. I'm able to set "_Size" using setfloat to 0 for no blur and I can set it to 6 for completely blur it but I want "_Size" to lerp from 0 to 6 (slowly blur background). I tried math.lerp and lean tween but couldn't do it. Please help me. I want to lerp custom shader property
@watercat1248
@watercat1248 4 жыл бұрын
The questions ther is way to open the sheder graph in code Instead the note System?
@NaguWhiteout
@NaguWhiteout 5 жыл бұрын
Maybe it was like this half a year ago. Now you simply go to the property inspector in the shader graph editor and change the reference name for the property to a more useable name :-)
@mesenes77
@mesenes77 4 жыл бұрын
Thanks!
@StaryzHelios
@StaryzHelios 5 жыл бұрын
how to adjust the PARAMETER value that have X,Y,Z on material shader?
@magnusm4
@magnusm4 3 жыл бұрын
I can imagine your health idea and add perlin noise to it to get a cool fluid effect.
@magnusm4
@magnusm4 3 жыл бұрын
Despite shader graph being a thing. I still would love more to learn to code shaders myself. I prefer learning a skill than spoiled even though it's better. Plus my first experience was when it was new and it kept crashing. Changed something insignificant and the whole thing would permanently be purple, like running an old game from the early 2000s. It was highly unstable.
@tixitigame
@tixitigame 5 жыл бұрын
thank you so much. I 've just subcribed your channel.:))
@stay2373
@stay2373 Жыл бұрын
Thanks !!! I love it !!!
@ButterGames
@ButterGames 5 жыл бұрын
It Worked. Thanks!
@__dane__
@__dane__ 3 жыл бұрын
I know this is an older video but I’m shocked more people haven’t mentioned you can rename the shader property nameID in shader graph’s blackboard - it doesn’t need to be “Vector3_1d5f....”
@nicdepp
@nicdepp 5 жыл бұрын
I'm trying to make it so it's a smooth transition with each increment, any way you know of doing that?
@Tornado77
@Tornado77 4 жыл бұрын
Mathf.lerp
@milte_
@milte_ 6 жыл бұрын
The need for the "code" of the value u want to change is weird but whatever... Thanks :)
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 6 жыл бұрын
That's because when I made the video Shader graph just threw out random codes for the properties but as far as I know, they've made it so that you can choose the code for it inside shader graph now.
@milte_
@milte_ 6 жыл бұрын
@@DapperDinoCodingTutorials That would be nice! I will check it tomorrow :)
@wonkysouceaasdsad9664
@wonkysouceaasdsad9664 4 жыл бұрын
6:32 Nice!
@bronzeprasempre6478
@bronzeprasempre6478 3 жыл бұрын
U can acess reference by clicking on properties inside shadergraph.
@PhoenixGameplay100
@PhoenixGameplay100 6 жыл бұрын
Ty, really helpful
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 6 жыл бұрын
Glad I could help :)
@julianodbz
@julianodbz 5 жыл бұрын
Nice done !
@optus231
@optus231 4 жыл бұрын
So cool!
@TehBunnieh
@TehBunnieh 3 жыл бұрын
Thank you... so much... *deep bow*
@issamlaoumri7591
@issamlaoumri7591 4 жыл бұрын
Thank u for this tutorial BUT i have a question(HELP) ...at start when i change the fade, the shade work perfectly until i move the player with an input then things go wrong !! and i want to apply this when the player collide with an object, and i made a piece of code but the result is not the same ! private void Dissolve() { if (bodyCollider.IsTouchingLayers(LayerMask.GetMask("Interactables"))) { isDissolving = true; } if (isDissolving) { fade -= Time.deltaTime; if (fade
@datbui0
@datbui0 4 жыл бұрын
thank for your work ! XD
@luischairez5784
@luischairez5784 4 жыл бұрын
Thanks a lot!!!!!!!!!! :)
@araskuzucu3456
@araskuzucu3456 5 жыл бұрын
Thank you :)
@rodni3d674
@rodni3d674 5 жыл бұрын
And how to pass Cubemap to Shader via script?
@reganmusicnz
@reganmusicnz 6 жыл бұрын
any idea how to change a boolean?
@sconosciutosconosciuto2196
@sconosciutosconosciuto2196 5 жыл бұрын
Setbool I think
@Making_dragons
@Making_dragons 2 жыл бұрын
dude I just made a desolve shader and came here t know how to change the value of the desolve shader
@kevinordonez5072
@kevinordonez5072 4 жыл бұрын
@ramkillnani8293
@ramkillnani8293 4 жыл бұрын
How do i get the Dissolve Value to drop to 0 on its on with a smooth transition? I posted here if you could help :( answers.unity.com/questions/1753952/how-do-i-change-a-shader-graphs-property-float-ove.html#
@edk.2045
@edk.2045 4 жыл бұрын
Okay, I love Unity. I really do. But when they do stupid crap like calling it "Vector1_12easdnuendmylife", it really ticks me off.
@crown_5326
@crown_5326 4 жыл бұрын
6:41 this is painful to watch you could just copy and paste
@utkans
@utkans 4 жыл бұрын
You can't copy it from the inspector. Edit: I realized it is possible to copy it from the shader graph under properties.
@Grossvalur
@Grossvalur 5 жыл бұрын
Thank you
@beastmasterbg
@beastmasterbg 5 жыл бұрын
thank you
Unity Shader Graph Basics (Part 1 - Your First Shader)
7:40
Daniel Ilett
Рет қаралды 51 М.
НАШЛА ДЕНЬГИ🙀@VERONIKAborsch
00:38
МишАня
Рет қаралды 2,5 МЛН
How I Turned a Lolipop Into A New One 🤯🍭
00:19
Wian
Рет қаралды 10 МЛН
Flipping Robot vs Heavier And Heavier Objects
00:34
Mark Rober
Рет қаралды 58 МЛН
How To Control Shaders With Scripts - Shader Graph
12:44
Dapper Dino
Рет қаралды 19 М.
How To Write Fast Shaders
10:33
Jump Trajectory
Рет қаралды 20 М.
SNOW in Unity - SHADER GRAPH
17:13
Brackeys
Рет қаралды 201 М.
Writing Shaders In Unity - Basic Shader - Beginner Tutorial
25:39
Dissolve effect in Shader Graph
19:23
PabloMakes
Рет қаралды 31 М.
How to use object scale in shader graph - Unity tutorial
7:46
Sunny Valley Studio
Рет қаралды 18 М.
Get STARTED With Shadergraph in Unity
16:28
Sasquatch B Studios
Рет қаралды 13 М.
Unity Shader Graph: Crystals!
16:48
PolyToots
Рет қаралды 77 М.
НАШЛА ДЕНЬГИ🙀@VERONIKAborsch
00:38
МишАня
Рет қаралды 2,5 МЛН