Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Any chance of HDR colour support?

A topic by AndrewMarcHarris created Dec 02, 2020 Views: 202 Replies: 3
Viewing posts 1 to 2

High Dynamic Range colours for the text colour / gradients would look great.
I've had a brief go at adding them to the shaders myself, but i couldn't quite get there.
I pasted
[ColorUsageAttribute(true, true)]
above the colour in the shader script, and it allowed me to pick a HDR colour in the inspector, but it seemed to output that colour without HDR

Developer

Hmm... I haven't looked into it myself, but try adding that attribute to the color field in SuperTextMesh.cs itself. I'm just guessing based off this info here, but that might allow compatibility...? Super Text Mesh takes that value and uses it as the vertex colour so that's my best guess!


I'm really curious about this, now! What benefits does HDR provide over the normal colour picker?

Yea editing SuperTextMesh.cs so that it reads

[Tooltip("Default color of the text mesh. This can be changed with the <c> tag! See the docs for more info.")]
[ColorUsageAttribute(true, true)]
public Color _color = Color.white; //i wish marking this as internal didn't break stuff (well, you know why this doesn't work........ shoulda used namespaces)
public Color color

From line 774 lets me pick the HDR color as you can see in the inspector there, but the output is not HDR
The benefit of HDR in my case is that it plays really nicely with unity bloom post processing, for example the UI image beneath glows nicely thanks to HDR plus bloom, it's actually just a small rectangle.

Developer

Ah, I see! Well... if now your updates allow HDR in the shader and HDR in the STM inspector, the only place left I believe should be the mesh itself...? Apologies for debugging this way, I tried setting up my own scene with post-processing and wasn't able to see the same issue... bloom seemed to apply to everything in the scene? Sorry, I'm really new to using post-processing.


Inside of SuperTextMesh.cs, look for "endCol32", "startCol32" and "midCol32" and add "[ColorUsageAttribute(true, true)]" above where each of these is defined. I'm not 100% sure this'll work but these variables get assigned directly to the mesh itself so maybe that's where it's forgetting the HDR values? I'd like to support this so hopefully this is the solution.