Increasing grass culling distance beyond foliage tool limit? Grass stops rendering too short..

When I increase the cull distance of my grass in the foliage tool, the grass wont render past about 15,000. I have high elevations so I need to be able to see grass alot further than this in the distance, but I just cant seem to get the grass to render further. Its like theres a global culling over-riding the max or something ? I’m using carefully planned out grass so I can afford the extra distance for longer views with less dense overdraw, but I dont even know how to get the grass to render further

I’m betting the alpha maps in your grass are being mipped out. Which will then cause the grass to completely clip. Turn on wireframe and see if the geo is there. Another way is turn mipping off in the texture containing the map.

Turning mips off is a bad idea. I know grass should be sharp, but the whole reason you see textures blurring as they get in the distance is because of mips: you’ll have heavily aliased textures all over the place if there’s no mipmapping at all. And they will be very expensive to render. It’s possible that there just aren’t enough pixels on your monitor to display grass at the distance you want to see it. I think you should have a green landscape material when the viewing distance is so far away. At that point, any detail in the texture will get blurred out anyways, and you only have a few pixels to render several blades of grass. If you took a photograph of this place in real life and zoomed in on the photograph, you won’t see trillions of blades of grass off in the distance, you’d just see a field of green. All you need is a field of green at that distance, and landscape material is the way to do it.

You could try to ouput some grass colorization to landscape material where there should be grass when distance get high. What is your alpha treshold for grass? Could you lower it to 0.25-0.33? You could test dither alpha for your grass textures too.

I wasn’t clear on this- it’s NOT the solution, only a way to quickly tell if what I was talking about was happening.

The geo is not there its completely just culling too short

Is this the only way? Is there no way to over-ride the maximum cull distance of grass? For any game with flying it is just wayy to short of a render distance. I’m flying pretty slow and it still feels like an extremely short cutoff

The orange wireframe here shows how close the maximum culling cuts it off


Hi CyberDev,

I’ve been working on exactly the same issue. Try going into the grass mesh (or meshes if you’re using multiple meshes for your procedural grass), and adjust the “screen size” parameter for the LOD2. If you set it to zero for instance, it will draw very dense grass much further out, but it will put a fairly heavy load on your system. There is probably some small number that is greater than zero that will be acceptable. However, at some point it does still seem to get culled. As per mariomguy’s point, I think you need to try using a base texture that matches the color of your grass to blend at a distance.

I have the same issue with a mesh that has only single LOD. Foliage tool just culls it out regardless of my settings, I’ve tried it with different meshes, including primitive shapes and result is the same. It is some sort of overzealous optimization that decided to cull whole foliage cluster if it’s further than 200 meters or so.

Try tweaking the value of “foliage.MinimumScreenSize” using the console.

Thank you, Ryan!
This works, with some small decimal values I can force it to be always visible on screen. Is it some sort of a project settings variable?

Now I see what is the core of the problem. Somehow culling doesn’t take into account scale transform of the object. If I take the same object, scale it 10-20 times and 3Dmax and import back then everything is fine and culling is working as expected. If the object is scaled in Unreal - in Foliage painter or when added as Instanced Static Mesh then culling settings are not working. Should I submit this as a bug or this is intended behavior?

That is as expected actually. it is done that way for performance reasons since it would cost much more to evaluate each transform with different scaling per mesh. You should keep your mesh as close to 1 as possible to avoid any issues with this. If you are bringing in a very small mesh from max you should scale it up in max or use the build settings to scale up the object in unreal.

As long as you only scale say between 0.75 and 1.5 this doesn’t seem to be a huge deal.

It became a problem on the kite demo for some super-scaled-up merged rocks and we had to make a copies of the scaled up objects to be able to use them as both large and small and have them all LOD appropriately. But even we considered that “cheating” since the scaled up mesh was a quick hack for time… a true large asset would have been nicer to use if we had any. Alas, making super large assets and integrating with the photogrammetry process is difficult since you can only capture objects of a certain size that way (anything much larger than a large truck takes so many photos that it becomes impractical to process unless you go to heroic lengths to break the asset up somehow or reduce resolution etc). So you either need to get good at re-using that data in a scale free way or making hand made art that can look good next to photomodelled stuff which is a challenge itself. One method is to use the scanned small objects as displacement brushes to help make really big stuff that you texture using extracted tiling patterns. That way you can make big custom things out of the photoscanned source.

That makes sense. Most of my content is build up to a scale of the game but I see potential problem with items from marketplace. In this specific case, where bug occurred, I was using a pine tree from content examples. I’ve exported it as fbx scaled it up and brought it back. In the process it lost unwrapping - not the issue for test content but potentially a time sink for more complicated content with multiple lod levels and etc.
You’ve mentioned that I could use “build settings” - do you mean rescaling during import?

You guys did a great job there! It’s hard to notice that small and big rocks are the same unless you know they are :smiley:
Kite demo might push industry to place more resources into photogrammetry. Perhaps in few years variety of software and hardware will be bigger, so far most of it is focused on VFX more than a gamedev.

After 2 days of ticking untold numbers of tick boxes and changing every value I could find RyanB has hit on the issue. The Solution is simple if you have for example trees on your foliage panel which
decide to vanish too close to the player. In a large open world this is obviously no use and so you need a good draw distance (take LOD and everything else into account also).

Go to the tree asset you are using and spray it on at scale 1. If it looks too small don’t go to your 3d package and instead just change the build scale of it in the static mesh editor. So 9 if its a very small

When you then spray it on it will not vanish and the cull distance settings on your foliage should start to work again. Its obviously some issue RyanB has mentioned as Epic
probably didn’t know how often folk like us don’t care about scale when importing assets. So its a good lesson in trying to ensure that assets imported are to the right scale in the first place.

This fix may cause unforeseen issues which Im currently not aware of so use at your own risk. Probably best to re import at the correct scale opposed to trusting on the build scale.

PS. I’m no expert but it worked for me. Hope it helps.

so its scale issue?

The only way I manage to get my grass to cull correctly in 4.10 is to set the texture(s) so it uses to No mip maps :confused:
Six more hours of my life spent on some strange ue4 oddity …
foliage.MinimumScreenSize 0.00000001 or scaling do nothing for me on foliage created with the foliage tool before I changed to no mipmaps
Maybe it because I’m using distance field ao and shadows???

Its probably just your texture mips get too dark or blurry due to the mix of black and white heavily favoring the black.

Generally problems like this can easily be fixed by changing the value “Max Alpha” to a number much higher than 1.0. Try values like 2 or 4 or 8 to see how they help. Under texture properties under “adjustments”.

You should generally never turn off mip maps since it can have negative performance implications and tempralAA while good will not be able to smooth the aliasing artifacts anywhere near as it can with the help of mips.

Thanks for the help, it worked with the Max Alpha :slight_smile:

I have a problem with some foliage I found. I am using to paint grass on a landscape but if the camera goes too far from the grass, it dissapears. I tried to change cull distance, change lod and foliage.MinimumScreenSize but it didnt worked. Someone knows how to fix this ?