x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Bug: Landscape Grass Takes Forever To Load

Heya,

I've tried getting help for this on the forum, which didn't quite work out well. Thus, I am hoping someone here might be able to assist me, as I've tried everything I can think of at this point.

As per my findings in the forum thread: Changing the grass mesh and using a lower density didn't do anything (My density is 250, grass mesh has ~40 triangles). This is definitely some sort of engine bug because while not playing inside the editor the grass loads just fine. I could literally be at the start point with the camera, with the grass all there, and when I hit play, the grass would clear and very slowly load back in. As soon as I stop play it'll load up instantly.

Product Version: UE 4.9
Tags:
more ▼

asked Oct 06 '15 at 08:48 AM in Bug Reports

avatar image

DamirH
589 22 23 41

avatar image AndrewHurley Oct 06 '15 at 02:16 PM

Hey DamirH,

In order to assist you with this issue I am going to need a bit more information as to the steps you are taking.

  • Would you provide me we some simple steps to reproduce this issue in a blank project?

  • Would you provide me with some screenshots so I can visualize the issue you are experiencing?

  • You mention, "I might be wrong, but I think this started in 4.9". Would you be able to test and confirm this does not occur in the 4.8.3 engine version?

  • Could you provide me with your 'dxdiag' so I can take a look at your systems specifications?

If you discover any new information on this issue, or if you have further questions please let me know.

Thank you,

Andrew Hurley

avatar image DamirH Oct 07 '15 at 03:14 PM

Hey Andrew,

Sorry for the delayed response, been at home with a fever today unfortunately. Interesting development though! I did manage to reproduce the issue very simply on multiple PCs, even my i74-4770k with a GTX780 takes ~10 seconds to load it all. I can also confirm that it DOES happen on 4.8.3. These are the reproduction steps:

Create a landscape with the following settings:

alt text

Create this landscape material and apply it:

alt text

The only notable thing about the material are the grass types. It doesn't have to be 4, but I'm trying to match my real project environment. Now, most of the settings in the landscape grass assets remains at their default settings. The only changes are these:

  1. The mesh is set to anything. It doesn't matter what.

  2. The density is dropped down to ~20 on each.

  3. The fourth one (or any one really) has at least 5 variations, each of which uses a different mesh and a density of ~20 each.

With these in place play at various positions on the landscape. Note that it all loads instantly.

And now for the big bang: Reduce the landscape scale to 25x25x100. Play somewhere at the midpoint. Observe how the grass tiles slowly creep towards you.

Incidentally, dropping all but the first variation of the 4th grass asset will make it load up instantly (or at least much faster) again.

I hope this is enough to replicate it. Thank you for your time!

avatar image AndrewHurley Oct 10 '15 at 05:26 PM

Hey DamirH,

Your process is different than that of the suggested workflow. The Landscape material using the procedurally placed foliage, needs to Sample one of the layers of my landscape material in order to apply it correctly.

In the screenshot below, you can see I have created a simple Layer Blend for my landscapes material, and then added the Grass type node with the four unique inputs.

alt text

alt text

Each sample then can contain its own 'GrassType' (collection of foliage meshes) to be applied to a specific landscape layer. It seems you are compiling all of your meshes on the same layer, and could be experiencing all of the cull distances and Level Of detail changes of each mesh. You will want to edit these values to get your meshes to render correctly at the appropriate distance to the camera. Also scaling your Landscape non uniformly is going to cause all sorts of problems and is not recommended.

If you have any questions let me know.

Thank you,

Andrew Hurley

avatar image DamirH Oct 10 '15 at 05:59 PM

Hey Andrew,

My production material does sample layers, the above setup is just for testing purposes, it makes no difference. The big culprint is the landscape scale, as I have noted in my reproduction step. You can take your landscape, assuming it's set to the same settings as I noted in the repro steps, and set its scale to 25x25x100 and you will see the problem.

Best regards, Damir H.

avatar image DamirH Oct 10 '15 at 06:47 PM

Sorry but with all due respect this is not the solution. I've tried this a dozen times on half a dozen PCs - it's a bug, the draw calls go up tenfold with the SAME material on the SAME terrain with just the terrain scale being changed. If what you suggest is the culprit I'd see the fps drop right off the bat, without changing the terrain scale.

I feel like you haven't honestly even read the reproduction steps.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I did read your repro steps, and tried to respond by letting you know that your workflow is incorrect, therefore you are going to experience some issues. Scaling your landscape, especially one the size of 32x32 and with all of your foliage placed on the same material layer, with those densities is definitely going to cause an issue.

Scaling your landscape is not suggested, as it will cause all types of errors. It is best to create the correct scale at the beginning and stick with that. Here is a post that will shed some more light on this.

Changing Landscape Scale

https://answers.unrealengine.com/questions/22090/changing-landscape-scale-problemsglitches.html

As for the load times of your foliage, this is also mentioned in our documetation and is expected. Especially with the test set up you have provided as all of your meshes are being spawned on the same material layer.

Using the Grass Tools

https://docs.unrealengine.com/latest/INT/Engine/OpenWorldTools/Grass/QuickStart/4/index.html

alt text

If you have further questions, let me know.

Thanks,

Andrew Hurley

more ▼

answered Oct 10 '15 at 09:00 PM

avatar image DamirH Oct 10 '15 at 10:59 PM

Hey Andrew,

As I said, my "real" terrain doesn't put all the meshes everywhere, it samples layers. The behavior is absolutely identical. The loading I am seeing is definitely not the expected behavior as it loads up instantly unless the landscape is scaled down. (It also happens on a packaged build, not in the editor during painting).

However, I see that landscape scaling causes glitches so I'll see to it to rescale the height map to get the right scale right away.

avatar image ambientenergy Jun 27 '17 at 09:55 AM

This is for anyone who is still having trouble with this issue :

Short Answer : You need to call 'UpdateGrass' on the landscape proxy actor with bForceSync = true to make all the grass get created at once. This is not available from blueprints, you're going to need to import that Landscape module and do it in C++.

Long Answer : The grass is created on a per-landscape actor basis and each frame the grass actor queues up a certain number of subcomponents to have their meshes generated at runtime. The number of tasks it can queue each frame is 4, but regardless is only pops one async tasks off its finished queue each frame. Basically the larger your landscape in terms of components, the more frames it'll take to render regardless of how dense the foliage is on the landscape.

To understand this go check out 'LandscapeGrass.cpp' in the 'UpdateGrass' method. You'll find that if bForceSync is set to true that it'll make sure to queue up all tasks and wait for them to drain. Otherwise in the queuing logic it checks the 'AsyncFoliageTasks' array against the async task counter to queue logic, and at the very bottom of the function it pulls tasks off (and has nice little comment about how 'one per frame is fine').

I'm on version 4.16 and before I finish playing on the first frame I make sure that I call this method and all my grass instantly spawns in.

avatar image dvd.kh Oct 04 '17 at 05:23 AM

is it possible to do this by modifying Landscape.cpp to instantly loading grasses when creating landscape or loading scene as default?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question