GoldSrc:Sampling System - advancedfx/advancedfx GitHub Wiki

Motivation

The example test images show a scene from a Counter-Strike 1.6 mod match where the player we are watching in-eye is turning to the left:

no sampling sps 180 -> fps 30 sps 1200 -> fps 30
no sampling sampling x6 sampling x40

The human eye is good at spotting things that don't seem to be continuous motion. For a real movie camera the Shutter speed allows to control motion blur, or in other words the time a frame is exposed to the scene.

Now a single image we get from the Half-Life engine is as if no time had passed at all when it was taken. This would result in a animation looking much more jittery than what you'd expect from a real camera.

The sampling systems allows to approximate what you'd get from a real camera by taking more images from the engine and using several of those to calculate a single frame outputted in the end. This of course comes at the cost of increased render time.

Quickstart

The default settings allow getting started instantly, so just enter mirv_sample_enable 1 to enable the sampling system and then you can proceed working as usual, except that you are currently limited to the mainstream (see Limitations bellow).

Limitations

Not all streams support sampling, those streams will be outputted unsampled, this applies i.e. to camera motion data, and HUD streams.

Mattes and sampling

Obviously color matte keying is no good for sampling, thus we recommend the alpha matte instead, see mirv_matte_method.

Command Summary

  • mirv_movie_fps : output frame rate in frames per second
  • mirv_sample_enable : enable / disable sampling system
  • mirv_sample_sps : frame rate the game is run at in samples per second; higher values can increase quality and will increase rendering time

Advanced

Pros and Cons

Cons

  • Slow: Probably not as slow as when writing all frames unsampled to disk, but still slow.
  • Lossy: Down-sampling is of course a lossy process, information get lost upon down-sampling. Ideally you would want to compose your video at the sampling rate instead and do the down-sampling upon the final render. This especially could get a problem with alpha compositing (A over B).
  • Inaccurate: HLAE currently does not apply band-with limiters before down-sampling. This can cause artefacts.
  • Artefacts: Especially alpha compositing (A over B) could become a problem, because the result is not independent from the background (keep in mind the clamped RGB space is neither distributive nor commutative).

Pros

⚠️ **GitHub.com Fallback** ⚠️