Unreal Engine 5.2 PCG - Short Ep 1 - Sampling on any static meshes

  Рет қаралды 10,733

Adrien LOGUT

Adrien LOGUT

Күн бұрын

Testing a new format to learn specific uses of the Procedural Generation Content plugin in UE 5.2.
This first short video talks about how we can sample on something else than a landscape.
DISCLAIMER: This plugin is still in experimental mode, to learn more about Experimental, see: "docs.unrealengine.com/5.1/en-US/experimental-features"
Low-poly trees from "Aditya Graphical":
sketchfab.com/3d-models/low-p...
I tried to add a subtle background music, give me your thoughts if it is distracting or helped cover the blanks.
Music from #Uppbeat (free for Creators!):
uppbeat.io/t/adi-goldstein/i-...
License code: 21JS4OUE2EFJWDJJ
My twitter if you want to be notified for future videos: / amathlog
Link to tutorial in Epic Dev Community: dev.epicgames.com/community/l...
0:00 Introduction
0:46 Sampling on hand-placed meshes
2:43 Sampling on procedurally generated meshes
3:55 Importance of order of execution
5:13 Notes on collision channels
6:54 Sampling on bottom of meshes
9:22 Limitations of the World Ray Hit Query node
9:46 Outro

Пікірлер: 72
@alyxlarsen2144
@alyxlarsen2144 21 күн бұрын
Thank You!!!!! I have been looking for this for hours!!
@ianchristensen8116
@ianchristensen8116 10 ай бұрын
I like the format. Looking forward to more of these!
@mihaiwilson
@mihaiwilson Ай бұрын
Thanks so much, didn't realize these features had been added - super useful.
@Yarogor
@Yarogor 10 ай бұрын
THANK you! That help me a LOT.
@Arlski
@Arlski 4 ай бұрын
Thank you!
@as2onish
@as2onish 10 ай бұрын
Great video! I like this style, the way you walk through the potential problems/gotchas. Only feedback, you mentioned in 5.3 there will be a different way to do a dependency. It would have been nice to at least get a sentence about how that will work. It would make the useful lifespan of this video a bit longer.
@adrienlogut3482
@adrienlogut3482 10 ай бұрын
Right! It will be the Gather node there will be an extra pin
@MMALAB
@MMALAB 6 ай бұрын
Great video, I've learned so much. I have a question, in my ue5 project I have a house -a mesh, imported from blender and I use PCG to generate grass on a landscape. I can't figure out how exclude grass, because it is inside the house as well.
@adrienlogut3482
@adrienlogut3482 6 ай бұрын
Check my other video :) kzfaq.info/get/bejne/f6tpeNmbmtnZiXU.html
@mafiaBG
@mafiaBG 4 ай бұрын
This stacking is amazing! Is it possible to use this method to draw splines and have them spawn meshes on top of an existing, same blueprint spline? Let's say I use a spline to spawn boxes, and I want to use the same spline 10 times, to spawn boxes on top of already spawned boxes. Is this possible? Can you make a video for this? Thanks!
@goncalosoares8483
@goncalosoares8483 10 ай бұрын
Awesome, could you make one on how to use attributes to override nodes' properties. Like how to select an actor based on attributes
@adrienlogut3482
@adrienlogut3482 10 ай бұрын
That's not really possible in 5.2, at least not without manually add Spawn Actor nodes for each different actor you want to spawn. It will be possible in 5.3 though.
@HappyCamper1206
@HappyCamper1206 10 ай бұрын
​ @adrienlogut3482 Is this currently possible in the 5.3 preview or is this something that will be possible in future 5.3 updates? And if it is currently possible could you point me in the direction of how that can be achieved?
@tmaintv
@tmaintv 7 ай бұрын
This is a great way to do videos. Really helpful and smart. I’d like to ask if you have any advice on combining the ray cast with the texture sample node at all. I have got both elements working but not together as of yet. Any advice would be appreciated
@adrienlogut3482
@adrienlogut3482 7 ай бұрын
Hi! I don't think you can use the world Ray hit query node as is on a texture. On a simple case, let's say you have a square with the texture in your world and you use the world Ray hit query. If you know the size of your texture, you can transform the position of the points sampled between -1 and 1, like texture UV and then use the projection node with the texture as projection target.
@tmaintv
@tmaintv 7 ай бұрын
Thanks, that makes sense. I’ll keep trying and report back if I have any luck
@eris4196
@eris4196 2 ай бұрын
@@tmaintv Hey! Could you figure it out?
@tmaintv
@tmaintv 2 ай бұрын
⁠​⁠@@eris4196I haven’t got back to it I’m afraid. I believe it is possible but haven’t had a chance to work on it again yet. If I do I’ll let u inow
@eris4196
@eris4196 2 ай бұрын
@@tmaintv thank you!
@user-nb3kg9hk8x
@user-nb3kg9hk8x Ай бұрын
5.4 World Ray Hit Query Override Default Params => Set Ray Parameters
@je_architektur
@je_architektur Ай бұрын
Great video, it's a good introduction to pcg. I have a question about a scenario like the first example. I have hand placed static meshes on a very large area, and I want to place grass on them, using a tag filter. Unfortunately, the problem is that apparently all points are sampled in the background and then filtered so that only those on the static mesh remain. To replicate i have a cupe with tag, the tag filter in the world ray node an (my densidy is quite high with about 30 objects on the cube. When the pcg is scalled, there are still 30objects but at one point i have an error that more than 300.000.000 points are generated and it crashes.
@adrienlogut3482
@adrienlogut3482 Ай бұрын
Indeed the surface sampler will generate a grid on the top of the volume then project them, and keep the point if it hits something. So yeah, it's not practical in your use case. You might be better off having a custom actor with your static mesh and a PCG component on top, with some bounding box. With this the generation will be constraint to the mesh, and not the whole world. Or use a Get Actor Data on all world actors to get all your meshes positions and generate only in this location, but that's a bit more complex :)
@user-vi6je4vv9l
@user-vi6je4vv9l 10 ай бұрын
good
@Megallean
@Megallean 9 ай бұрын
So for the scattering meshes overtop of scattered meshes like in 2:43, I can't seem to get a method that works in 5.3. The Gather node doesn't seem to work as a dependency, regardless of how I plug things into it or what settings are used. I noticed in the Electric Dream demo, they do have an example that does use it, but it just seems to work somehow? Pulling it apart doesn't reveal how it works. I'm trying to get points that have already been generated re-projected overtop of ground meshes that another branch of nodes spawn. And I'm struggling to find out how to do that.
@adrienlogut3482
@adrienlogut3482 9 ай бұрын
You can join discord.com/channels/187217643009212416/1089670031782191145 and post your issue there, tag me (@thelonelychaman) so we can have a look!
@SagunManandhar
@SagunManandhar 9 ай бұрын
Hi, is it possible to instance geometry in animated alembic geo ? ????
@adrienlogut3482
@adrienlogut3482 9 ай бұрын
We have external alembic support in 5.3, but I don't know how it handles animated stuff though :(
@lazycuyo1606
@lazycuyo1606 9 ай бұрын
I tried to sample on hand placed meshes just like in your example but mine is ignoring the meshes, I put 4 sphere meshes, is there something i'm doing wrong? Useful tutorial by the way
@adrienlogut3482
@adrienlogut3482 9 ай бұрын
Probably because of the collision presets! Make sure it matches!
@JamesBeukelman
@JamesBeukelman 7 ай бұрын
@@adrienlogut3482 I'm having the same issue. Not sure about the collision preset as I'm just working with the default cube and hand placed it in the world. I'm using 5.3 and I'm wondering if it's bugged. Have you tried to recreate this in 5.3? Thanks for the tutorials btw, love them.
@adrienlogut3482
@adrienlogut3482 7 ай бұрын
@@JamesBeukelman Just tried it in 5.3. Placed a Cube, a PCG Volume encapsulating the cube. Then World Ray Hit + SurfaceSampler + Debug gives me the right result ^^
@janavram5948
@janavram5948 6 ай бұрын
got the asme issue and got frustrated, because these comments could not help either... but it is probably simple, select ur PCGVolume in the editor top. Here in video it is PCGVolume3... hope that helps
@sechygs
@sechygs 3 ай бұрын
@@janavram5948 I was having the same issue. My problem was that the Point Extents were too big (100 by default), so it didnt spawn anything. My meshes were smaller, so putting values like 5 or 10 worked!
@anotherreality7951
@anotherreality7951 3 ай бұрын
is it possible to combine static mesh blueprint with PCG ?
@adrienlogut3482
@adrienlogut3482 2 ай бұрын
Yes, you can use the Spawn Actor with Collapse Actor, it will extract the static mesh component from the actor. Or you can even spawn as a normal actor, with the no merging option, but it will be slower if you have a lot of them.
@romank3157
@romank3157 9 ай бұрын
Ok, now generation on spawned PCG meshes works well with "Gather" node in 5.3. But, I have a question. How do you use "Bounding shape" pin of the surface sampler with world partition? It seems that if you try to feed anything in it, for example - a set of points, defined by the spline, it creates duplicates of all the points generated by the surface sampler within that bounding shape for each PCG partition actor. Is this a bug? Or just the way how surface sampler works with world partition? Beacuse it looks like, by default, it uses the bounds of each partition actor.
@adrienlogut3482
@adrienlogut3482 9 ай бұрын
By default it will indeed use the bounds of each partition actor. But if you feed anything else, it will use it and that's your responsibility to make sure that this bounding Shape is the intersection between your data and the bounds of the partition actor (which you can get with GetActorData with self)
@romank3157
@romank3157 9 ай бұрын
@@adrienlogut3482 Thanks, that's worked! Actually, already figured that out after watching previous video.
@romank3157
@romank3157 9 ай бұрын
​@@adrienlogut3482 Another question: is there a way to diable pcg nodes execution if there are no data in the input? It seems that when pcg partionion is turned on, it creates partiton actors within original actors bounds, and executes the whole node network for each partition actor, even if there are no sampled points (so, the log is full of errors - "no data on pin...."), and its still takes a lot of time to execute those "empty" graphs.
@adrienlogut3482
@adrienlogut3482 9 ай бұрын
We are working on that. Right now we have to spawn all the PA before generating because we cannot spawn them at runtime. As for empty data, we are tuning those warning down as empty data might be a valid case (especially in partition)
@romank3157
@romank3157 9 ай бұрын
@@adrienlogut3482 Makes sense. So now, if we want to use partition, we should use multiple PCG actors and carefully set their bounds? (otherwise it will take forewer to generate and most likely eat up all available RAM and crash) At least, maybe there is a way not to use 3d partition grid if we ever want to use partition and sample points on anything other than the landscape (with world ray hit query)? Beacuse now, it seems it's the only way for surface sampler to work on collision channel for partitioned PCG actors. And 3d grid generate a LOT of partition actors, if the sampled surface have height variation, most of them will be empty, but still calculated.
@user-tb3qj3ih4y
@user-tb3qj3ih4y 10 ай бұрын
你好,请问为什么我的网格体采样不生成点呢?步骤都没错的,哪里出问题了呢?
@adrienlogut3482
@adrienlogut3482 10 ай бұрын
Sorry doesn't speak Chinese so I've used Google Translate. I try to give people as much info so they can trouble shoot if something doesn't work. Important to check the order of execution, collisions presets and boundaries.
@lesan001
@lesan001 4 ай бұрын
how would i go about spawning around a hand placed mesh?
@adrienlogut3482
@adrienlogut3482 2 ай бұрын
Get Actor Data allows to gather actors in the world, so you could tag your hand place meshes and use their positions to generate stuff around.
@ArtfulSem
@ArtfulSem 2 ай бұрын
how to change execution queue in 5.3 ?
@adrienlogut3482
@adrienlogut3482 2 ай бұрын
I imagine you refer to the order of execution? If so, It's the Gather node, you can plug data that is needed for dependency but doesn't need to be used with the Dependency Only pin on the Gather node.
@sincosFly
@sincosFly 9 ай бұрын
How can i to combine with Spline?
@adrienlogut3482
@adrienlogut3482 9 ай бұрын
Depends on what you want to do, but you can project your spline on this abstract surface too :)
@sincosFly
@sincosFly 9 ай бұрын
@@adrienlogut3482 I want to limit PCG area by spline. Not by PCG volume.
@adrienlogut3482
@adrienlogut3482 9 ай бұрын
Spline sampler on interior to use as an intersection with all your sampling.
@sincosFly
@sincosFly 9 ай бұрын
@@adrienlogut3482 I know.... but i have try load PCG graph by Blueprints actor... this tuts is not working.
@adrienlogut3482
@adrienlogut3482 9 ай бұрын
Not sure what your problem is then, you can come ask it in the discord channel with an explanation of what you are trying to achieve and some screenshots/videos: discord.com/channels/187217643009212416/1089670031782191145
@user-fm9zo5le2v
@user-fm9zo5le2v 21 күн бұрын
Can you control the number of points somehow?
@adrienlogut3482
@adrienlogut3482 20 күн бұрын
If you use the surface sampler you can play with the extents, looseness and points per squared meter
@user-fm9zo5le2v
@user-fm9zo5le2v 20 күн бұрын
@@adrienlogut3482 Thanks. But I need an exact number of points. This number will be passed from the parent blueprint. Mesh Sampler allows that through Poisson sampling: you can set max points. Don't know why they didn't put that in Surface Sampler too.
@adrienlogut3482
@adrienlogut3482 20 күн бұрын
Nothing prevents you to filter the points afterwards so you extract just a specific number of points. I have another video to select a exact number of points with a Blueprint node. And we implemented the native version of it, just that it didn't make the cut for 5.4. By essence the surface sampler is a stochastic sample, so that's why there is no fine control like that on the node. Also being a multi threaded node + the fact that you can have a complex bounding Shape makes it impractical to have a max number of points.
@user-fm9zo5le2v
@user-fm9zo5le2v 19 күн бұрын
@@adrienlogut3482 Yeah, but what if I have thousands of PCG volumes in the level? Will there be performance issues to do all those calculations on each, just to get a specific number of points? Seems like an expensive work-around.
@adrienlogut3482
@adrienlogut3482 19 күн бұрын
Indeed but that always depends on what you want to do and when it happens. If it's generating offline, it matters less than if it generates at runtime. You can also optimize it yourself to play with the points per squared meter depending on the size of the volume. But it's also not always a good idea to over optimize at the beginning, so try it out and see if the performance is good enough for you.
Unreal Engine 5.3 PCG - Ep 5 - Parameters and runtime execution
21:47
Can You Draw A PERFECTLY Dotted Line?
00:55
Stokes Twins
Рет қаралды 106 МЛН
아이스크림으로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 52 МЛН
MEGA BOXES ARE BACK!!!
08:53
Brawl Stars
Рет қаралды 36 МЛН
You Should Start Using Data Assets in PCG | UE 5.4
20:14
Procedural Minds
Рет қаралды 2,8 М.
Unreal Engine 5.2 PCG Tutorial - Texture to Landscape
11:08
Michael Royalty
Рет қаралды 7 М.
10 Minutes vs. 10 Years of Animation
19:29
Isto Inc.
Рет қаралды 614 М.
Unreal Engine 5.4 PCG - New Features Ep 1 - Array of meshes
14:39
Yes, You Can Sculpt Landscape With PCG
17:19
BoroCG
Рет қаралды 51 М.
Why Unreal Engine 5.4 is a Game Changer
12:46
Unreal Sensei
Рет қаралды 1,1 МЛН
Spawn Props on ANY Shaped Table Using PCG | Unreal Engine 5
12:31
Procedural Minds
Рет қаралды 4,4 М.
skibidi toilet zombie universe 34 ( New Virus)
3:35
MonsterUP
Рет қаралды 3,6 МЛН