User:Pinsplash/Random Research

func_lod: is it worth it?
These are the results of 20-second benchmarking tests taken while looking at 982 individual entities, which is close to the effective brush entity limit of approximately 1024. The state of the brushes (opaque/translucent/transparent) was controlled by changing the fade distance itself, as it was found that moving the camera caused more of the surrounding environment to render which had a very large performance impact. The game being used is Half-Life 2. After this, the entities were all combined into one single. The FPS was 252 in all three states.
 * Opaque (not faded at all): 209 FPS
 * Translucent (partially faded): 152 FPS
 * Transparent (invisible): 258 FPS

I then converted the brushes into 982 es. The FPS was 167. Reasons for this huge discrepancy are beyond me, and spending time changing the es in any way to "optimize" them is out of my scope for now. I did try a few other brush entities:
 * func_lod: 209 FPS (fully opaque)
 * func_brush: 167 FPS
 * func_illusionary: 149 FPS
 * func_tank: 148 FPS
 * func_detail: 254 FPS (same result for world brush)

At this point,  seems rather worthless, but the example scenario is extreme and not realistic. As a more realistic scenario, I chose a view of three s in  which are used for hiding some roof geometry and a staircase.
 * Opaque (not faded at all): 111 FPS
 * Translucent (partially faded): 111 FPS
 * Transparent (invisible): 113 FPS

Conclusion: No.
 * It does render (and... process?) faster than other brush entities, somehow, when it's not faded at all, but still slower than and world geometry.
 * If it's partially faded, it can be even worse than it being fully visible.
 * It isn't until the  is fully hidden that performance is actually improved compared to  or world geometry, though that benefit is minimal.
 * Tech was probably different back in the day in ways which made func_lod a useful tool, but now it's irrelevant.

Margin of error: For a static image, 20 seconds is plenty of time. ±1 FPS.

Lightmap and texture scale against performance
After finishing my func_lod tests, I was still left with one nagging question: How could a simple cube-shaped test map see FPS range so much? I stripped it of everything. 6 sides, 2048 units high and across, lightmap scale 16, texture scale .25 (the texture being used is dev/dev_blendmeasure2) gave me 200 FPS looking at as most of it as I could at once, and 580 FPS staring down at a corner.

The images below show how FPS changed as a shifted the camera from looking at a corner, to looking at the whole map, over 100 seconds.

Conclusions:
 * Increasing the lightmap and texture scales of faces will give a small FPS boost. If a texture is a solid color, use the fit to face button to keep it from wasting FPS.
 * Geometry with a lot of cuts on it can have a noticeable impact depending on how bad it is.