Home Unreal Engine

UE4 - Adjusting cull distance of foliage by adding nodes into the material

mobpapst
polycounter lvl 4
Offline / Send Message
mobpapst polycounter lvl 4
Hey guys,

got a short question here. I want to adjust the culling distance of my foliage and i know that it's possible to set a culling distance in the foliage tool options but i also know that it's possible to deactivate the cull distance completly by adding some nodes in the the foliage material itself but i can't remember how to do that.

If you know how to adjust the culling in the material please tell me how to do this.

Thanks a lot

Replies

  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    That is used to make them fading out instead of popping. If not used carefully, you can get them fading out much before the culling happens, so basically you waste rendering on drawing invisible plants. Make sure you examine the shader complexity view to see if you are doing this unintentionally, or not. The node is called per instance fade amount by the way. Fading an opaque material per pixel looks like this:
    (distance (worldpos-camerapos, 0)) / desired max distance. 
  • Axenation
    Options
    Offline / Send Message
    Axenation null
    Obscura said:
    That is used to make them fading out instead of popping. If not used carefully, you can get them fading out much before the culling happens, so basically you waste rendering on drawing invisible plants. Make sure you examine the shader complexity view to see if you are doing this unintentionally, or not. The node is called per instance fade amount by the way. Fading an opaque material per pixel looks like this:
    (distance (worldpos-camerapos, 0)) / desired max distance. 
    For my smaller foliage like grass, small rocks, etc.. I shrink the vertices to mesh's origin point using the per instance fade value as the driver. Obviously doesn't work on larger objects like trees (unless you're doing a stylized environment), but it looks good on smaller objects and doesn't create as much overhead from the overdraw like the traditional fade effect does.

    Same concept could be applied to the OP's question. You can also use the traditional transparency fade technique and then once the material is fully transparent you can quickly shrink the vertices so you're not rendering overdraw until the objects are actually culled out. Overdraw is evil in UE4 :)
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    You could certainly do that!
Sign In or Register to comment.