This works in 5.4 tested but note, i had a bug where within pcg graph in copy attribute node UV.Y to UVX and UV.Y to UVY after entering this in input source and output target it did not read UVs, but after clearing fields, force regen, then reentering values and forcing regen it was able to read the UVs correctly. It displayes colors from texture in viewport however warning that says input does not have UV attribute inside pcg graph copy attribute nodes is still there... Thank you very much for this amazing tutorial!
Hi Michael, this was a great tutorial, in my use case I need to have the points aligned with the dynamic mesh (I'm not making golf-ball-world), any thoughts on how to accomplish this?
Thanks a lot for this amazing tutorial ! I have a question: Is it possible to get points inside the chosen mesh and not only on surface (I'm trying to carve voxels inside the mesh) ? If yes could you give me a logic to how doing that. Thanks a lot again!
This is the most in depth tutorial on texture data. Thanks! I want to get moss to spawn everywhere in a PCG volume based on a certain texture but not sure if that filter operation exists. Is this something that can currently be achieved with PCG?
I'm also working on a moss generator! Would it be possible to get the vertex color information from multiple assets in the scene to place the points there and nowhere else?
Hi, thanks for the tutorial, it's really useful for my case which is to read my custom floor mesh to spawn foliage on it. Others tutorial is mostly for landscape so this is really helful! I have question, I think in this tutorial in BPCG component blueprint is using default One Point Per Triangle sampling Method? Is it possible to change it using Poisson Sampling? I tried playing around in BPCG Component Blueprint to find it but couldn't figure it out my self, thanks!
I think the dynamic mesh sampler might be using Poisson Sampling by default. Try changing the sampling options (7:30 in this video). I can take the basic Engine/Shapes/Cube, and setting the sampling radius down to 1 gives me a ton of points on it.
Thank you for reply! Yes I thought it's strange that sampling options settings is indeed similar to when using Poisson Sampling, but somehow it's end up looking different when using dynamic mesh sampling and directly using Mesh Sampler in PCG graph using same Static Mesh. I tried to compare it side by side and indeed it is looking different, maybe had to do with seed? but I'm not sure, the one coming from dynamic mesh sampler is kind of "too uniform" if that make sense, haha In the end I'm kinda using both, after enabling "PCG External Data Interop" plugin (I forgot to turn this on previously) I could override static mesh used in Mesh Sampler, this is to spawning the foliage, and the one from dynamic mesh sampling is used to get texture color from mesh UV Thanks again for this tutorial! @@MichaelRoyalty
great work! really helpful to me! Besides,is there a way to sample the uv texture into rgb color for each generated point ? What I need is (x,y,z,r,g,b) for points on the mesh surface, could you please give me some instructions about how to sample the pointcloud like that? I searched all the tutorials but found none. Thank you very much
Thanks, glad it's useful! Near the end of the video I show how to sample the alpha channel for height. You should be able to sample the r g and b channels in the same way.
Thanks, that's working. And I meet a problem that the material of the mesh uses more than one texture. What should I do with that to get the color as it looks like? Can I get the needed data directly from its material instead of texture?
The instanced static meshes you've spawned? Yes, it's possible -- I've made a scriptable tool that lets me click on an instanced static mesh, and it converts them to static meshes. Then in the modeling tool I can Union or Merge all meshes together. These steps take a while, since I'm working with a lot of meshes. I feel like I may have seen a simpler way to do this, but I can't recall for certain.
Hello! Great work and thank you for the tutorial! I am very new at PCG and.. well, even though I followed along, and a lot of what you did made sense in retrospect, I am still quite lost. I was wondering; is it possible to spawn static meshes based on a greyscale mask? Similarly to what you did with the height data. I've been trying my best but.. I don't know, I find the PCG UI to be very confusing and am just not very good at it yet. Would you please be able to give me some tips or pointers? Thank you!
Thanks! This is a slightly more advanced video, which will solve very specific problems. Are you looking for something like this? ruclips.net/video/UeaQxnAV7O0/видео.html
@@MichaelRoyalty Indeed! However, I am not using landscapes, which is the big problem. Every video and guide I have been able to find so far had been on lanscapes and how to sample Physical Materials. But once you remove the Landscape from the equation.. Thanks anyways though!
@@MichaelRoyalty How would you go about doing it? Currently I am being faced with 2 constraints that prevent me from doing what I want. I can't create a dynamic mesh from different blueprint points inside a pcg. And I can't find a way to merge dynamic meshes together from different blueprint actors.
Hey, it's a long time after your last question, but 5.5 adds support for creating and modifying dynamic meshes natively within PCG. It opens up a lot of possibilities!
I believe you can! I have no experience with it but I know someone working on importing animated alembic point cloud information for an export to animation. You'll want to use the pcg data plugin for that.
@@MichaelRoyalty Thank you for quick reply. BTW, Im still new to unreal. When I tried to do there are only options for either static mesh or skeleton mesh. No option to use cached alembic geo. Could you please see ?
It is! After copying the mesh to the dynamic mesh, you can split it by Material IDs and save all of those to an array. You then need to match the materials to each material ID. Then in the PCG Blueprint, you loop through sampling all of the Material IDs.
Just following this tutorial and cannot find a 'Get Typed Inputs' node option in the PCG Blueprint Element when dragging out the Execute input pin. Has this been removed in UE 5.3.2 or am I just being daft?
Try finding it by dragging out the "Collections" pin -- some of these functions are context sensitive, and the execute pin only gives the generic functions.
@@MichaelRoyalty ... thanks for getting back to me. Sadly, "Get Typed Inputs" just doesn't appear, even when I uncheck context sensitive. Either EPIC have made changes or there is something I haven't set earlier. I will see if I can work around it somehow.
If you just need the points from the mesh, you can use the native Mesh Sampler node from the Geometry Script Interop plugin. If you need all that this does, then yeah you can hard code a mesh within the PCG Blueprint instead of getting the data from a parent blueprint.
Probably the main use case would be painting a map on a mesh, and sampling that map to spawn objects. For instance, take a statue and paint a green layer to determine where vines can spawn. Alternatively you could make a Styrofoam world with this technique 😁
Nice! Maybe show how to spawn trees and rocks on a spherical world using PCG?
This works in 5.4 tested but note, i had a bug where within pcg graph in copy attribute node UV.Y to UVX and UV.Y to UVY after entering this in input source and output target it did not read UVs, but after clearing fields, force regen, then reentering values and forcing regen it was able to read the UVs correctly. It displayes colors from texture in viewport however warning that says input does not have UV attribute inside pcg graph copy attribute nodes is still there... Thank you very much for this amazing tutorial!
Praise to Darth Royalty!!
Great work as always!
Thanks!
Thx, really !
Hi Michael, this was a great tutorial, in my use case I need to have the points aligned with the dynamic mesh (I'm not making golf-ball-world), any thoughts on how to accomplish this?
Thanks a lot for this amazing tutorial ! I have a question: Is it possible to get points inside the chosen mesh and not only on surface (I'm trying to carve voxels inside the mesh) ? If yes could you give me a logic to how doing that. Thanks a lot again!
This is the most in depth tutorial on texture data. Thanks! I want to get moss to spawn everywhere in a PCG volume based on a certain texture but not sure if that filter operation exists. Is this something that can currently be achieved with PCG?
Thanks! Glad you like it.
That should be doable. Is your texture on a static mesh or a landscape?
@@MichaelRoyalty Static mesh
I'm also working on a moss generator! Would it be possible to get the vertex color information from multiple assets in the scene to place the points there and nowhere else?
Hi, thanks for the tutorial, it's really useful for my case which is to read my custom floor mesh to spawn foliage on it. Others tutorial is mostly for landscape so this is really helful!
I have question, I think in this tutorial in BPCG component blueprint is using default One Point Per Triangle sampling Method? Is it possible to change it using Poisson Sampling?
I tried playing around in BPCG Component Blueprint to find it but couldn't figure it out my self, thanks!
I think the dynamic mesh sampler might be using Poisson Sampling by default. Try changing the sampling options (7:30 in this video). I can take the basic Engine/Shapes/Cube, and setting the sampling radius down to 1 gives me a ton of points on it.
Thank you for reply! Yes I thought it's strange that sampling options settings is indeed similar to when using Poisson Sampling, but somehow it's end up looking different when using dynamic mesh sampling and directly using Mesh Sampler in PCG graph using same Static Mesh.
I tried to compare it side by side and indeed it is looking different, maybe had to do with seed? but I'm not sure, the one coming from dynamic mesh sampler is kind of "too uniform" if that make sense, haha
In the end I'm kinda using both, after enabling "PCG External Data Interop" plugin (I forgot to turn this on previously) I could override static mesh used in Mesh Sampler, this is to spawning the foliage, and the one from dynamic mesh sampling is used to get texture color from mesh UV
Thanks again for this tutorial! @@MichaelRoyalty
Oh yeah, it's definitely very uniform sampling so maybe it's a different method. I'm glad you found a mixture that worked!
You're welcome!
great work! really helpful to me!
Besides,is there a way to sample the uv texture into rgb color for each generated point ? What I need is (x,y,z,r,g,b) for points on the mesh surface, could you please give me some instructions about how to sample the pointcloud like that?
I searched all the tutorials but found none. Thank you very much
Thanks, glad it's useful! Near the end of the video I show how to sample the alpha channel for height. You should be able to sample the r g and b channels in the same way.
Thanks, that's working.
And I meet a problem that the material of the mesh uses more than one texture. What should I do with that to get the color as it looks like? Can I get the needed data directly from its material instead of texture?
Really useful video, thank you. Do you know if it's possible to convert these objects into static meshes once they have been dynamically generated?
The instanced static meshes you've spawned? Yes, it's possible -- I've made a scriptable tool that lets me click on an instanced static mesh, and it converts them to static meshes. Then in the modeling tool I can Union or Merge all meshes together. These steps take a while, since I'm working with a lot of meshes.
I feel like I may have seen a simpler way to do this, but I can't recall for certain.
Hello!
Great work and thank you for the tutorial!
I am very new at PCG and.. well, even though I followed along, and a lot of what you did made sense in retrospect, I am still quite lost.
I was wondering; is it possible to spawn static meshes based on a greyscale mask? Similarly to what you did with the height data.
I've been trying my best but.. I don't know, I find the PCG UI to be very confusing and am just not very good at it yet.
Would you please be able to give me some tips or pointers?
Thank you!
Thanks! This is a slightly more advanced video, which will solve very specific problems.
Are you looking for something like this? ruclips.net/video/UeaQxnAV7O0/видео.html
@@MichaelRoyalty Indeed!
However, I am not using landscapes, which is the big problem.
Every video and guide I have been able to find so far had been on lanscapes and how to sample Physical Materials.
But once you remove the Landscape from the equation..
Thanks anyways though!
Can you for example have multiple blueprints spawn such actors and then create one dynamic mesh out of everything?
I haven't had any luck converting instanced static meshes to dynamic (or static) meshes dynamically via blueprint, but I don't see why you couldn't.
@@MichaelRoyalty How would you go about doing it? Currently I am being faced with 2 constraints that prevent me from doing what I want. I can't create a dynamic mesh from different blueprint points inside a pcg. And I can't find a way to merge dynamic meshes together from different blueprint actors.
Hey, it's a long time after your last question, but 5.5 adds support for creating and modifying dynamic meshes natively within PCG. It opens up a lot of possibilities!
Love it. ! Is it possible to do this same thing with animated alembic cached geo ?
I believe you can! I have no experience with it but I know someone working on importing animated alembic point cloud information for an export to animation. You'll want to use the pcg data plugin for that.
@@MichaelRoyalty Thank you for quick reply. BTW, Im still new to unreal. When I tried to do there are only options for either static mesh or skeleton mesh. No option to use cached alembic geo. Could you please see ?
Sorry is alembic geo an input or an output? I thought you were speaking of an input. I'm also new to unreal, I just really enjoy the pcg tool
@@MichaelRoyalty Yes, alembic geo as input. and I want to instance spheres in the vertices of the alembic geo.
Is this also possible when the object has multiple materials?
It is! After copying the mesh to the dynamic mesh, you can split it by Material IDs and save all of those to an array. You then need to match the materials to each material ID. Then in the PCG Blueprint, you loop through sampling all of the Material IDs.
Just following this tutorial and cannot find a 'Get Typed Inputs' node option in the PCG Blueprint Element when dragging out the Execute input pin. Has this been removed in UE 5.3.2 or am I just being daft?
Try finding it by dragging out the "Collections" pin -- some of these functions are context sensitive, and the execute pin only gives the generic functions.
@@MichaelRoyalty ... thanks for getting back to me. Sadly, "Get Typed Inputs" just doesn't appear, even when I uncheck context sensitive. Either EPIC have made changes or there is something I haven't set earlier. I will see if I can work around it somehow.
Hm, very strange. You should still be able to use the 5.2 method, where you cast to spatial data then go to point data with context.
Is there a way to do this on just a simple static mesh, without having to place BP's everywhere?
If you just need the points from the mesh, you can use the native Mesh Sampler node from the Geometry Script Interop plugin.
If you need all that this does, then yeah you can hard code a mesh within the PCG Blueprint instead of getting the data from a parent blueprint.
What are some use cases for this?
Probably the main use case would be painting a map on a mesh, and sampling that map to spawn objects. For instance, take a statue and paint a green layer to determine where vines can spawn.
Alternatively you could make a Styrofoam world with this technique 😁