How to implement HDR colors in Aline?

Hey, I’m enjoying ALINE and am exploring using it to supplement an in-game HUD. I’d like to put these into HDR color range, and I’ve already adjusted the injection point to accommodate this in HDRP.

What’s a bit greek to me is what all needs to be modified to move to HDR color. My naive first guess was changing out from Color32 to Color in CommandBuilder.cs, but that didn’t change the output (and did appear to result in some subsequent rendering issues). It looks like there’s some direct memory allocation I also need to account for here as well.

Any hints at what needs to be modified to get this working?

I kept fishing around on this and resolved it, so here’s a follow-up for anyone interested. Here’s a (wildly overblown) example:

2020-12-14 13_33_56-Window

All of the changes made were in CommandBuilder.cs. These were:

  • Replace all instances of Color32 with Color
  • In VertexAttributeDescriptor[] MeshLayout and MeshLayoutText change the color format from UNorm8 to Float32
  • In PopColor() change Reserve(4) to Reserve(16) [I haven’t verified this was necessary]
  • In public void Line (Vector3 a, Vector3 b, Color color) change lineData ptr+8 to lineData ptr+20, and change the buffer->SetLength(bufferSize + 4… to buffersize + 16… [Also haven’t verified this was necessary]

I’m not entirely sure if I’ve done additional steps than needed, or if I’m missing anything that would be smart to add, so feedback is totally appreciated.

If you’re in HDRP, you also need to change these settings:

  • In DrawingManager.cs find volume.injectionPoint = and change it to BeforePostProcess (or before transparent, if you need). This allows you to render with postprocessing if you want it
  • Make sure Custom Passes is enabled in your HDRP Render Pipeline Asset for each of your quality settings
1 Like

Nice that you managed to solve it!

Yeah, I think those steps are essentially what you’d have to go through to get HDR colors.

1 Like