CobaltUDK Thanks for the example. This is very similar to what I've just added. I'm not bothering to iterate through each of the PerInstanceData array though, instead just checking a single one in the mid point of the array. It's a rough approximation, but generally if your cluster size isn't too huge, it will be fine.

In your example you check all of the PerInstanceData up until to find one that is outside of the range, then hide the cluster. Seems unnecessary to check any more than one.

Also Chosker regarding my previous post on how to get the scale from the transform matrix. Here's what I'm now using:

I've now added a system to swap out all of my speed trees billboards (beyond a given radius from the player) with instanced meshes using the same system I used for the modular building pieces.

Now an example save game (i was using for testing), which was running at ~25fps last week, is now running at around 140fps! The performance increase has been insane using the foliage tool for mesh instancing.

I'm now going to take it even further with the foliage culling as CobaltUDK has suggested, and see what kinds of results that brings

In your example you check all of the PerInstanceData up until to find one that is outside of the range, then hide the cluster. Seems unnecessary to check any more than one.

Also Chosker regarding my previous post on how to get the scale from the transform matrix. Here's what I'm now using:

Code:

//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- //Gets the scale from a matrix transform. //-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- final function vector MatrixGetScale(Matrix TM) { local Vector s; s.x = sqrt(TM.XPlane.X**2 + TM.XPlane.Y**2 + TM.XPlane.Z**2); s.y = sqrt(TM.YPlane.X**2 + TM.YPlane.Y**2 + TM.YPlane.Z**2); s.z = sqrt(TM.ZPlane.X**2 + TM.ZPlane.Y**2 + TM.ZPlane.Z**2); return s; } //-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- //Sets the scale on a matrix transform. //-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- final function Matrix MatrixSetScale(Matrix transform, Float _scale) { transform.XPlane.X *= _scale; transform.XPlane.Y *= _scale; transform.XPlane.Z *= _scale; transform.YPlane.X *= _scale; transform.YPlane.Y *= _scale; transform.YPlane.Z *= _scale; transform.ZPlane.X *= _scale; transform.ZPlane.Y *= _scale; transform.ZPlane.Z *= _scale; return transform; }

Now an example save game (i was using for testing), which was running at ~25fps last week, is now running at around 140fps! The performance increase has been insane using the foliage tool for mesh instancing.

I'm now going to take it even further with the foliage culling as CobaltUDK has suggested, and see what kinds of results that brings

## Comment