Colour Capture Shader

Started by WAS, September 06, 2018, 04:30:36 PM

Previous topic - Next topic

WAS

This would be a handy function. Just colour. No geometry. Currently I use the "colour function" of a surface layer or default shader, but these have so many more features involved it just seems counter intuitive. Especially when choosing a default shader, so I use a surface shader usually.

Matt

Can you give a concrete example of what you're trying to do?
Just because milk is white doesn't mean that clouds are made of milk.

WAS

Quote from: Matt on September 06, 2018, 04:38:27 PM
Can you give a concrete example of what you're trying to do?

Sometimes I'll create low displacement shaders for surface detailing. Sometimes I than use that setups colour, instead of rebuilding it, for other things, such as fake stones, without the displacement causing exploding before I add appropriate surface displacement at the fake stones scale.

Another instance is I have been doing a lot of custom reflections, and when you merge reflections and such and have them applied via a Child Node, their BG colour is black, so I'd like to provide the correct reflection surface colour without adding more displacement to the overall Surface Layer.

Basically the shader would just be the "colour function" of a surface layer, I'd imagine. It takes the colour from input, but no displacement, and could have the diffuse slider just for customization. Wouldn't hurt instead of just solid 1 diffusion.

Matt

#3
I see. If you only need a diffuse colour, you can use any of the function nodes (blue nodes) that input a colour and return a colour. This is because shaders are automatically reduced (cast) to a simple RGB colour value when input into a function node that expects a colour, and it does this by just looking at the diffuse colour. For example, you can pipe a Power Fractal through a Multiply Colour and it will output just the diffuse colour. Since it's a Multiply Colour you can optionally use the secondary input for adjusting brightness.

If you need other properties such as reflection and luminosity, the only option I can think of at the moment is the Merge Shader, which has options "Merge colour" and "Merge displacement" - these apply to the secondary input "Shader A". Unfortunately there is some render time cost associated with using the Merge Shader.

Just because milk is white doesn't mean that clouds are made of milk.

WAS

#4
Quote from: Matt on September 06, 2018, 06:22:38 PM
I see. If you only need a diffuse colour, you can use any of the function nodes (blue nodes) that input a colour and return a colour. This is because shaders are automatically reduced (cast) to a simple RGB colour value when input into a function node that expects a colour, and it does this by just looking at the diffuse colour. For example, you can pipe a Power Fractal through a Multiply Colour and it will output just the diffuse colour. Since it's a Multiply Colour you can optionally use the secondary input for adjusting brightness.

If you need other properties such as reflection and luminosity, the only option I can think of at the moment is the Merge Shader, which has options "Merge colour" and "Merge displacement" - these apply to the secondary input "Shader A". Unfortunately there is some render time cost associated with using the Merge Shader.

Yeah in some instances I do use the merge shader with the displacement just left unchecked. Good to know on the blue node shaders. Though still a shader name/for such a task wouldn't be bad. May save from people like me looking for the best option. Multiply colour sounds like a really good option though, thank you.

Maybe if you were to add it, it could be a "Get colour [from shader]" sort of shader naming convention making it self explanatory.