Skip to content

Fix overlay rendering#4

Open
CrystalMageX wants to merge 2 commits intoReikaKalseki:masterfrom
CrystalMageX:master
Open

Fix overlay rendering#4
CrystalMageX wants to merge 2 commits intoReikaKalseki:masterfrom
CrystalMageX:master

Conversation

@CrystalMageX
Copy link

This separates the rendering of foreground, and background, letting the washout get rendered on top of, while keeping text visible on top.

See ReikaKalseki/Reika_Mods_Issues#791

@ReikaKalseki
Copy link
Owner

I am still concerned this will break something.

@CrystalMageX
Copy link
Author

CrystalMageX commented May 12, 2016

Broken down, this does the following:

  1. Move the help HUD to the front, because it has text.
  2. Duplicates the event handler in preparation for the next steps.
  3. Makes sure everything that was wrapped around GL11.glTranslated(0, 0, FRONT_TRANSLATE); is in renderForeground(evt) and everything else that was not to be kept in renderBackground(evt).
  4. Removed the foreground translate, because now we are already in the foreground, and depth testing is disabled in 2D.
  5. Removed return statement when washout is active (we still want to see the progress overlays).
  6. Optimized variables according to scope, and optimized away redundant if statement conditions.
  7. Removed holding boolean which only has effect in a single frame.

Things that are kept in the background:

  • Boosted healthbar
  • Washout
  • Tool element pie
  • Tool tile overlays
  • Orepick HUD
  • Transition HUD
  • Pylon aura
  • Ping overlays
  • Tool crosshair
  • Killaura gun crosshair

What has been moved to the foreground (that you had already tried doing using a z-index):

  • Ability status
  • Progress overlays
  • Structure text
  • Flare messages

@ReikaKalseki
Copy link
Owner

Removed return statement when washout is active (we still want to see the progress overlays).

No, when washout is active, literally nothing else should render.

@CrystalMageX CrystalMageX changed the title Fix Rendering Order related to Minimaps and other mods' overlays Fix overlay rendering May 12, 2016
@CrystalMageX
Copy link
Author

I cancelled the event, and nothing else should render now.

Also, the GL matrix and attribute stack is only used now if anything needs to render, because there are many different element types. It is repeated code, but it should improve FPS slightly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants