How to compare values and return smallest/biggest using only shading nodes ?

Hi ! Title. :slight_smile:

I know this is python support section, but I figured I’d be more likely to get answers over here since this more or less touches programming concepts; I want to use GPU rendering, this is why I am trying to avoid resorting to a script. Basically I have two values… I want to somehow output whichever is smaller and use it in my node tree. How can I do this ?

Hadrien

I found it. I needed a node that could switch between two values, and MixRGB does just that ! The noodle got a bit complex but once I compared rendertimes, it doesn’t seem to put any overhead…

I use it to arbitrarily control density in a volume, here with two empties going apart from each other :


.blend : http://www.pasteall.org/blend/36381

Umm… There is a Minimum mode in the Converter -> Math node.

Ah, it seems I took the long way ! Thanks Stan ! :smiley: