How To Control Shaders With Scripts - Shader Graph

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

Dapper Dino

Dapper Dino

Күн бұрын

Пікірлер: 35
@JasonWelch
@JasonWelch 9 ай бұрын
Helped me accept the fact that if I really want multiple effects and such, I really need to just create single shaders / materials that include everything.
@CorneliusCornbread
@CorneliusCornbread 4 жыл бұрын
Correct me if I'm wrong, but I believe this won't provide the intended effect with multiple instances of this material in the scene. Quick tip for getting around this, get the original material and in code (not in the editor) create a new material by passing in the old material in the arguments. Set the new material on your mesh renderer. This will allow you to have the effect by specific to that game object.
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 4 жыл бұрын
I'm almost certain that it is separate when using renderer.material (There is renderer.sharedMaterial I think that allows you to change for all instances of the material in the scene but I have never used it)
@LukasMartin9422
@LukasMartin9422 4 жыл бұрын
@@DapperDinoCodingTutorials hey! if you use .material, you are doing a new material instance only to that object. Keeping in mind that, you are breaking Material Batching, causing FPS drops due to Unity not being able to batch as much as possible same materials. The proper way to do that, is using MaterialPropertyBlock, to pass the "modification" during drawtime and not breaking batching! Cheers
@hibiscustea7116
@hibiscustea7116 4 жыл бұрын
For that you'll better use GPU instancing, just like ​ Lucas Martin says.
@HadiLePanda
@HadiLePanda 4 жыл бұрын
Nice tutorial, love the content about systems & tricks like that ^^
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 4 жыл бұрын
Glad you enjoyed :)
@PRodi_
@PRodi_ 3 жыл бұрын
Great video! , but how can I make lerp/smooth transition from 0 to 1 on a single click???
@Crons-v3f
@Crons-v3f 3 жыл бұрын
Looks awesome, Great work! I just have a question, not really related to this video but since you're really good you could know the answer. I'm making some special effects for my characters, and I'm creating shaders for it. For example, I created a shader that would dissolve the player and another shader that would make the player almost invisible (cloaking effect). How can I apply these 2 shaders depending on what special effect I want to add? For example, the player is using the normal URP Lit shader and I want to dissolve the player, should I replace the shader by the dissolve one, or should I create 1 complex shader that does dissolve and invisibility?
@ravanin
@ravanin 4 жыл бұрын
could you make a follow up tutorial on controlling shaders from timeline?
@postymusic4387
@postymusic4387 2 жыл бұрын
Thank you I think this is exactly what I needed
@aghost6097
@aghost6097 4 жыл бұрын
love the video! How about a pixiJS game development tutorial? I've been trying out the basics and have been struggling
@igeanimation
@igeanimation 2 жыл бұрын
Umm. Man. When I do this (using URP), it turns pink, magically changing the shader to Hidden/InternalErrorShader. HELP PLZ!!!!
@igeanimation
@igeanimation 2 жыл бұрын
Also, nice vid.
@abgestaubt
@abgestaubt 4 жыл бұрын
Is there any major difference between an Action and an UnityAction?
@ravanin
@ravanin 4 жыл бұрын
you mean event and unity event?
@CorneliusCornbread
@CorneliusCornbread 4 жыл бұрын
@@ravanin It's referred to as both. The class name is Action and UnityAction but they're events. But yes there is, Actions require a function to be passed into it upon creation, whilst UnityActions have no such requirement. UnityActions also can be serialized in the editor. Actions can have arguments whilst UnityActions cannot. docs.unity3d.com/ScriptReference/Events.UnityAction.html
@Rizzmaster9001
@Rizzmaster9001 Жыл бұрын
Here 's the quick fix: ---------------------------------------- public Material myMaterial; private void Start() { float myFloatValue = myMaterial.GetFloat("_myProperty"); myFloatValue = 1f; } ------------------------------------------- "_myProperty" is the name of the custom shader property u want to change. !!! NOTE !!! that in the shader graph the property name and reference name are not the same thing. You need the reference name. This can be found by going on the graph inspector and clicking on your property node. took me waay too long to find ffs.
@a.technology1446
@a.technology1446 4 жыл бұрын
Nice tutorial thx, can you guide me for beginners tutorials about Shaders, this look advanced to me
@Treetopper911
@Treetopper911 3 жыл бұрын
Very useful video! Thank you!
@gamingglyphss
@gamingglyphss 4 жыл бұрын
photon chat tutorial please 🙏
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 4 жыл бұрын
I'm not really using Photon anymore. Mirror is better in pretty much every way and I actually do have a chat tutorial for Mirror :)
@TheCallumFerguson
@TheCallumFerguson 4 жыл бұрын
Is there a good way to do p2p with Mirror? I've seen noble connect, but is this the only option?
@toritogames
@toritogames 3 жыл бұрын
What you are looking for is at minute 9:30
@Tenenx69
@Tenenx69 2 жыл бұрын
Ty
@ValeGoG
@ValeGoG 2 жыл бұрын
10/10
@breead2617
@breead2617 4 жыл бұрын
Slick
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 4 жыл бұрын
:)
@Havii
@Havii 4 жыл бұрын
'Colour' 🤣
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 4 жыл бұрын
My Britishness :P
@Havii
@Havii 4 жыл бұрын
@@DapperDinoCodingTutorials I love it! Great videos by the way, been watching all of them. Talented guy you are
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 4 жыл бұрын
Thanks :) Glad you're enjoying the content
@DiamondhandsForever
@DiamondhandsForever Жыл бұрын
why did you load this down with so much extra functionality? you made it so complex for no reason. all i want to know is how to change the material's variable. that's it.
@DailyFootballEditsDFE
@DailyFootballEditsDFE 4 жыл бұрын
nice
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 4 жыл бұрын
nicee
Unity Shader Graph Basics (Part 5 - Vertex Shaders)
7:26
Daniel Ilett
Рет қаралды 17 М.
Мама у нас строгая
00:20
VAVAN
Рет қаралды 12 МЛН
Муж внезапно вернулся домой @Oscar_elteacher
00:43
История одного вокалиста
Рет қаралды 7 МЛН
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 7 МЛН
Why Solo Developers Should Use Unreal
9:51
Thomas Brush
Рет қаралды 435 М.
«Осень». Самая большая загадка Windows XP
14:36
Девять десятых
Рет қаралды 1,4 МЛН
Smoothstep - Shader Graph Basics - Episode 15
17:57
Ben Cloward
Рет қаралды 26 М.
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 35 МЛН
10 Shaders in 10 Minutes - Unity Shader Graph
9:38
Daniel Ilett
Рет қаралды 107 М.
Building code-free shaders in Unity with Shader Graph
30:02
AdamCYounis
Рет қаралды 75 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,2 МЛН
I Switched to Bone Animations (here's how it went)
5:56
supertommy
Рет қаралды 98 М.
DISSOLVE using Unity Shader Graph
10:33
Brackeys
Рет қаралды 679 М.
Мама у нас строгая
00:20
VAVAN
Рет қаралды 12 МЛН