How to clamp an Add shader?

Is there a way to clamp an Add shader’s output to keep it from exceeding a value of 1 (or some other chosen value)?
Sorry if clamp is not the right term here.
I mean, if I want to combine additively, but make sure the colors don’t become so bright that the result is like an emitter.
Thanks


Everything should be self explanatory.

Thanks Ace. That’s a good method for lowering the added value. And currently my material is using a similar method.
What I’m searching for though is something that will work as a limiter, and not lower the low values while capping the high ones when they exceed 1.

It’s for a glass material that combines color additively and I want to make sure the light passes through without coming out brighter than when it entered (otherwise the glass will be somewhat glowing).

So the predicament is that in order to get the effect I need to use Add shaders. But then the Add shaders brighten everything too much. Then I decrease their influence using a method like yours, but it also lessens the effect. Hence the desire for a value limiter.

I don’t think Cycles has anything that allows you to get the RGB value of a ray and use it to drive a shader.

If your using a map like say, a fresnal mask, you can also use the same texture to affect how much addition is applied.

I think you’re right that there’s no way to do this with existing node types.
…Although there sort of is! You gave me an idea: OSL.
It seems like the kind of script that wouldn’t be too difficult to write - taking the RGB/hue from one shader input and the brightness/value from another and outputting a combined result.
I’m not sure how exactly yet, but I bet that’s the way to go about it.
Thanks!

With nodes I would “just” limit the colors before they go into their respective shaders, prior to adding. I.e. regular glass using additive shading, I would do fresnel white for the glossy and 1-fresnel white for the refractive - you know the sum won’t exceed white.

Simply keep the rgb values of each input shader below 0.5, 0.5, 0.5.

The add shader adds the input colors linearly. For example - adding two glossy shaders with RGB values of 0.5, 0.0, 0.0 will give you exactly the same result as a single glossy shader with RGB values 1.0, 0.0, 0.0.