Using Custom HLSL Code - Advanced Materials - Episode 24

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ธ.ค. 2024

ความคิดเห็น • 110

  • @shakaama
    @shakaama ปีที่แล้ว +1

    Mr. Cloward there is not praise I could give you enough, to convey my sincerest gratitude and astonishment I have for you.

  • @Slapdash86
    @Slapdash86 ปีที่แล้ว +10

    Ben. I think I love you.
    Seriously every time I watch one of your videos (which is pretty much daily) I'm struck with gratitude that you produce them. You're a modern day hero dude.

  • @cosmo8977
    @cosmo8977 ปีที่แล้ว +51

    More HLSL tutorials please!

  • @TechArtAlex
    @TechArtAlex ปีที่แล้ว +30

    One potentially significant note is that custom nodes (in unreal at least) do not benefit from the material compilers built in optimizations, such as constant folding.
    Because of this, anything that can be done outside of the custom node should be in almost every case. For things that do require it, like loops, it is best practice to process as much of the material in nodes first before passing values as inputs, and pass it back as an output as early as possible.

  • @Hashmojis
    @Hashmojis ปีที่แล้ว +3

    I love that you include BOTH the Unreal engine and the Unity engine in your videos, It scares alot of people away due to the video length but personally I really appreciate it, seeing as I've been using Unity for years now and been wanting to get more and more into Unreal Engine! Much love, man! 💚

  • @LuxAlibi
    @LuxAlibi ปีที่แล้ว +4

    Hi Ben, we haven't seen new videos for a while: I hope everything is fine for you!
    I wish you the best.
    Ciao

    • @BenCloward
      @BenCloward  ปีที่แล้ว +9

      Thank you! I had to take the summer off from making videos because I have several big family events that are taking up my video making time. It's currently looking like things may be back to normal in another two months or so and then I'll start making new content again. Really appreciate your concern!

    • @hal451
      @hal451 ปีที่แล้ว +1

      @@BenCloward I'm so glad you will be back!! But I also am happy you can take the summer off!! Have a great time with your family and look forward to your return.

  • @Kafkin123
    @Kafkin123 ปีที่แล้ว +15

    I used the custom node function, along with external shader files, to build the shader and materials pipeline for Callisto Protocol. It would have been incredibly messy and hard to debug with standard visual graph nodes.

    • @BenCloward
      @BenCloward  ปีที่แล้ว +4

      Congrats on the amazing product. I went to Jorge's talk at GDC. I was BLOWN AWAY by the realism in the characters. I have NEVER seen an A/B comparison between a real photo of an actor and the in-game model that matched so perfectly. I bet it was amazing to work on that.

    • @Kafkin123
      @Kafkin123 ปีที่แล้ว +4

      Jorge, Glauco and Martin spent a long time getting the look of the characters to match. It was a great experience working with Jorge in the beginning, and I learnt a lot on how to approach things more analytically.

  • @doloremmaximus
    @doloremmaximus ปีที่แล้ว +1

    Your tutorials are well thought out, easy to follow and very informative. Thank you very much for sharing your knowledge!!

  • @wortnes
    @wortnes ปีที่แล้ว +3

    Ben! Missing your weekly videos, hope its all well with you! Cheers!

    • @BenCloward
      @BenCloward  ปีที่แล้ว +4

      Thanks! Planning to start posting new videos in the next few weeks. I moved across the country and we’re getting settled into our new house, but I don’t have internet hooked up yet, so that’s a bit of a limiting factor.

    • @DerBeinmann
      @DerBeinmann ปีที่แล้ว +1

      ​​@@BenClowardcool. all the best 😊🏡

  • @bunnybreaker
    @bunnybreaker ปีที่แล้ว +1

    Another great video 👍🏽
    I was just looking at how to do loops today in Amplify Shader Editor, but also need to know the shader graph way for something else. Cheers!

  • @lasereyes5720
    @lasereyes5720 ปีที่แล้ว +1

    That was a lovely was to introduce people into HLSL and to customs (i personally re-did the Unreal part).
    As you requested suggestions for cool things to do in customs :
    Either something new from scratch like a B/W Checker, with numbers of row/column as inputs
    Either an iteration on an existing node (you'd have to find one both present in UE and Unity) where we would 're-do' an already existing node trough code then add something extra (idealy usefull) to it.

  • @dmytrozinchenko3810
    @dmytrozinchenko3810 ปีที่แล้ว

    Awesome ! Thanks
    Some ideas for the next videos:
    1) Texture sharpening node to improve Base color or normal map visual quality.
    2) Custom post process blum.
    3) Post process outline.
    4) Chromatic aberration effect with translucent material like glass.
    5) Triplanar projection with 1 texture sample and dithered temporal AA blending.

  • @gorantrpkov446
    @gorantrpkov446 ปีที่แล้ว

    Great video Ben! I was looking exactly for something like this! I come from a Houdini background and I'm usually spoiled with nodes for everything and anything, so when I came to Unity, I was not expecting it to lack with simple things like texture blur or image levels and gamma, exposure settings. Would have been cool if the default would includes nodes for simple color corrections and adjustments. Would be cool to see a setup that would emulate photoshop style exposure, gamma and levels controls for unity. I'm sure there's a way to do this with daisy chaining a bunch of math nodes in the shader graph, but it's probably much easier to do it with HLSL code as you mention in the video. Thanks again for this. By the way, your Ice refraction videos helped me build a great eye shader with refraction and fake depth for the iris. One thing I find troublesome is to separate the normals from the cornea and the iris and make these interact with different specular layers. I tried a Coat component with coat normal to the stack lit shader, but the coat doesn't seem to want to cooperate and show up

  • @Bestvegeta
    @Bestvegeta ปีที่แล้ว +1

    Great video, thank you.
    One thing i'd like to know would be:
    How would you go about getting the scene luminance and track sprite textures(flares) on the bright spots?
    More clearly, how could i create a higher quality lens flare effect than the build in one?
    Thanks in advance.

  • @tatwiwny
    @tatwiwny ปีที่แล้ว

    Valeu!

    • @BenCloward
      @BenCloward  ปีที่แล้ว

      That's very kind! Thank you!

  • @Arkideit
    @Arkideit ปีที่แล้ว

    Hey Ben! Thank you so much for your tutorials! I wonder is there a video on your channel about how to pick a random point from texture coordinates? I watched a lot but maybe I missed thank you!

  • @Andrew-Wardle
    @Andrew-Wardle ปีที่แล้ว +1

    Great video as always, thank you so much!

  • @AdelaideBen1
    @AdelaideBen1 ปีที่แล้ว +1

    Hi Ben - hope all is well. Don't take this the wrong way - but I hope the lack of content is a choice, not a necessity. I think I speak for all that we appreciate every drop you do, but more importantly, you're well (and all those life things that tend to put things into perspective).

    • @BenCloward
      @BenCloward  ปีที่แล้ว +7

      Hey, thanks for your interest! I had a daughter getting married, a son going to Peru to be a missionary, and now we're moving across the country this week - all happening this summer. So - needless to say - I didn't have the normal time each Saturday to make new videos. Once we get settled into our new place and unpacked, I'll be able to start making videos again. It's been rough because I've had tons of ideas piling up for videos I've wanted to make, but I've been really busy with all of the family things. Anyway, it'll be another couple of week and then I'll start publishing again.

    • @AdelaideBen1
      @AdelaideBen1 ปีที่แล้ว

      @@BenCloward thanks for the reply - I saw afterwards that you had answered a similar post. Life should always come first, and especially family. Don't sweat it - but as someone that has been such a positive role model for the YT render community, I was just concerned. Congrats to the newly weds, and good luck to the son - wow. As for moving... it's always an adventure and a half (having moved houses, cities, states and countries, I hear you... and remember the home stays with you, even if the house doesn't).

    • @ethanwasme4307
      @ethanwasme4307 ปีที่แล้ว

      god bless bro @@BenCloward

    • @adamplechaty
      @adamplechaty ปีที่แล้ว

      Hi Ben, just checking in, saying hi. We haven't forgotten about you!

    • @BenCloward
      @BenCloward  ปีที่แล้ว +1

      @@adamplechaty Thanks! New video going up in 4 minutes. :0)

  • @DerBeinmann
    @DerBeinmann ปีที่แล้ว

    Thanks 4 all ur Tutorials...i need to watch them. Really Great 👍👍👍 thx

  • @CloudStrife4
    @CloudStrife4 ปีที่แล้ว

    Nice introduction to HLSL for UE.
    How can I get the uv, fragCoord and iTime equivalent of Shadertoy?
    Thanks

  • @marosis99
    @marosis99 ปีที่แล้ว

    I really would appreciate to see videos about hlsl in visual studio everywhere is only GLSL

  • @handler_music
    @handler_music ปีที่แล้ว

    Nice!
    Would LOVE to see datamosh glitch effect in the next tuts)

  • @MZONE3D
    @MZONE3D ปีที่แล้ว

    Hey Ben, I don't suppose you have a shader setup for edge damage using curvature by any chance ?

  • @Kek9z
    @Kek9z ปีที่แล้ว

    Hi Ben, in 10:23 you were talking about a site with some documentation, you mean those books site? Or you forgot to put it in description :D?

    • @BenCloward
      @BenCloward  ปีที่แล้ว

      You're right - I forgot! I've updated the description now with a couple of resources.

  • @Jody-i1j
    @Jody-i1j ปีที่แล้ว

    Another great video. Looking forward to having possibly a lot of HLSL code. How easy is it to create your own include files and access them in the Custom node?

  • @alexanderalikin1210
    @alexanderalikin1210 ปีที่แล้ว +1

    In Unreal in the 'Code' window you can also #include shader files instead of typing everting in the window

  • @TtlDby
    @TtlDby 6 หลายเดือนก่อน

    reat video, thank you! but I want to ask what do I do if I want to set the sampler type to sample the virtual color when sampling a texture or sample the virtual color directly in hlsl?

  • @Arkideit
    @Arkideit ปีที่แล้ว

    Thank you for your awesome tutorials. Im curious is it possible to use this code for blur ambient occlusion in post process material?

  • @tematoscybersage5626
    @tematoscybersage5626 ปีที่แล้ว

    Isn't this second variant of blurring is Gaussian blur technique?:)
    Also thank you a lot, I wanted long time to learn how to make custom nodes!) because I hear somewhere, that native HLSL is not possible to use in Unreal, but looks like this custom nodes gives ability to get all oportunity of native HLSL, right?

  • @gojomur
    @gojomur ปีที่แล้ว +2

    Using HLSL, how to pass an array into my function? When using the input node, I can not pass my Texture 2D Array into it, due to the requirement of setting UVW input for the texture sample, which leads the input to be just... a selected texture from the array.

    • @user-yw8hx6uy9l
      @user-yw8hx6uy9l ปีที่แล้ว +1

      I have been struggling with this too

  • @OriginRow
    @OriginRow 11 หลายเดือนก่อน

    So can I make cel shading using hlsl without using post process mode

  • @Jukerlaw
    @Jukerlaw ปีที่แล้ว +1

    Is this like some kind of coincidence?! I'm trying to learn C language here and also trying to do a forloop in Material editor, and you show me how to :D

  • @joa1rocha
    @joa1rocha ปีที่แล้ว

    Great video as always!
    Do you have any plans of getting into the new UE5's Substrate system? Performance seems better when recreating some of the materials from past videos.

    • @BenCloward
      @BenCloward  ปีที่แล้ว +4

      Huh, better performance you say? That's interesting. I wonder what the reason for that could be. Yes, I'm planning to make videos that cover substrate in the future. But I'd prefer to wait until Epic is further along in development so I'm not making videos for features that's aren't ready to be used. I consider Substrate to only be about half done right now and if I made videos for it in its current state, they'd be out-dated within just a few months.

  • @dschannel5279
    @dschannel5279 ปีที่แล้ว

    Thank you for your videos. I would really like to see a video about how to create material with fake liquid, for example, when there's half of it in the bottle

    • @BenCloward
      @BenCloward  ปีที่แล้ว

      Ah, yeah, that's a fun one. I did one of those at work a few years back. I'll put it on my list of future ideas. Thanks for the suggestion!

  • @fatemekamali8204
    @fatemekamali8204 ปีที่แล้ว +1

    Thanks Ben

  • @clipbits9437
    @clipbits9437 ปีที่แล้ว

    i have a question actually when i sample a completely transparent texture ( it's a png file that has nothing in it just a transparent background ) It gives me r,g,b values which is (1,1,1). So why it is giving me r,g,b value 1 when the texture does not contain any color.

    • @BenCloward
      @BenCloward  ปีที่แล้ว +2

      RGB defaults to 1 if it's empty. Same thing with the alpha channel. Empty values in textures default to 1.

    • @clipbits9437
      @clipbits9437 ปีที่แล้ว

      @@BenCloward thanks

  • @tylergorzney8499
    @tylergorzney8499 ปีที่แล้ว

    This is so great. I would love to see you do a volumetric world space RGB fractal shader using custom code nodes in UE5

  • @ecruz2317
    @ecruz2317 ปีที่แล้ว

    thanks for all videos Ben. oh shared your stuff on pc again, seems its picked up traffic so hope it helped/s.

  • @masgondi1
    @masgondi1 10 หลายเดือนก่อน

    hi, how do you append a vector in hlsl? i'm trying to implement the whole texture array thing in episode 14 but in hlsl but i can't seem to do it.

    • @BenCloward
      @BenCloward  10 หลายเดือนก่อน

      In HLSL, you can create a vector from the components of other vectors like this: float3(UV.xy, myparameter.x) So in this example, I'm creating a float3 vector from the first two components of the UV vector and the first component of the myparameter vector. Here's another example: float4(myparameter.zx, UV.y, UV.x) In this example, I'm making a float4 vector. The first component is the Z component of myparameter. The second component is the X component of myparameter. The 3rd component is the Y component of the UV vector and the 4th is the X component of the UV vector. I hope this helps.

    • @masgondi1
      @masgondi1 10 หลายเดือนก่อน

      @@BenCloward definitely helps, thank you very much!

  • @isawedthedemons
    @isawedthedemons ปีที่แล้ว

    i like that they revamped the material editor in UE5, but the nodes seem a little too bulky to me now. i guess that's the tradeoff for being able to change stuff on the node itself without using the details panel.

  • @fran.fndz.techart
    @fran.fndz.techart ปีที่แล้ว

    question, long time ago a co worker did a nice shaders, was opaque but at the same time he could fake objects inside the opaque shader like sphere or box, was not using cubemap, i remember was something bending the normals only with a little of bump so he could get that fake effect. opengl2 and unity. any ideas?

    • @fran.fndz.techart
      @fran.fndz.techart ปีที่แล้ว

      is ok, yeah was some normal mask and bump, now i have a fake object inside a cube lol

  • @pan4317
    @pan4317 ปีที่แล้ว

    Any chance you can make a video about two-sided mirror material, just like the one they have in police interview rooms?

  • @wpwscience4027
    @wpwscience4027 ปีที่แล้ว

    In UE I know a lot of the time we are reducing the number of texture pulls because they are expensive in terms of performance. Are we getting hit for the texture once because there is one texture object or for every i in the loop?

    • @BenCloward
      @BenCloward  ปีที่แล้ว +2

      There are two different resources we're talking about so it's important to understand what they are and how they're being effected. The first resource is texture memory since there is a limited amount of it on the device. Texture memory usage remains the same no matter how many samples you do because you're only using 1 texture. Graphics processing time is the other resource - because everything must be done within a specific amount of time in order to render the frame at the target frame rate. The number of samples DOES increase the amount of processing time required - so the more samples you do, the slower your frame rate will be. By how much is dependent on a lot of factors - but in general you should attempt to keep the number of samples as low as you can for better performance.

  • @michaelmano7261
    @michaelmano7261 ปีที่แล้ว

    Hi Ben! Have you even written your own custom shader model in unreal engine? i've seen a few in ue4.2 but anything after that seem non existent. love the HLSL content!

  • @Lazy_Watcher
    @Lazy_Watcher ปีที่แล้ว

    In Unreal, if instead of a texture object input, I wanted to put in something like a ramp created within Unreal itself (So just a float 3 texture that not specifically a texture object basically), how would I do that? I'd love to be able to blur regular math function results.

    • @isawedthedemons
      @isawedthedemons ปีที่แล้ว +1

      you'd need to do it inside the loop, it wouldn't be something that you'd plug in.

  • @xpilarz0
    @xpilarz0 ปีที่แล้ว

    No need to add 'slider' node. When you hover mouse cursor over input label and hold left mouse button you can drag numbers. Works for Unity and Unreal.

  • @TheBugB
    @TheBugB ปีที่แล้ว

    How did you become a technical artist? I’m super interested in your journey

  • @untitled_exr
    @untitled_exr ปีที่แล้ว

    Would be great to see something like chromatic aberrations / Interference, or some interesting grayscales for connection into refraction

  • @timlindberg3833
    @timlindberg3833 11 หลายเดือนก่อน

    Would be blessed if you showed the pipeline xor using external shader files in unreal ❤

  • @LEHtJong
    @LEHtJong ปีที่แล้ว

    Would be really cool to see how to make a custom bilinear or trilinear filtering node.

  • @swrcPATCH
    @swrcPATCH ปีที่แล้ว

    Can you please make a tutorial on how to make blur using shader? Like bluring anything, textures, noise or w/e using shader math but no performance costs!

  • @MiloDelMalwgb
    @MiloDelMalwgb ปีที่แล้ว +2

    Hey Ben. Are you Ok? I do not mind if you gave closure to your channel, but I was wondering if you are ok.

    • @BenCloward
      @BenCloward  ปีที่แล้ว +8

      Yes, I'm doing great - thanks for asking! I'm talking a summer break from making videos because I have a lot of big family events going on that are taking the time I would normally dedicate to making videos each week. I'll try to start back up again in the fall when things are a bit less busy.

    • @MiloDelMalwgb
      @MiloDelMalwgb ปีที่แล้ว

      @@BenCloward Oh, good to hear. I was just wondering if you were ok.
      Videos, there is plenty of content to consume, and I am gratefull for them all.

    • @medmel2160
      @medmel2160 ปีที่แล้ว

      @@BenCloward Awesome, take a good summer time!

    • @ProHolmes
      @ProHolmes ปีที่แล้ว

      @@BenCloward Just found your channel couple days ago. Amazing tutorials! Have a lovely summer

  • @deianSM
    @deianSM ปีที่แล้ว +4

    Second thursday without videos... is everything ok Ben? 😢

    • @BenCloward
      @BenCloward  ปีที่แล้ว +11

      Thanks for asking. Yes, I'm doing great! But - I'm going to need to take the summer off from making videos. I have a lot of family events happening right now that require my time, so it's going to be a couple of months before I can get back to making new videos.

    • @deianSM
      @deianSM ปีที่แล้ว +2

      @@BenCloward Don't worry! I'm glad everything is fine, enjoy your family time!

    • @AdelaideBen1
      @AdelaideBen1 ปีที่แล้ว

      @@BenCloward I just read this - after commenting my question. Family time should re-prioritise most things - but especially YT drops.

  • @gergolaky3624
    @gergolaky3624 ปีที่แล้ว

    I wonder what is Ben doing right now. Probably working on unity updates

  • @gendalfgray7889
    @gendalfgray7889 6 หลายเดือนก่อน

    Advantages of HLSL:
    1) Can do for loop
    2) Shorter that spaghetti

  • @antonzhernosek5552
    @antonzhernosek5552 ปีที่แล้ว

    Hi, Ben, hope you're doing fine since you haven't upload anything in a while
    Since this is the still the latest video, I assume I could post a suggestion here
    I've been really curious on how an "alternative dimension" shader could work for some time. A recent example of one is how Tears of the Kingdom's shrines work where there's a "peek inside" effect for the rock (similar to your tutorials on building interiors). But the character can also go through and it will either display or hide the character based on the camera angle you're viewing from. So if you're looking through the "entrance", you can see the character, but if you try and look from any other angle, the character will be masked. I've no idea if there's a dedicated name to this effect, but I couldn't find anything online. So it would be cool to see your take on it or hear how something like this could be done
    Thanks for your content btw, it's absolutely fantastic

  • @afrikaansedude2525
    @afrikaansedude2525 ปีที่แล้ว

    Can you please do a grass shader 🥺🔥

  • @omri1324
    @omri1324 ปีที่แล้ว

    I always thought Unity uses GLSL code, not HLSL, can you shed some light on it?

    • @BenCloward
      @BenCloward  ปีที่แล้ว

      Unity uses HLSL code.

    • @omri1324
      @omri1324 ปีที่แล้ว

      @@BenCloward I thought OpenGL applications necessarily use Glsl rather than Hlsl. Thanks Ben!

    • @BenCloward
      @BenCloward  ปีที่แล้ว +1

      @@omri1324 Unity supports lots of different platforms. Some use OpenGL, some use DirectX, some use Metal, etc. The shaders are first written out in HLSL and then they get translated to the other lanaguages automatically where needed.

  • @meowyih1
    @meowyih1 ปีที่แล้ว

    Does Unreal Engine hate people to write HLSL directly? I haven't seen any code editor as bad as this default one in UE. 😞The typing space is ridiculous small. You need to click "Shift+Enter" to change line. There is no auto indent, no auto correction and no auto keyword color. The worst thing is that it does not allow user to link to external text editor. All I can assume is the creators really don't want anyone to use it.

  • @woohj7649
    @woohj7649 ปีที่แล้ว

    사랑해요❤

  • @bdazzler123
    @bdazzler123 2 หลายเดือนก่อน

    If people are working with hlsl, they will already know about for loops/int/float

  • @AlexisSanchez-ss3il
    @AlexisSanchez-ss3il ปีที่แล้ว +1

    For anyone looking where to learn HLSL, Ben has an amazing course on his channel :)

    • @mlecz
      @mlecz ปีที่แล้ว +4

      This course is from 2007, modern HLSL approach differ a little bit ;)

    • @AlexisSanchez-ss3il
      @AlexisSanchez-ss3il ปีที่แล้ว

      @@mlecz Oh really? I'm not too familiar with it rn 😅
      Thanks for sharing then 😁

  • @bdenix1997
    @bdenix1997 ปีที่แล้ว +2

    I'll show you the best thing about unreal engine's custom nodes.
    lets say you have 2 custom function and you want to call them inside one another.
    in this case what you can do is,
    define a struct inside of the custom node like:
    struct MyStruct{
    float firstFunc(){ return 1};
    float3 myFunc(float a){
    return float3(1,1,1) * firstFunc();
    };
    };
    then go on and define a variable of that struct and call the function like:
    MyStruct test;
    test.myFunction();
    enough with visual programming bullshit.
    have a nice day.

  • @miloszgierczak4806
    @miloszgierczak4806 ปีที่แล้ว +1

    Hey Ben, u allright? 4 months tho :D

    • @BenCloward
      @BenCloward  ปีที่แล้ว +3

      I’m doing great. We just moved across the country. We’re in our new house now and beginning the unpacking process, but we don’t have internet hooked up here yet, so it will still be a couple of weeks before I can start making videos again. Thanks for your concern!

    • @miloszgierczak4806
      @miloszgierczak4806 ปีที่แล้ว

      @@BenCloward ooooh! thats great to hear! Moving is usualy quite stresfull so i send you a lot of support to make it happen and start living your daily routine as fast as possible :D Take your time and take care, glad to hear from ya!

    • @gergolaky3624
      @gergolaky3624 ปีที่แล้ว

      @@BenCloward Hey if you are in a country that is near my country I can help you unpack so you will start making videos faster!

    • @gergolaky3624
      @gergolaky3624 ปีที่แล้ว

      @@BenCloward Also, are you working on new stuff with unity? They had lots of ai updates and stuff

    • @BenCloward
      @BenCloward  ปีที่แล้ว

      I’m working on a lot of things at Unity but I can’t comment on them.

  • @mohsenzare2511
    @mohsenzare2511 ปีที่แล้ว

    First comment :)

  • @valstormkaaos
    @valstormkaaos ปีที่แล้ว +1

    Ben please... can you not put the background music in the tutorials any more, I've been listening to them for 2 years. I can't priase your tutorials enough but for the love of god just let us play our own music while we watch... Pleeeeease!

  • @onigumo
    @onigumo ปีที่แล้ว

    Hi Ben, I'm making mobile games so I have a question:
    are there any projects or even demos that has a lot of different materials but it didn't use any textures?
    just simple old school style Rock, Stone, Brick, Wood, Metal, maybe like Half Life?
    I'd love to make a game that uses only code to make all the environment, one for the small build size and one for my own learning of all the math.
    Thanks, love you man.