Тёмный

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

PrismaticaDev
Подписаться 63 тыс.
Просмотров 31 тыс.
50% 1

Hey hey! Today we're talking about Custom Data, or Custom Primitive Data which is an extremely awesome way to create variation in your assets, as well as a very effective way of optimizing your scene. Draw calls can be a huge performance bottleneck if left unchecked, but Custom Data allows us to have control over colours and other parameters in materials without breaking instancing or creating many material instances.
Enjoy!
----------------------------------------
Patreon: / prismaticadev
Discord: / discord
Twitch: / prismaticadev
Twitter: / prismaticadev
RU-vid: / prismaticadev
----------------------------------------
Computer Specs:
Ryzen 3900x 12-core CPU
MSI Geforce RTX 2080 Super
64GB Corsair RAM
One of those fancy nvme m.2 SSD's
Programs of choice:
Unreal Engine 4 - (Game Dev)
Blender 2.8 - (Animation and Modelling)
OBS - (Video/screen capture)
Davinci Resolve - (Video editing)
Adobe Photoshop - (Graphics and Texturing)
Quixel Mixer - (Texturing)
ProTools 11 - (Compositions and mixing)
OldSchool Runescape - (Chillax time)
Filmed using:
Sony A7s2 body
Sony 24-70mm f/2.8 GM lens
Yonguo YN360 LED's for colour
Yongnuo YN760 chip LED w/ Godox softbox for key
My lovely cats names are Boycat, Girlcat and Ladycat :)

Опубликовано:

 

2 янв 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 122   
@TheJackuTV
@TheJackuTV 6 месяцев назад
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 6 месяцев назад
Yessir! IF anyone is interested you can check out my "individual foliage logic" video for some examples ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-6sjc4dqoCF0.html&ab_channel=PrismaticaDev
@sigrid714
@sigrid714 Год назад
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.
@_Caose
@_Caose 2 года назад
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 RU-vid. You Rock! 🤛🏻
@PrismaticaDev
@PrismaticaDev 2 года назад
Thanks so much!!
@chaosklappstuhl4905
@chaosklappstuhl4905 Год назад
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.🥳
@bitesizedtech8095
@bitesizedtech8095 2 года назад
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!
@TyLovePie
@TyLovePie 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.
@irissantos4795
@irissantos4795 2 года назад
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 года назад
That makes me very happy to hear :) Thanks for watching!
@jennifer.c.miller4428
@jennifer.c.miller4428 2 года назад
Thank you! I've been trying to find videos about this subject!
@PrismaticaDev
@PrismaticaDev 2 года назад
You're very welcome! :)
@danielwhitehead8965
@danielwhitehead8965 6 месяцев назад
Dude exactly what i needed!
@yongbinren8810
@yongbinren8810 2 года назад
Such cool idea, thanks for sharing this
@vincentdautremer3869
@vincentdautremer3869 2 года назад
welldone it's amazing for optimisation ! Incredible as usual !
@PrismaticaDev
@PrismaticaDev 2 года назад
Thank you! :)
@erfanbahrami573
@erfanbahrami573 Год назад
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
@johnmannp7158
@johnmannp7158 2 года назад
Thank you so MUCH for these tutorials!
@PrismaticaDev
@PrismaticaDev 2 года назад
Thank YOU so much for watching and supporting as always :)
@LookItsCollin
@LookItsCollin 2 года назад
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 года назад
Sure could! With the benefit of not needing to have a separate mesh for each bottle and let them all instance together
@Malindu-dazz
@Malindu-dazz 6 дней назад
Wonderful video. How couldn't I know about this :(
@aurintalik
@aurintalik 2 года назад
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
@LookItsCollin
@LookItsCollin 2 года назад
HE'S BACK!
@ebmclovin
@ebmclovin 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 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
@lennybunny93
@lennybunny93 2 месяца назад
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
@MAyZERart
@MAyZERart 2 года назад
Thank you!
@yurifox5341
@yurifox5341 2 года назад
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 года назад
Really glad you're finding the videos helpful :) Don't forget to share with friends!
@QuiteDan
@QuiteDan 4 месяца назад
I'm using custom data now to make gradients along a spline mesh.
@Kekzmann
@Kekzmann Год назад
The whole vid i was like: I know that music. And then it hit me. OSRS bangers. Nice choice. Perfect background music.
@t3hpwninat0r
@t3hpwninat0r 2 года назад
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
@Greenman4890
@Greenman4890 10 месяцев назад
My life has been changed lol thank you
@cgkrab
@cgkrab 2 года назад
This is great
@unrealdevop
@unrealdevop 4 месяца назад
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 года назад
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 года назад
Haha very glad to hear! Glad I could show you this system :)
@darkpixal
@darkpixal 2 года назад
King shit tbh 👑
@captaindeabo8206
@captaindeabo8206 2 года назад
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
@3DWithLairdWT
@3DWithLairdWT 2 года назад
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 года назад
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)
@Nefrann
@Nefrann 2 года назад
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.
@unrealfreedom1807
@unrealfreedom1807 9 месяцев назад
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 9 месяцев назад
It's just some basic cel-shading :) It turns gradients in to distinct bands which results in some nice textures
@dreamingacacia
@dreamingacacia 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.
@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 ;)
@paradox8425
@paradox8425 2 года назад
Does it reduces movable meshes draw call too? Or is it static only?
@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
@boraycobanoglu1372
@boraycobanoglu1372 11 месяцев назад
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?
@Alaabale
@Alaabale 2 года назад
if you hold v you can get color or vector paramter
@PrismaticaDev
@PrismaticaDev 2 года назад
Thank you! I will remember that haha
@leetness13
@leetness13 6 месяцев назад
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 6 месяцев назад
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 6 месяцев назад
@@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
@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
@3nany
@3nany 2 года назад
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 :)
@IstyManame
@IstyManame 21 день назад
What's the custom commands window on the bottom? Is that Editor Utility Widget?
@Extrone
@Extrone 2 года назад
Thank you, just reduced my draw calls from around 4000 to just 145
@PrismaticaDev
@PrismaticaDev 2 года назад
Amazing!
@semirukiya5308
@semirukiya5308 Год назад
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 Год назад
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?
@alhusseinali
@alhusseinali 4 месяца назад
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 4 месяца назад
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.
@_batt
@_batt Год назад
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 Год назад
Yep! Absolutely. You can use the Flipbook function for exactly that
@_batt
@_batt Год назад
@@PrismaticaDev Thank you! That was exactly what I was looking for.
@DevGods
@DevGods 2 года назад
I wonder whats causing the gpu to run an 20 ms. The amount of triangles?
@PrismaticaDev
@PrismaticaDev 2 года назад
Oh, I have my FPS locked to 50fps when I record/stream so the GPU is idle for the majority of frame time :)
@Samelion
@Samelion 2 года назад
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
@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?
@polyvival-fpssurvival7659
@polyvival-fpssurvival7659 Год назад
Can we just use it on things that we place by hand in the level? Foliage we can't ?
@peekstone
@peekstone 2 года назад
Wow - why is this so hidden? - it seems rather important 😅 Thanks for the video about it!
@PrismaticaDev
@PrismaticaDev 2 года назад
Haha Unreal is a very deep cave to explore :P
@aeonkitsune3132
@aeonkitsune3132 2 года назад
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.
@mrGreen1539
@mrGreen1539 7 месяцев назад
stat unit
@zhixoworld
@zhixoworld 4 месяца назад
we can't use custom primitive data with decals?
@alhusseinali
@alhusseinali 4 месяца назад
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 4 месяца назад
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 4 месяца назад
@@PrismaticaDev Yea I just watched this tutorial and it reminds me about what u told me two weeks ago : ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-9GhOr33Uvxo.html Thanks bro you are the best.
@SockeYoutube
@SockeYoutube Год назад
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 Год назад
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!
@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"
@aeroljohn3331
@aeroljohn3331 Год назад
so u telling me I can have 10 index of contants parameter and still count as 1 draw call as a material?
@gursimransingh8726
@gursimransingh8726 2 года назад
Pls also about volumetric clouds pls specialy cloud sample attributes node
@PrismaticaDev
@PrismaticaDev 2 года назад
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
@Jake-co7rt
@Jake-co7rt 2 года назад
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 года назад
Hahahaha drahw cahls!
@Jake-co7rt
@Jake-co7rt 2 года назад
@@PrismaticaDev I'm from the South-Eastern US, so you nailed it. (c:
@miloszgierczak4806
@miloszgierczak4806 2 года назад
@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
@kurvaosobne3897
@kurvaosobne3897 2 года назад
CUSTOM DARTA
@mindped
@mindped Год назад
Are there any negatives to doing this?
@PrismaticaDev
@PrismaticaDev Год назад
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 Год назад
@@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...
@mrzero2089
@mrzero2089 Год назад
theres much esier way but not the best in optimize. it is by using dynamic materials
@PrismaticaDev
@PrismaticaDev Год назад
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
@amooseinaroom1228
@amooseinaroom1228 2 года назад
everything is the DEVIL to you charlie :'(
@PrismaticaDev
@PrismaticaDev 2 года назад
You're the DEVIL!!!
Далее
Two-Sided Sign Node | 5-Minute Materials [UE4/UE5]
8:40
С Анджилишей на тусе💃
00:15
Просмотров 145 тыс.
Спасибо Анджилишка, попил😂
00:19
The Switch Node | 5-Minute Materials [UE5]
13:00
Просмотров 14 тыс.
Per-Instance Random | 5-Minute Materials [UE4/UE5]
5:51
Vertex Normal WS Node | 5-Minute Materials [UE4]
7:13
The Noise Node | 5-Minute Materials [UE5]
10:44
Просмотров 25 тыс.
The Fresnel Node | 5-Minute Materials [UE4]
6:47
Просмотров 40 тыс.