Graphics
August 9, 2024

New Construction and Cloak Effects

We have unified our shader pipelines to use the same rendering path for units under construction and cloaked units as well. This significantly cuts down on the performance overhead of cloaked units, as well as allows for a nicer animation for units under construction.

author
[teh]Beherith
Last updated:
September 7, 2024

New Construction and Cloak Effects

We have unified our shader pipelines to use the same rendering path for units under construction and cloaked units as well. This significantly cuts down on the performance overhead of cloaked units, as well as allows for a nicer animation for units under construction.

Construction Effect

  • The construction effect used to use the old engine rendering pipeline meaning that it did not use the custom unit shaders extras like normal mapping.

  • While this did allow the construction effect to display a wire frame and to use transparency these are no longer usable. This does not look too nice with triangles either, and quads are infeasible.

  • Transparency is a no-go, as these are drawn in the opaque pass.

  • The main architectural shift is that instead of an entire separate pipeline and the management of those, we communicate to CUS via unit buffer uniforms.

    • Buildprogress was already present on userDefined[0].x, but is now managed via CUS gadget instead of Healthbars widget.
    • userDefined[1].w contains the ‘height’ of each unit
  • Construction effect + damage can be applied at the same time

  • Deferred buffered contain the expected data for post-effects

Selection Effect

Two main selection effects, highlight under cursor and highlight selected have been folded into userDefined[2].z Effect is controlled via the Selected Units GL4 widget, which draws the selection platters

  • Features can now be mouseovered
  • Selection highlight obeys damage based shading displacement

Cloak effect

The cloak effect has been moved to a cloakTime userDefined[3].x unitbufferuniform. Contains the game frame cloak started/ended.

  • Disabled LUPS cloak
  • Looks decent-ish

Misc

  • CUS GL4’s autoReload.enabled allows automatically reloading and recompiling shaders from disk when changed via external editor
  • CUS shaders split out into vert.glsl and frag.glsl files
  • HighlightUnit API can be considered deprecated, as no more official consumers exist within game
  • CUS GL4 now handles alpha blending (but beware of draw order issues!)

More Images

More microblogs