# Procedural Landscape Layers

**URL:** <https://forums.unrealengine.com/t/procedural-landscape-layers/2658099>\
**Category:** World Creation\
**Tags:** unreal-engine, Landscape, procedural\
**Created:** [September 19, 2025, 4:48am UTC](https://forums.unrealengine.com/t/procedural-landscape-layers/2658099 "2025-09-19T04:48:59Z")\
**Posts on this page:** 1\
**Showing post:** 31

<div class="post-metadata">

**Author:** ![Frenetic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/frenetic/32/1142542_2.png) [@Frenetic](https://forums.unrealengine.com/u/Frenetic)\
**Post date:** [December 4, 2025, 11:29pm UTC](https://forums.unrealengine.com/t/procedural-landscape-layers/2658099/31 "2025-12-04T23:29:09Z")

</div>

Got it working with custom-attributes off the GPU. The item is buried in the UI:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/9/8/898b7a900e9a64d8d0af756da204b30b6ce6112b.jpeg)

EDIT:

Yup, best of both worlds. I can use the alpha-layer in my RVT to act as the grassmask. (Essentially) the same maths would be feeding into the gass-output node in the landscape material, but at the cost of 3 texture-samplings (in my particular case). Per-layer, if I had a few masks, it would add up; no-go for me. With this method, I don’t even need a gass-node, so there’s 0cost there.. 😃

I already pack multiple alphas into a single channel in the RVT, so its easy-enough to replicate that bit of the shader to unpack it in the Custom node, use it in place of the regular grassmask, and voilà! Same function, same gradients, etc, but at less cost in the shader; so win-win.

> **Summary**
>
> ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/9/0/f90efe8ec20bd5d3ded32af836b6ae7ec2d1f595.jpeg)
> 
> > **CODE**
> >
> > float3 Min = GetComponentBoundsMin();  
> > float3 Max = GetComponentBoundsMax();  
> > float Offset = 250;
> > 
> > // compute position first so we have our set of just-points  
> > float3 Position = CreateGrid2D(ElementIndex, NumPoints, Min, Max);  
> > uint Seed = ComputeSeedFromPosition(Position);
> > 
> > // sample the aphas RVT  
> > bool bInsideVolume;  
> > float3 BaseColor;  
> > float Specular;  
> > float Roughness;  
> > float WorldHeight;  
> > float3 Normal;  
> > float Displacement;  
> > float Mask;  
> > float4 Mask4;  
> > VT\_SampleVirtualTexture(‘rvt\_a\_4k\_256’, Position, bInsideVolume, BaseColor, Specular, Roughness, WorldHeight, Normal, Displacement, Mask, Mask4);
> > 
> > // cull based on threshold, removes points w/o a  
> > // value for the grassmask, points not on the mask  
> > float Density = FRand(Seed);  
> > //float Thresh = GrassMaps\_SampleWorldPos(0, Position.xy).x;  
> > float Thresh = BaseColor.z;  
> > if ((Density + 0.1) \> Thresh)  
> > {  
> > Out\_RemovePoint(Out\_DataIndex, ElementIndex);  
> > }
> > 
> > // Randomize the XY position  
> > Position.xy += (float2(FRand(Seed), FRand(Seed)) - 0.5) \* Offset;  
> > // snap the Z position to the landscape surface  
> > Position.z = LS\_GetHeight(Position);  
> > Out\_SetPosition(Out\_DataIndex, ElementIndex, Position);
> > 
> > // set rotation  
> > FQuat Rot = QuatFromAxisAngle(float3(0., 0., 1.), FRand(Seed)\*6.28);  
> > Out\_SetRotation(Out\_DataIndex, ElementIndex, Rot);
> > 
> > // set random values for data-packer  
> > uint Seed2 = ComputeSeedFromPosition(Position);  
> > // uint Seed3 = ComputeSeedFromPosition(Position.zyx);  
> > // uint Seed4 = ComputeSeedFromPosition(Position.yzx);  
> > // Out\_SetColor(Out\_DataIndex, ElementIndex, float4(FRand(Seed), FRand(Seed2), FRand(Seed3), FRand(Seed4)));
> > 
> > // set scaling  
> > float ScalingXY = lerp(0.65, 1.15, (FRand(Seed)+(Thresh\*Thresh)));  
> > float ScalingZ = lerp (0.65, 2.0, (FRand(Seed2)+Thresh));  
> > Out\_SetScale(Out\_DataIndex, ElementIndex, float3(ScalingXY, ScalingXY, ScalingZ));
> > 
> > // needs an existing attribute to mod, cannot create inside HLSL  
> > Out\_SetFloat(Out\_DataIndex, ElementIndex, ‘Randy’, FRand(Seed2));

Swap out ‘rvt\_a\_4k\_256’ for your RVT/alphas source.

For me, the performance is locked at 0.00ms → 0.01, although sometimes, like my dear friend Bender, I see a 2..

> **Performance is good:**
>
> ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/8/f/d8f2c2d59ba3f5707e85f84e239482150ce87486.jpeg)

Grass is like the saturate of features, (practically) free to spawn/manage.. Hopefully this helps you.

---

_[View the full topic](https://forums.unrealengine.com/t/procedural-landscape-layers/2658099)._
