Bug: Foliage "Clipping" In Front of Me
This happens when I paint some Foliage Type, rather than painting a static mesh of the same flower. I would rotate my camera and the foliage would just randomly appear and disappear, as if being culled. It's not material dependent and if I replace the static mesh in the foliage type, it does nothing. No amount of property tweaking did anything.
Anyone got any workarounds? I'd rather not re-paint 5000 instances.
Best regards, Damir H.
Edit 1: Ok, if I right click and hit "Replace with" and plug in a different foliage type, THAT foliage type retains the bug, and even acquires it in already existing types of that foliage, should there have been any. Seems that the "foliage slot" gets bugged.
Hey Logan, the Answerhub was down most of the day so I wasn't able to write an answer - I found the culprint, and I have reproduction steps!
Namely, our game is using world composition. Our title screen is just a streamed level far off onto the side of the global world. Once the player starts the game, we teleport him to the global position of a spawn point, stream the surrounding levels and start the game.
In order for this to work properly, we had to be able to rebase the world origin to make sure that the player ends up placed at the correct location every time, since the automatic world origin rebasing sometimes shifted it around giving us incorrect results.
The solution I made was a very small utility blueprint that would just Rebase the world origin at BeginPlay, like this:
I'd pass in 0,0,0 and it all worked fine!
Enter, the problem.
In order to accommodate quick testing, we have a game mode that skips all the title screen shenanigans and just drops the player pawn right away. We then just hit a right-click and "Play From Here" and do our things. THIS is what caused the foliage to disappear for whatever contrived reason. The moment I turned off the world origin rebasing at the "Play From Here" game mode, the bug disappeared.
So in essence, the bug was caused by rebasing the world origin to 0,0,0 at BeginPlay.
answered Oct 02 '15 at 03:40 PM
The foliage type is meant to be used with procedural foliage.
That process is to assign a foliage to a foliage type and then assign that foliage type to the foliage spawner. You can turn this on by going to your Editor Preferences > Experimental > Procedural Foliage. This will enable the procedural foliage system which will allow you to populate your scene with foliage inside of a specific volume. From there you can adjust the density and such inside of your Spawner.
Adding your foliage type to your foliage brush is not recommended for that workflow. Essentially what is happening is the foliage mode has it's own system for calculating instance meshes inside of the scene. It takes mesh's straight from your content browser and adds them to the foliage system, which spawns as one mesh system, then is able to calculate and draw in your viewport. The foliage type has a system of adding a static mesh's to it's draw call, and there are some functions in it, then it is added to it's actual spawner system to be calculated when it is added to your viewport.
The foliage type, in itself, is not meant to be called as a spawning/call function. So what happens when you add it to the foliage brush is you call the foliage within the foliage type, then call the system for how that is called when it is added to the foliage brush. Then the foliage brush to calculate all of that and then draw it where you paint it. That is not the intended workflow for either the foliage mode or the foliage type.
I believe this is where the problem occurs.
answered Sep 28 '15 at 05:16 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here