Grass Blocking Volume

Thanks, I tried to get it from there, in the editor I can access the HISMC but it tells me there are 0 instances inside, but once I hit play or simulate the HISMC disappears… So the grass is probably stored somewhere else. I actually tried to get all Actors of class Actor and then get all components of class HISMC from every actor and while the game runs there is no HISMC in the scene… Quite strange :frowning:

One other place to look would be a foliage cache inside of the ALandscapeProxy ( look for FoliageCache member ). FoliageCache is a struct of type FCachedLandscapeFoliage that is also declared in LandscapeProxy.h … it contains cached references to the HISMC… If that doesn’t work out then I’m unfortunately out of ideas right now :). If Epic doesn’t release something soon I’ll probably start working on it again (in about 1-2 month timeframe) and I’ll update this thread with any progress I make.

here is a basic example

just paint on dirt sand or the rocks where you want your building etc…

the problem we were trying to solve here was how to do it in runtime, not in the editor (e.g. when you place a new building during gameplay)

Any news on this? :slight_smile:

Will it be done for 4.10? I’m really awaiting not having grass growing through the floor :slight_smile:

I would like to bump this topic, as 4.10 was released yesterday.
Unfortunately, I read nothing similar to a “grass blocking volume” in the release notes, so would like to inquire about this again? Or if anyone has found alternative solutions.

Cheers!

Right now this is on the ToDo list for 4.11, but it still has yet to be added. This does not guarantee that it’ll make it for 4.11, as other priorities will always take precedence.

4.10 was a stability build so there were more fixes than new features this time around. Keep a look out for future releases.

Is it still on the ToDo list for 4.11?

I too would like to know about its chances of getting into 4.11 :slight_smile:

This gets a +1 from me :slight_smile:

Any update about this? :o

Actually, the original ticket that was entered with UE-18426 was marked as duplicate of UE-19187. So this is the number that will need to be referenced as the previous one was closed out.

UE-19187 is marked at “Backlogged” with a fix version fo 4.12, but as can happen things will typically get pushed with new features based on other higher priorities that need to be done.

Even though this currently has 4.12 as a fix version do not take that as written in stone. Things like this can easily get pushed out to a later version. Hopefully it’s something that can be added by that point, but it cannot be guaranteed.

I think a workaround for this would be to paint a map in a separate unreal map or a third party application. not ideal but actually might give you some finer control over the grass output.

If painting in a third party app like photoshop or even maya/zbrush/mari, you could render a heightmap and then use that as a guide to paint a greyscale texture and block out your grass in the material before it goes into the grass output node.

Or to do it in unreal would be to create a duplicate map (which I assumes saves a different copy of the landscape? i havnt tested) and paint a layer info so you dont destroy your weighting in the main map. then export to file and read it in the material.

I’ll have to try when I get home from work.

You have my sword.

The problem is not with generating a map that would block a grass… that’s pretty easy even now. The issue is that it’s impossible to change the map during runtime, e.g. when a player places a new building on the terrain. There is no workaround for this now because the grass instances are not regenerated when the underlying map changes.

Depending on the size of your map you could draw a mask to a canvas at runtime and use that in your grass material to drive its opacity.

Ok I missed that it was a runtime thing that you wanted. The best thing I can think of is using distance to nearest surface and then shrinking the instance to a scale of 0,0,0 when its near a surface by remapping for example the dstance 0.5->2 meters to a scaling value of 0->1. they would then scale down as they approach the buildings. Would not require rebuilding of the grass instance buffer either.

The reason that it is so performant is that it can pre build the hierarchical data structure, build a buffer and cull based on that structure. if it rebuilds it every frame then you wont get the benefit of the fast rendering and culling.

I think that’s a great idea. But I would not know how to do that.

Well basically you need 1 math function - WorldToUV. Say your map is 5x5 kilometers and you make a 1024×1024 canvas. If you drop your house or whatevever object in the middle, i.e. 0 in x and y, your WorldToUV would translate this tp 0.5x0.5 (WorldToUV is just (WorldPosXY + HalfMapBounds) / MapBoundsXY. Might need to invert Y, not sure). Now you use this to draw a white rectangle into a canvas which you then stick into a rendertarget.

Your grass material will now do the same. Take the pixel position, convert it into UV and sample your rendertarget. Since you drew white boxes for houses you now just invert that and you got your opacity value.