Ideas for Cycles Shaders

I had this idea,it would be amazing, if the mix shader would have a color fac input.now we have a one color input fac.image, how faster you can build rgb costum reflection curves ect for a trichromatic input.
to improve the idea even more,a second input for alpha transparency would be handy too.

here a screenshot for some input ideas if the mixshader would have a RGB fac input

I don’t get this: a mix is a X% of first input and a 100-X% of the second. Any RGB would (has to) be flattened down to a single value (X) anyway

Just play between 16x16 and 32x32, the latest specially if you enable blender denoiser, but do your own tests per scene.

Cheers!

It could work, mixing factors are RGB internally. For example, if you have a orange Diffuse BSDF, it internally is a Diffuse Closure with weight (1, 0.5, 0). If you mix it 50-50 with something else, it gets the weight (0.5, 0.25, 0).

1 Like

So we could mix BSDFs with three different weights since calculation of the closures is done per-channel? Ok now i got it!

1 Like

Yes exactly.

And it would be backward compatible too,because the “old” input values are still one grey color.

I’d like to see some more generic shader maths.

We have add and mix, but why not subtract, multiply and divide? Should shaders have all the options available in the standard math node - but which work at the BSDF level?

1 Like

You mean like the color mix shader? Yes agree,this would be open more possibilitys too.

The thing is,we would dont need to split/seperate the shader anymore for a simple rgb input calculation.For the split you need the rendertime of 3 shaders.with a color fac you need only one shader.

And if you go for keep it stupid simple as possible(kiss),why not use the math from the color mix shader for the mix shader? wink to the devs :wave:

Yes. After getting some advice on these boards, I managed to fudge a node group to force a shader subtraction a few years back - and it resulted in some very interesting (and potentially useful) effects.

Having access to multiply, divide, exponent etc could open up even more possibilities.

1 Like

in short,the mix shader should behave like the color mix RGB,plus a RGB fac input :metal:

…wait…wait…the color RGB should become a RGB color input fac too,same reasons.

That would be incompatible with a lot of algorithms and optimizations inside Cycles. I can’t give you a brief description of what a BSDF or Closure exactly is, but it’s not an RGB color and cannot be mixed in the same way as an RGB color.

Being restricted to add and mix is a restriction and prohibits certain non-physical shading tricks, but having that limitation in place is what’s necessary to let Cycles to do many of things it does.

2 Likes

Erm - yes i’m well aware

And as demonstrated by my subtract shader - they can be mixed in an analogous way.

yet, add and mixing don’t really change the behaviour of the shaders… just their colors, which are multiplied by the intensity a sample returns. You can do all sort of things with the colors you use for each shader… even use negative or bigger than normalized colors… but the shader behaviour remains…
what we need is the hability to create our own closures, which is a broad discussion;
and the possibility of a mild compositor coupled with the shader editor, for per_shader screen effects (similar to some known renderers).

To be honest, in the context of materials, not maps, even add mode doesn’t make much sense. It was mainly present because of Emission I believe, but other than that it should not be used.

it’s there because we can want to perform our own mixing… If we take a look into what MixShader does, it’s only [(1-Fac*Color1)*Closure1] + [(Fac*Color2)*Closure2)]. With the AddShader node I can use a specific factor for Color1 and another for Color2.

And break energy conservation in the process most of the time :slight_smile:

:blush: if i want!! at least we have the power!!! :smiley:

Yes, but the problem is about 90% of people don’t know how to utilize that power correctly, and in ranks of Blender users specifically, it will be more like 99% :slight_smile:

It’s also useful if you want to create dispersion effects, adding RGB refraction or glass shaders together.

Yes, in fact I’ve been trying exactly that, but it doesn’t work very well due to how Cycles shader mixing handles total internal reflection.

I think that add should be dug somewhere very deep for no one to find out, and most functionality should simply be in principled BSDF. Principled, when done correctly, makes the entire BSDF mixing cycles currently has obsolete.