Enabling HDR in the Material Set Colour node

Simple question, title sums it up - I’m trying to get a colour-change thing going with the emissives of a switch, and while I’ve gotten it working I did notice that the Material Set Color node doesn’t have a HDR toggle, and I kinda need that for the Bloom effect in the rest of the world…
Here’s what I’m using - basically the same as the Example I found on here, with some self-evident changes. Plus I duplicated it for Trigger in and out, to set it back to red when disabled.

So I got no responses on here, but I eventually got some help from the Discord. If you’re curious what I did - I essentially set up the nodes to trigger an animation rather than changing the colour directly. These animations (one for “On”, one for “Off”) then change the colour.
This was actually better than the original way I had it working, as not only did I have access to HDR, but I could also add a slight fade between on and off states.

I was the one who helped you in the discord. Likely, HDR is another variable in your shader. If you find it, you should be able to toggle it with something like SetFloat or SetInt. The official Unity SetColor method has no HDR option either, which indicates it’s likely you just needed to set another node to set that variable. Try to open your shader and find out what the variable name is, and what data type to use. OR, you can find the type and name from the animation then create a node for it.

That’s… not a bad idea actually. No idea if I’ll be able to figure it out with my current knowledge (I used Shader Forge for the shader itself, no idea how any of the code actually works) however it’s something worth looking into at some point, and the start point is useful. Thanks!

Finding the variables and what they refer to is really easy. The variables have the description right next to them, along with the data type. See how they’re organized by header, then each variable name below. This is exactly how it looks in the inspector too.

Or you can just look at it in the animation to see its name and type. That may be easier. I believe you will have to rename the variable in the animation to see what its real internal name is first

image

Oh, yeah, that bit’s easy - the internal name should be _EmissionColour, with the HDR value probably appended to it somehow.

Or not.
Just found the _EmissionColour variable in one of my materials, and it seems all HDR does is multiply the R/G/B values by whatever the HDR value is:

_EmissionColour: {r: 2.9960785, g: 2.9960785, b: 2.9960785, a: 1}

For reference: I believe the HDR value for this material was 1.5 to 2 (or something around there), and the RGB values were around 0.9 each.
Soo… hmmm…

Can you show me the shader? Perhaps the graph color picker doesn’t allow high enough values. I would need to look at it myself to see how the shader implements it. But if it’s the color picker, you’d be right there’s no way to change it then, except by something like UdonSharp

Alright, here ya go. It’s a bit long (presumably because it includes both the main shader code as well as the node descriptions required for it to load back into Shader Forge), so I uploaded it to Google Drive.

Here’s a picture of the Shader Forge window after it’s loaded in:

But yeah, kinda figured U# would be the only way. Might learn how it works at some point, could be useful for more complex stuff.

Ok, after looking at the shader, I’ve confirmed that is the case. Udon Graph didn’t include the HDR color picker, leaving you out of luck and having to use an animation or U# to do it. You can of course achieve this in Udon by the following code:

public Material mat;

float factor = Mathf.pow(2,intensity);
Color color = new Color(red*factor, green*factor, blue*factor);
mat.SetColor(color);

Oh, hey, thanks! Will definitely be using this in future!