Тёмный

UE4 BP 1 - How To Set Material Parameters On Instanced Mesh Components - Unreal Engine Tutorial 

Alex Quevillon [En] (Unreal Engine Tutorials)
Подписаться 8 тыс.
Просмотров 11 тыс.
50% 1

By combining the nodes PerInstanceCustomData, VertexInterpolator and the SetCustomDataValue function, we are able to have different Scalar Parameters on Instanced Static Mesh Component.
All Assets ► www.patreon.com/posts/all-ass...
────────────────────────────────────────────────────
French Channel ► ru-vid.com...
English Channel ► ru-vid.com...
────────────────────────────────────────────────────
Discord ► / discord
Patreon (Project Files) ► / alexquevillon
RU-vid Members ► / @alexquevillonen
────────────────────────────────────────────────────
Unreal Engine Version ► 4.25
────────────────────────────────────────────────────
0:00 Intro
0:13 Project overview
0:50 Material setup
1:41 Set NumCustomDataFloats
2:04 Apply random colors
2:59 Apply specific colors to specific instances
3:34 Apply colors later than at creation time
4:23 Quick recap
5:13 Outro & Patreon Wall!
#UnrealEngine #UE4 #UE4Tutorial
How To Set Material Parameters On Instance Mesh Components - Unreal Engine Tutorial

Наука

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

 

9 июл 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 39   
@Sluggernaut
@Sluggernaut 4 месяца назад
OMG I have been trying for 3 days to figure out why changing parameters on individual instances wasnt working. I had to use the PerInstanceCustomData stuff in the material! Thank you!
@jbbird3548
@jbbird3548 Год назад
ooo this'll blend well with the other series, thanks!!
@robinj6997
@robinj6997 6 месяцев назад
oh... my... god! The amount of insanity I can do with this! Thank you!
@MichaelRoyalty
@MichaelRoyalty 10 месяцев назад
Thank you so much for this tutorial. I'm using this method to dynamically modify meshes spawned with the PCG tool, it works great!
@AlexQuevillonEn
@AlexQuevillonEn 10 месяцев назад
Awesome!
@DeeOdzta
@DeeOdzta 2 года назад
This superb! Thanks a lot for sharing this method. new sub.
@AlexQuevillonEn
@AlexQuevillonEn 2 года назад
:D
@Mantikator
@Mantikator Месяц назад
Thank you so much!
@vitaliikhomenia202
@vitaliikhomenia202 Год назад
Thanks. Was looking for way to set up different texture per instance :)
@AlexQuevillonEn
@AlexQuevillonEn Год назад
Glad it helped! :D
@mordormetin
@mordormetin Год назад
Clean..
@Max_Stupa
@Max_Stupa 7 месяцев назад
Thanks for the explanation. I have only one question. You mark the render state dirty after setting parameters for each instance. From the performance side, if we have a lot of instances for one ISM, it may be much more efficient to mark render dirty once. Or do you think we should do it strictly for each instance?
@AlexQuevillonEn
@AlexQuevillonEn 6 месяцев назад
I think you can just do it once at the end. I just used the lazy route :P
@DigitalGreenTea
@DigitalGreenTea 3 месяца назад
Sometimes the Set Custom Data Value fails. Then that specific instance is just black. I checked this with the return boolean. I wonder why it fails at times?
@AlexQuevillonEn
@AlexQuevillonEn 3 месяца назад
That's actually something I never looked into, but yeah, it's a bit unstable. Even in newer versions of Unreal
@dieblauebedrohung
@dieblauebedrohung Год назад
That's pretty awesome. But do you think there's a way to do it with actual textures, so that a single object can have more than one color (or just... a texture)?
@AlexQuevillonEn
@AlexQuevillonEn Год назад
You can always have multiple textures in your material and switch between them with a LinearInterpolate. Which you can control with the CustomData :)
@dieblauebedrohung
@dieblauebedrohung Год назад
@@AlexQuevillonEn you can only set them up once then though, and switch between existing ones that way (if it's inside the Material). You can't actively set a variable amount of them in your blueprint that way I guess?
@AlexQuevillonEn
@AlexQuevillonEn Год назад
@@dieblauebedrohung Exact, but you can change the textures with blueprints. But keep in mind that changing material parameters (not CustomData) will affect all the Instances.
@dieblauebedrohung
@dieblauebedrohung Год назад
@@AlexQuevillonEn yeah excactly. That's the problem I face rn. Trying to assign a variable amount of textures randomly to thousands of [different] objects without getting additional draw calls for each texture re-use. Thank you for your quick response thougj! :)
@TheAxebeard
@TheAxebeard Год назад
@@dieblauebedrohung Did you ever figure this out? I'm using a Texture Atlas and *attempting* to use the Custom Data to change the U and V coordinates of the texture, which should work in theory, but I can't actually get Custom Data to update in real-time in UE5 for some reason.
@danielso644
@danielso644 Год назад
Hello Alex, do you think it’s possible to edit vertexes of specific instances meshes with geometry script or otherwise?
@AlexQuevillonEn
@AlexQuevillonEn Год назад
You mean moving the vertices around? I don't think it's possible. But, you probably can add a WorldPositionOffset (with a mask) in the material to offset the vertices you want.
@danielso644
@danielso644 Год назад
Ah okay well that’s unfortunate, will have to look into world position thanks for the response.
@dmnyktv2739
@dmnyktv2739 7 месяцев назад
Is there a way to break a texture down to float value to do this ?
@dmnyktv2739
@dmnyktv2739 7 месяцев назад
Tryna get custom data to work with the RGBA of. A texture so it can choose a texture based on height
@AlexQuevillonEn
@AlexQuevillonEn 7 месяцев назад
@@dmnyktv2739 I don't think it's possible (at least, not easily). The only suggestion I have would be to add all the textures you need directly in the material and then switch between them based on a Scalar Parameter. (With something like a Lerp or an If)
@dmnyktv2739
@dmnyktv2739 7 месяцев назад
@@AlexQuevillonEn surprisingly I got it to work using a switch node with the textures plugged into it then a custom data value running into the switch value with the custom data value being changed per height level took me hours to figure out but it's actually quite simple One major downside tho the textures don't blend together they tile weirdly due to it being applied to sperate meshes I gotta figure out a way to have it set to nanite and still use custom data maybe primitives?
@dmnyktv2739
@dmnyktv2739 7 месяцев назад
@@AlexQuevillonEn just figured out a fix for it while using custom data values you csnt have nanite and instances static mesh both on so instead use a scalar paramater called texture connect that into the switchvalue with the textures connected to the switch create a dynamic material instance in your construction script of your actor your trying to change the texture of dynamically then add a sequence with the height conditions setting a float value using the values of the switch textures you want per height then connect each of the branches exec pins into a set scalar paramater node connected to the create dyanmic material node with a set material node right after setting your mesh to that dyanmic material or texture based on height conditions no need for custom data values and no tiling issues 🙏
@user-ro1su4ii4w
@user-ro1su4ii4w 8 месяцев назад
not find out the "num cuntom data floats" in ue5.3😭
@joeymalta749
@joeymalta749 Год назад
Is it possible to do this with a texture aswell ?
@AlexQuevillonEn
@AlexQuevillonEn Год назад
I don't think so :/ But you could always either - have both textures in your material and switch between them using the float parameters. - or have an atlas of textures and choose which one you want.
@dmnyktv2739
@dmnyktv2739 7 месяцев назад
Maybe if we could somehow store different rgb values of materials with just a base texture like grabbing the texture rgb values then inputing them into the custom data value with a condition set up for choosing while using a texture sample instead of color coords for the rgb input in the material blueprint
@dmnyktv2739
@dmnyktv2739 7 месяцев назад
I can't figure out how to grab rgb values from a texture or material variable in blueprint tho I've seen it done before but don't know how that's the only thing stopping me
Далее
UE4 Optimization: Instancing
28:34
Просмотров 147 тыс.
Кто то встречал их на улице?
00:59
Телеграмм-Колян Карелия
00:14
Просмотров 125 тыс.
Per-Instance Random | 5-Minute Materials [UE4/UE5]
5:51
No more Texture Repetition (UE4, valid for UE5)
10:30
BOOST Foliage Performance In Unreal Engine
5:09
Просмотров 102 тыс.