Blender Shader Node. 2-Tone texture split along a plane

Hi. I know there is  a way to do this (probably) with nodes but I'm blowed if I can find what I am after.

The effect I'm aiming for is to take an object, in this case an egg, and 'dip' it into paint. I'm imagining a plane as the surface of the paint so that any surface of the egg on the normal side of the plane is 1 (say white) and on the other side it gives a 0 (say black).

Then I can use the relative postition and rotation of the plane to experiment with the result.  And use the output for a Factor in a Mix Node

Once I'm happy I could replace the plane wth an empty and parent it to the egg until I decide to bake the texture at some point.

Many thanks in advance

Trevor

  • of Nodes & Noodles(gcs_dev) replied

    Hi Trevor! You can certainly do that in the Shader Editor.

    1. In the material for the egg, add a Texture Coordinates node and select your plane/empty from the Object field (eyedropper) at the bottom of the node.
    2. Add a Separate XYZ node and connect it to the Object output of the Texture Coordinates node. 
    3. You can now use the Z value of the separate node as a Factor.
  • Trevor Simpson(biohazard2015) replied

    Went and had lunch and came back and created this node group.

    Had a few problems until I realised I needed to isolate the Z-axis. Don't ask me why but it aligns the split perfectly with the plane now. So I can move/rotate the plane to move the line of the split.

    NOTE: The Colour Ramp has a black marker at 0.0000 and a white one at 0.0001

  • of Nodes & Noodles(gcs_dev) replied

    If you need such a fine cut-off, you should use a Math node set to Greater Than 0.

    By the way, you shouldn't connect to Color output (yellow dot) to a Shader input (green dot). Drop in an Emission shader between the ColorRamp and the Output, or simply CTRL+SHIFT+CLICK on the Ramp and Blender will do it for you.

  • Trevor Simpson(biohazard2015) replied

    Great, thanks for the help. So much to learn.