Community Tutorial: Introduction to Procedural Generation plugin in UE5.4

Just a random question from an Environment Artist:

Would it be possible to alter the landscape underneath of PCG points? Aka raising the landscape underneath bigger trees to simulate roots that bump the surface a little?

Right now no, there is no Landscape edition possible with PCG. Landscape is read only

You can now with the final version of 5.2 :slight_smile: Graphs parameters and Parmeters Override are available on Graph Settings and in the PCG component detail view respectively.

1 Like

We have not used any scripting language to create PCG graphs yet, but we plan to investigate that at some point to help us automate testing in some cases. Right now, Iā€™m not sure thatā€™s even possible without some tools on our end.

You can use the ā€œCreate Splineā€ node. I think it made it through for 5.2, but Iā€™ll have to check.

1 Like

Texture sampler is not that much documented, making it a bit hard to understand what is going wrong.
It only supports a very small subset of texture format and is not available at runtime either it seems.

hm could you possibly take a look at my query about the situation Heres the link thank you for taking the time out of your day to respond :slight_smile:

Link:
Having Trouble Spawning Spline Actors With PCG - Programming & Scripting / Blueprint - Epic Developer Community Forums (unrealengine.com)

You should generate static meshes by script for this.

Iā€™m trying to figure out how to control my foliage based on Landscape Layer material. If Iā€™m using a grass layer, I want to be able to spawn different assets from, if I was on a forest layer or an undersea later. Is there any way to do that right now, or should I just stick to the Procedural Foliage Spawner?

@AdrienLogut I found a very annoying bug with the DensityFilter node.
I tried to filter nodes from spline distance, but if the point is touching/too close to the spline, the filter simply drops itā€¦
For a hacky workaround, I have to invert the filter.
I suspect, it is an > typo instead of >= in the code.


Hack:

Iā€™m experiencing this same issue in 5.2.
When filtering points by landscape layer name attribute, there seems to be some kind of offset / skewing going on.

Edit:
Seems that itā€™s broken on landscapes with 2x2 ā€œComponent Subsectionsā€ but appears to work on landscapes with 1x1 component subsections.

2 Likes

Interesting, thank you! I think I read something about it earlier in the thread but were you looking into options for accessing the static mesh input through blueprints?

@AdrienLogut Hi! Thanks for the Youtube series!
I wanted to ask if thereā€™s a way to simulate blueprint branches in PCG, for example using a boolean from GetActorProperty() to enable or disable certain branches.

In this case I tried passing ā€œEnabledā€ as attribute name but as I expected it doesnā€™t work:

I also would like to understand how the Boolean and Compare node work in PCG:
image

Thank you in advance!

Yep, works with a landscape set to 1x1 components. Though i had to delete the pcg volume and re-add it after deleting the old landscape with 2x2 components and adding the new one with 1x1.

1 Like

@AdrienLogut maybe the strange landscape layer sampling on landscapes with 2x2 component subsections has something to do with this?:

PCGLandscapeCache.cpp

around line 700:

const FIntPoint ComponentMapKey(FMath::FloorToInt(LocalPoint.X / LandscapeInfo->ComponentSizeQuads), FMath::FloorToInt(LocalPoint.Y / LandscapeInfo->ComponentSizeQuads));

What do you think?

I tried to submit a bug report about a week ago but it seems it vanished into the netherā€¦ I havenā€™t seen anything related to PCG show up on the unreal bug tracker.

1 Like

Thanks for the investigation! I have one colleague that is on the problem! Should be resolved in 5.3.

1 Like

Itā€™s not a bug, itā€™s by design. The filter drop points with 0 density.
To alter that, so a density remap just before, between 0.001 and 1.

2 Likes

Boolean and Compare operations are operations on attribute/properties. You can for example compare the X position from a point data with a constant using the Compare node, with Input Source 1 = $Position, and the constant pluged with an create Attribute like you already have tried.

To simulate branches, you can try to do a Point Filter on an attribute, that could be set in advanced by an actor property, or a graph parameter.

If you want something a bit more flexible, with more options, you can create your own BP that takes a parameter as input (could be a bool, int or enum) and your point data, and output only on one output pin, depending on the parameter value :slight_smile: Thatā€™s a bit more advanced stuff though, but I will try to make a video with blueprint customization. That might be one simple example I could showcase.

2 Likes

Thanks @AdrienLogut :slight_smile:
Bit more info / investigation here:
UE-187192 ā€œPCG Graph on 2x2 Landscape incorrectly displays weight on paint layersā€ - General / Issues and Bug Reporting - Epic Developer Community Forums (unrealengine.com)

2 Likes

Hey Adrien,
Iā€™m wondering Iā€™m workign with PCG now and when I try to use it Partitioned with WP, it only generates the meshes around certain spaces on my mapā€¦
In the Screenshots, you see as a whole vs. Partitioned.
Anything Iā€™m missing? When I try a PIE play the empty spots are not loading with trees either. (With partitioned the open spots happenw ith both the Genertate on Load and Generate on Demand)

I wish there was some more information available on World Partition and usage, but I also understand that this whoel technology is super new so yeah. :stuck_out_tongue:

Hope you have some tips! :smiley: