Optimize with Custom Data | 5-Minute Materials [UE4/UE5]

Поделиться
HTML-код
  • Опубликовано: 28 сен 2024

Комментарии • 127

  • @TheJackuTV
    @TheJackuTV 9 месяцев назад +10

    For those of you who are adding isntances to Instanced Static Mesh Component you need to use PerInstance Custom Primitive Data node in the material. That will then set the material values on specified instance instead of the parent instanced static mesh component.

    • @PrismaticaDev
      @PrismaticaDev  9 месяцев назад +6

      Yessir! IF anyone is interested you can check out my "individual foliage logic" video for some examples ruclips.net/video/6sjc4dqoCF0/видео.html&ab_channel=PrismaticaDev

  • @irissantos4795
    @irissantos4795 2 года назад +7

    This is my favourite channel on youtube hands down! Honestly thank you so much for all your videos and amazing thorough explanation is everything you create! As a 3D Environment artist I feel like these videos are a treasure and really support me in the learning process and development of my skills in unreal 🌟

    • @PrismaticaDev
      @PrismaticaDev  2 года назад +3

      That makes me very happy to hear :) Thanks for watching!

  • @bitesizedtech8095
    @bitesizedtech8095 2 года назад +3

    Charlie you've become my favorite game dev on youtube! Keep up the great work and i hope that Prismatica will be a great success for you!

  • @chaosklappstuhl4905
    @chaosklappstuhl4905 Год назад +2

    Thanks for all your short videos about one specific subject. That is really awesome as you don´t have to skip through hours of tutorials just to get to this one matter.🥳

  • @_Caose
    @_Caose 2 года назад +48

    You are genuinely the most underrated channel about UE and gameDev. Clearly deserve way, WAY more recognition. Thank you for all of your work and effort on RUclips. You Rock! 🤛🏻

  • @aurintalik
    @aurintalik 2 года назад +1

    You're the best! But also a monster because now I have to go add this to all my materials! \o/ Glad to see the 5 minute materials are back. :)

    • @PrismaticaDev
      @PrismaticaDev  2 года назад

      Haha you will thank yourself down the line :P

  • @lennybunny93
    @lennybunny93 6 месяцев назад +1

    A little PSA to everyone having the same issue. If in UE5.1and later if your custom primitive data doesn't show during runtime while using a Blueprint, it's because you need to setup a default custom primitive data value in Blueprint, after you set the default you can change the value using the set custom primitive data

  • @johnmannp7158
    @johnmannp7158 2 года назад +3

    Thank you so MUCH for these tutorials!

    • @PrismaticaDev
      @PrismaticaDev  2 года назад +1

      Thank YOU so much for watching and supporting as always :)

  • @captaindeabo8206
    @captaindeabo8206 2 года назад +1

    This is brilliant thanks. i asked myself somtimes what s meant whit the term in UE. Now i Know it Thanks . But i have one point of critique: The Index of a list or arrays are always Integers not a floats. 1 and not 1.0. Its used to numerated or count entry`s in an data structure this is done whit natural numbers. Its like the numeration of the drawers of a shelf. there is usally no onehalf drawer. In this case serval Material paramters (or data in form of a float) are stored in on drawer or(list entry) and numerated via the assignmend of an index (integer).

    • @PrismaticaDev
      @PrismaticaDev  2 года назад

      You're correct - although when I say "custom data floats" I mean that the values assigned to each index/ integer are floats, not the indices themselves haha

  • @unrealdevop
    @unrealdevop 7 месяцев назад

    Great video, I've been wondering how that batching (Auto-Instancing) worked. I recently heard about it and learned it was introduced in like 4.22 or something. Had no idea that was even a thing.

  • @Fokkusu
    @Fokkusu 2 года назад +1

    yoo this shit is lit 🔥🔥 fam 👌😆 💯. Now in a more serious note, if material instances help a lot by being well, instances with allow for variants for the same mat, this is like the same improvement from using different materials for each variant with instances but this custom data improves on the instances, this is WILD. I'm 1000000000000% going to use this. Thanks a lot for this tutorial! :D, this is going to be PERFECT for our object instance system, we will be able to basically instance ALMOST EVERYTHING now

    • @PrismaticaDev
      @PrismaticaDev  2 года назад +1

      Haha very glad to hear! Glad I could show you this system :)

  • @dreamingacacia
    @dreamingacacia 2 года назад +2

    I'm not sure if there is an update on this topic but I found this accidently. So I ticked the custom primitive data while the node selected then the name of the parameter including their variables appeared at the object, with this is simpler and nothing to confuse about. Therefore I don't need to be too careful when changing the variables. I'm not sure if this is because they updated it or I just happened to found a better way, but I think I should mention here.

  • @cgkrab
    @cgkrab 2 года назад +2

    This is great

  • @leetness13
    @leetness13 9 месяцев назад +1

    thanks for the great tutorial ! also there is no way to have dynamic instanced meshes with translucent materials right ? as soon as I switch the material to translucent, it doesnt work anymore

    • @PrismaticaDev
      @PrismaticaDev  9 месяцев назад

      Hmmm... I'm not actually sure! I'll need to test it out myself to confirm. Maybe if the actors are all set to be Static it will have an easier time dyna-instancing them. It could also be something to do with the separate pass for translucent stuff. I'll report back after some doodling!

    • @leetness13
      @leetness13 9 месяцев назад

      @@PrismaticaDev yep everything is static I double checked. and yeah that would be awesome if you could tell me more about that, thanks a lot comrade

  • @iuliandobrogeanu3762
    @iuliandobrogeanu3762 Месяц назад

    I tested it currently with texture arrays applied to planes , for some reason the draw calls is higher on the planes using one MM , yet the planes using different separate MI's is lower , I don't really understand why is it so even tho I used the same commands

  • @3DWithLairdWT
    @3DWithLairdWT 2 года назад +3

    Are the custom data values something you can manipulate in BPs during construction or during gameplay? I'd love to implement this into my Trim Sheet based Env project

    • @PrismaticaDev
      @PrismaticaDev  2 года назад +3

      they absolutely are :) If you have a reference to the static mesh just drag a pin off of it and look for "set custom primitive data" or something. It's a much better option than setting a material parameter because when you set a material parameter at runtime, it automatically converts that material to a Dynamic Material Instance (which will break instancing/batching for that object)

  • @alhusseinali
    @alhusseinali 7 месяцев назад +1

    Yo, I used to use "dynamic martial instance" to change the texture but it seems like it cause a drawcall per every mesh get applies, the solution is to use a new method called "Custom primitive data" but I wonder Can I use this method to change the texture maps or just the color?

    • @PrismaticaDev
      @PrismaticaDev  7 месяцев назад +1

      Hey hey!
      You can, although it will increase the shader complexity slightly. You'll need to set up a Switch node with all of the textures being sampled (not a big deal if it's just 2 or 3) and then in to the Value input, you'll put a Custom Data value. So all 3 textures will be sampled, but then you use Custom Data to "show" which one you want, without needing to do dynamic materials.

  • @mindped
    @mindped Год назад

    Any idea why many of my parameters are showing up as Undeclared (even though they work fine)... while other parameters also work fine but have the name and clickign them takes you to their location on the material?

  • @Nefrann
    @Nefrann 2 года назад +1

    Thank you so much for this! Can you use it with Foliage actors? I can't find the "Custom primitive data" option anywhere in foliage stuff :/

    • @PrismaticaDev
      @PrismaticaDev  2 года назад

      Hey hey there! Unfortunately it isn't exposed by default within the foliage tool, although it's definitely on the foliage instances since I use it to do instanced foliage interaction.

  • @marcusunivers
    @marcusunivers Год назад

    My approach is to create Actor Blueprints with puplic variables for manipulating each Mat Inst. But for an easy and dirty way this is good ;)

  • @alhusseinali
    @alhusseinali 7 месяцев назад +1

    Hey there, I converted a texture sample to parameter and then when I try to search for "use Custom Primitive data" it wasn't there .. my question is .. can I use this feature with textures parameters as I used to do when I was using dynamic material instances ?

    • @PrismaticaDev
      @PrismaticaDev  7 месяцев назад +1

      Correct - Custom Data is limited to floats only, like UV data and Vertex Colour.
      However, you can sample multiple textures and then use Custom Data to Lerp between them, or use a Switch node :)

    • @alhusseinali
      @alhusseinali 7 месяцев назад

      @@PrismaticaDev Yea I just watched this tutorial and it reminds me about what u told me two weeks ago :
      ruclips.net/video/9GhOr33Uvxo/видео.html
      Thanks bro you are the best.

  • @Extrone
    @Extrone 2 года назад +1

    Thank you, just reduced my draw calls from around 4000 to just 145

  • @3nany
    @3nany 2 года назад +1

    is there a way to make a parameter with only 3 floats in to a custom data. I have base colours that don't have an alpha channel and if i convert those to custom data it adds a 4th channel.
    Great vid btw. I absolutely am currently making multiple material instances just for colour variation like you explained and this would be way more efficient.

    • @PrismaticaDev
      @PrismaticaDev  2 года назад

      I think the only way would be to make 3 single float values and then fed them in to a MakeFloat3 node.

    • @3nany
      @3nany 2 года назад

      @@PrismaticaDev yeah that's a decent workaround. was hoping for sth that uses just one node but thanks this is probably what i will use :)

  • @semirukiya5308
    @semirukiya5308 Год назад +1

    This is great! But I guess it's limited to use normal material types because when it comes to stuff like Material Layers the same one Custom Data parameter would affect all the layers, right?

    • @PrismaticaDev
      @PrismaticaDev  Год назад +2

      Correcto, yeah. Unless you specifically set up different custom data values knowing which affects each different layer

    • @semirukiya5308
      @semirukiya5308 Год назад

      @@PrismaticaDev Is there any way to get around the limit of 35 index count, tho?

  • @bibigulchik
    @bibigulchik 2 года назад

    Thank you!

  • @_batt
    @_batt Год назад +1

    Here's a question for you, do you think it would be possible to use a scalar custom data as sort of an "index" to choose between a set of different textures in the same material? Like for example, I have a sign model but a bunch of different decals that go on the sign. The scalar is hooked up somewhere in the sign's single material, so if I put in "2" it chooses the second texture, if I put in "8" it chooses the 8th texture, etc. I have the idea in my mind but I'm not familiar with the math required to make it work.

    • @PrismaticaDev
      @PrismaticaDev  Год назад +1

      Yep! Absolutely. You can use the Flipbook function for exactly that

    • @_batt
      @_batt Год назад +1

      @@PrismaticaDev Thank you! That was exactly what I was looking for.

  • @boraycobanoglu1372
    @boraycobanoglu1372 Год назад

    this would apply for more complex shaders too right? let's say we are using vertex colors with multiple normal and roughness maps overlays, variations etc. how would one go about at this then?

  • @unrealfreedom1807
    @unrealfreedom1807 Год назад

    Hey this is an amazing tutorial thank you for all your work! How did you achieve these shadow details? There is a pattern in the shadows. How did you do this?

    • @PrismaticaDev
      @PrismaticaDev  Год назад

      It's just some basic cel-shading :) It turns gradients in to distinct bands which results in some nice textures

  • @DevGods
    @DevGods 2 года назад +1

    I wonder whats causing the gpu to run an 20 ms. The amount of triangles?

    • @PrismaticaDev
      @PrismaticaDev  2 года назад +1

      Oh, I have my FPS locked to 50fps when I record/stream so the GPU is idle for the majority of frame time :)

  • @plasid2
    @plasid2 2 года назад

    its something similar to apply the same LODs for multi static meshes? I freak out clicking every single static mesh and chenge number of LOD and camera distance value

  • @rtgchannel4154
    @rtgchannel4154 2 года назад

    Can you please wake tutorial, or tell how to make comic shader? With dots and lines on edges or in a shadow? I can't find a tutorial on youtube or somewhere else

  • @Jake-co7rt
    @Jake-co7rt 2 года назад +1

    What are "Drokols"?
    JK. LOL. Our differing accents did confuse me... momentarily.
    As always, thanks for doing these wonderful super-informative vids. (c:

    • @PrismaticaDev
      @PrismaticaDev  2 года назад +1

      Hahahaha drahw cahls!

    • @Jake-co7rt
      @Jake-co7rt 2 года назад

      @@PrismaticaDev I'm from the South-Eastern US, so you nailed it. (c:

  • @xylvnking
    @xylvnking Год назад

    this is the sauce

  • @xdragon5502
    @xdragon5502 2 года назад

    Do you have a tutorial that shows how to set up this material switching?

    • @PrismaticaDev
      @PrismaticaDev  2 года назад

      Which switching are you referring to?

    • @xdragon5502
      @xdragon5502 2 года назад

      @@PrismaticaDev The "Custom Primitive Data Default"

  • @miloszgierczak4806
    @miloszgierczak4806 2 года назад +1

  • @kurvaosobne3897
    @kurvaosobne3897 2 года назад +1

    CUSTOM DARTA

  • @mrzero2089
    @mrzero2089 2 года назад

    theres much esier way but not the best in optimize. it is by using dynamic materials

    • @PrismaticaDev
      @PrismaticaDev  2 года назад +2

      Correcto - however using a Dynamic Instanced Material will prevent the mesh from being dynamically batched/instanced. Custom Primitive Data allows them to be batched together in to 1 draw call

  • @ebmclovin
    @ebmclovin 5 месяцев назад +2

    Ive noticed if you fullscreen itll reduce those draw calls more, giving you a more accurate number. I believe the editor ui elements contribute to draws.

    • @PrismaticaDev
      @PrismaticaDev  5 месяцев назад +2

      Yep, very true. In fact a lot of things in the profilers are affected by the Editor UI so it's always good to fullscreen

  • @Malindu-dazz
    @Malindu-dazz 3 месяца назад +1

    Wonderful video. How couldn't I know about this :(

  • @aeroljohn3331
    @aeroljohn3331 Год назад +1

    so u telling me I can have 10 index of contants parameter and still count as 1 draw call as a material?

  • @rahulnmahajan7224
    @rahulnmahajan7224 11 дней назад +1

    A question!!
    Can we use different textures instead of color as custom data parameter?
    If yes, how?

    • @PrismaticaDev
      @PrismaticaDev  11 дней назад

      Hey there!
      You can't "actually" pass through a texture with custom data, however you can use custom data to drive a Switch node between different textures, or you can use a Texture2D Array and use a custom data value to change the W value (the 3rd axis of UVW)

  • @sigrid714
    @sigrid714 Год назад +9

    I can't believe I never knew about this! This is a total game changer. You are to UE Materials what Mathew Wadstein was to UE Blueprints.

  • @mrGreen1539
    @mrGreen1539 10 месяцев назад +1

    stat unit

  • @darkpixal
    @darkpixal 2 года назад +2

    King shit tbh 👑

  • @QuiteDan
    @QuiteDan 7 месяцев назад

    I'm using custom data now to make gradients along a spline mesh.

  • @TyLovePie
    @TyLovePie 2 года назад +2

    🤯 This video opens up a whole new world that I didn't know existed! You are a the Lord of Materials my man. Thank you for this series. I have spend a lot of time trying to wrap my mind around materials and you just make it so simple.

  • @IstyManame
    @IstyManame 3 месяца назад

    What's the custom commands window on the bottom? Is that Editor Utility Widget?

  • @zhixoworld
    @zhixoworld 7 месяцев назад

    we can't use custom primitive data with decals?

  • @peekstone
    @peekstone 2 года назад +2

    Wow - why is this so hidden? - it seems rather important 😅 Thanks for the video about it!

    • @PrismaticaDev
      @PrismaticaDev  2 года назад +1

      Haha Unreal is a very deep cave to explore :P

  • @erfanbahrami573
    @erfanbahrami573 2 года назад +1

    Hi Charlie
    Im new to this channel but I must say your videos are fantastic and I've learned so much new things because of your content..
    Thank you and keep up the good work

  • @polyvival-fpssurvival7659
    @polyvival-fpssurvival7659 2 года назад

    Can we just use it on things that we place by hand in the level? Foliage we can't ?

  • @Alaabale
    @Alaabale 2 года назад +2

    if you hold v you can get color or vector paramter

    • @PrismaticaDev
      @PrismaticaDev  2 года назад

      Thank you! I will remember that haha

  • @Greenman4890
    @Greenman4890 Год назад

    My life has been changed lol thank you

  • @mindped
    @mindped Год назад +2

    Are there any negatives to doing this?

    • @PrismaticaDev
      @PrismaticaDev  Год назад +3

      It can be a little difficult to manage, for example you might have 2 materials that are using custom data index 0 to do different things. However in Unreal 5, you can search for a custom data index by name which can help with that. As long as you manage it all properly, there’s no downside

    • @mindped
      @mindped Год назад

      @@PrismaticaDev what if i have a building with 1000 bricks.(just an odd example) Would setting the custom data on every brick bring any kind of negative? Memory? anything?

    • @PrismaticaDev
      @PrismaticaDev  Год назад +1

      @@mindped Each of the bricks would need to keep track of 1 piece of data each (a few bytes of data, aka nothing). However, if you were actively setting it on all of them per frame you'd chug a but

    • @mindped
      @mindped Год назад

      @@PrismaticaDev Im glad i found this video. Very awesome potential here. Subscribed :D .. may even hit you up if you are ever interested in freelance work.

    • @mindped
      @mindped Год назад

      @@PrismaticaDev Does not look like HLODs or packed level actors/material instances are supported with this. Unless you know of a way to make them work. HLODs do use the color information or any of the variables. And packed level actors have the same problem...

  • @SockeYoutube
    @SockeYoutube 2 года назад +1

    Is there also such an optimization for decals? I wanted to make a game like Splatoon but each decal costs 1 drawcall and that is extreme. All decals have had the same material.

    • @PrismaticaDev
      @PrismaticaDev  2 года назад +1

      I'm not entirely sure, but I believe splatoon uses runtime vertex painting for their splats. Decals can be pretty expensive on the rendering side, let alone the draw calls, so it's always fun to think of alternate solutions. Maybe check out my videos about my Blood system for some inspiration!

  • @Sivxgamer
    @Sivxgamer 9 месяцев назад +1

    Dude exactly what i needed!

  • @RikiB
    @RikiB Месяц назад

    For some reason this defaults the value to 0 on every single mesh using the material. It ignores any value you set in the material instance. So of you are trying to use this to change colors or to multiply something its always going to default black? Why doesnt it at least give an option to default to 1?

    • @RikiB
      @RikiB Месяц назад

      Its a bit of a workaround but you could just plase and Add node and put the custom data into the A slot - then plug that into your graph. It will change the default to 1 at least. Better than having everything black.

  • @yurifox5341
    @yurifox5341 2 года назад +1

    man...YOU ARE LEGEND!
    I started my game project( and one ofy life goal😅) and you really help me understand about unreal techniques that is not easy to find
    Thank you so much for bringing so much information🙏🏽
    Really hope to play your game 😁

    • @PrismaticaDev
      @PrismaticaDev  2 года назад +1

      Really glad you're finding the videos helpful :) Don't forget to share with friends!

  • @LookItsCollin
    @LookItsCollin 2 года назад +1

    HE'S BACK!

  • @t3hpwninat0r
    @t3hpwninat0r 2 года назад +1

    I can see the value of adding a component to an actor that gives me buttons in the editor for randomising custom data floats or using the colour picker to set values at a particular index, or even setting values based on some other thing like world z position, copy scale value into custom data float, and of course the most obvious one is to let the actor's blueprint change the value at runtime for whatever reason, like maybe to control how high the red part should be on an old mercury thermometer

    • @PrismaticaDev
      @PrismaticaDev  2 года назад

      Yesss absolutely - I've been thinking of making a tool that allows the use of an actual colour picker etc instead of the 3 floats haha

  • @LookItsCollin
    @LookItsCollin 2 года назад +1

    What a cool video. Had no idea this was an option. When I had small props like bottles I always used an atlas for different labels and colors. This looks like it could handle that and tons of other stuff at the same time

    • @PrismaticaDev
      @PrismaticaDev  2 года назад +1

      Sure could! With the benefit of not needing to have a separate mesh for each bottle and let them all instance together

  • @vincentdautremer3869
    @vincentdautremer3869 2 года назад +1

    welldone it's amazing for optimisation ! Incredible as usual !

  • @jennifer.c.miller4428
    @jennifer.c.miller4428 2 года назад +1

    Thank you! I've been trying to find videos about this subject!

  • @amooseinaroom1228
    @amooseinaroom1228 2 года назад +1

    everything is the DEVIL to you charlie :'(

  • @Samelion
    @Samelion 2 года назад +1

    Do you know if its possible to access this custom data in post-process?

    • @PrismaticaDev
      @PrismaticaDev  2 года назад

      Unfortunately not, unless you wanted to do some hacky stuff like plug the values in to the Subsurface output and then use the Subsurface buffer in the Post Process

  • @aeonkitsune3132
    @aeonkitsune3132 2 года назад +1

    Do you think it would be possible to use custom data on an npc that gets skeletal mesh merged at event begin play? I'm poking around with it, and the way I currently have it, in the blueprint viewport my custom data adjustments are showing up, but after getting merged when I hit play to test the game it gets reset. My guess is the new merged mesh doesn't keep the custom data. Do you think there's any way to transfer the custom data into the skeletal merged mesh?

    • @PrismaticaDev
      @PrismaticaDev  2 года назад

      You should be able to use the “set custom primitive data” function in blueprint to change the custom data at runtime :)

    • @aeonkitsune3132
      @aeonkitsune3132 2 года назад

      @@PrismaticaDev Thank you so much for the quick reply! It's a bit late where I am so I'm hopping off for the night, but I'll definitely try that out tomorrow.

  • @SeinDigital
    @SeinDigital 2 года назад

    I have only one question: why not variables?

    • @PrismaticaDev
      @PrismaticaDev  2 года назад

      As soon as you change a variable (material parameter) at runtime, the material is turned in to a dynamic material instance and can no longer be batch-rendered

  • @gursimransingh8726
    @gursimransingh8726 2 года назад +1

    Pls also about volumetric clouds pls specialy cloud sample attributes node

    • @PrismaticaDev
      @PrismaticaDev  2 года назад +1

      Unfortunately I've never actually used volumetrics - might be something I do in the future though :)

    • @gursimransingh8726
      @gursimransingh8726 2 года назад

      @@PrismaticaDev ok waiting for your implementations

  • @Kekzmann
    @Kekzmann 2 года назад

    The whole vid i was like: I know that music. And then it hit me. OSRS bangers. Nice choice. Perfect background music.

  • @paradox8425
    @paradox8425 2 года назад

    Does it reduces movable meshes draw call too? Or is it static only?

  • @yongbinren8810
    @yongbinren8810 2 года назад

    Such cool idea, thanks for sharing this