LuxBlend Node Editor - LuxRender Wiki
Luxrender GPL Physically Based Renderer

LuxBlend Node Editor

Personal tools

From LuxRender Wiki

Jump to: navigation, search

Note: if you are using the node editor in LuxCore mode, refer to this page: LuxCore NodeEditor

Contents

Introduction

With the release of LuxRender 1.3, LuxBlend features a new, node-based material editor. This editor is loosely based on Cycles' shader editor and utilizes the new "Pynodes" system introduced in Blender 2.67. Pynodes allows python addons to add their own pages to Blender's node editor, to store and edit whatever data they may need.

The plan is for the node editor to eventually take over for the classic materials editor, which should be considered deprecated. The old editor will most likely work for the foreseeable future to maintain compatibility with previous scenes, but it may lack support for new material and texture functions introduced in future LuxRender releases. Compared to the old materials editor, the node editor has several notable advantages:

  • It far more closely mimics the actual relationship of Material, Texture, and Volume statements in the scene file by visualizing them directly. This allows the user to have an easier time "keeping things straight" with complex material setups, as well as sharing data between multiple textures or material channels.
  • Because all materials, volumes, and textures appear on a single graph there is no need to flip between panels and datablocks in the properties editor, making look-development work significantly faster. This is especially useful with mix materials.
  • All data associated with a particular Blender material is stored within a single datablock (the node tree) rather than across many (with a single block for each texture, for example). This removes issues with dependencies and linking, such as volumes getting lost.
  • A hierarchal chart is provided in the properties editor for those who prefer to work that way (it works by "borrowing" Cycles' UI template for the same purpose).
  • It is built on several years of experience and feedback with the old material editor, and is able to address some of its shortcomings. (such as difficulty in sharing texture mapping settings between multiple textures, or float/color channel types not being clear)

What the node editor is, and what it is not

  • The node editor is intended as a replacement for the old materials editor. While the old editor will continue to be available, it is no longer the recommended method for adding LuxRender materials to your scene.
  • The node editor is a separate material editor from the classic editor. It has a limited ability to translate settings when it is invoked, but this should not be relied on. If you already have materials defined in the classic editor, you can leave them as they are (they will still work).
  • The node editor is not a port of Cycles' shading pipeline, but rather adapting LuxRender's to a similar UI. The materials and textures available are the same ones you have always used with LuxRender, just in a different UI. Some functions in Cycles such as the light-path node have nothing to do with the node editor itself, it's just how you happen to interact with them. Nodes for Lux does not mean it will magically get these functions.

Getting Started

To use the node editor with a material, that material must have a node editor "tree" associated with it. You can think of a "tree" as a page of nodes, that stores a particular set of data In the materials panel, you will find a selector on your material to attach a node tree. Since managing these trees separate from your material (a requirement of Pynodes) is a bit cumbersome, LuxBlend will do most of the work for you. Beneath the tree selector, you fill find a button labeled "Add LuxRender Material Nodetree".

Click here to enable the node editor for this material

When you click it, LuxBlend will create a tree with the name of the current material, set a fake-user on it (required since Blender does not allow actual block-linking in python), and attach it to the current material. It will also add a few nodes to that tree to get you started, based on what settings you had in the classic mat editor. Once you have a node tree connected, the materials panel will transform to the new UI

The materials panel in "node mode"

The Output Node

The material output node

The material output node is the only node of the "output" type currently supported. All of your connections will end here. Technically speaking, it shows what materials, volumes, and light emission, if any, will be assigned to objects with that particular Blender material. It has four sockets:

  • Surface The main surface material. This should always be connected, or else the LuxRender core will substitute a grey matte material for you. (if you want an invisible surface, such as for a volume, you can connect a null-material node here). It accepts connections from the nodes in the "Materials" category.
  • Interior Volume The interior volume of the material. Will be used by rays passing through the material. This is your primary volume shader output. It accepts nodes from the "Volumes" category.
  • Exterior Volume A secondary volume output, which defines the volume given to a ray as it leaves the object. In many cases, this will be left blank. See Volumes for more information on this property. Like interior volume, it accepts nodes from the "Volumes" category.
  • Emission A light emission output. If connected, objects with this material will act as area light. It accepts connections from only one node, the "Area Light" node (the sole member of the "Lights" category)

For each socket, there is a panel in the properties editor's material section. These panels will show a chart of the nodes connected to that socket, and allow you to edit their properties.

Socket types

Like the other node editors in Blender, LuxRender's node editor has multiple socket types, which are color coded. They are as follows:

  • Float (grey) A numerical value input. When left unconnected, you can enter values manually.
  • Color (yellow) A color input, which can be set as an RGB value when left unconnected. Note that LuxRender internally treats this as a spectrum input, so float inputs cannot be connected to color inputs, or vice-versa. This is different from Cycles and Blender's compositor, which allow float/color (grey/yellow) sockets to be connected interchangeably. See Texture Types for more information.
  • Fresnel (blue) An optical data input. When left unconnected, you can enter a constant value that will be used as the value for the refractive index (n) at all wavelengths. There are several nodes in the "Fresnel Data" section that can be used to enter other data types to these inputs.
  • Shader (lime green) A shader data input. Has no setting when left connected. Most of these inputs only accept nodes from the "materials" category. The only exceptions are the two volume sockets on the output node (which take the "volume" nodes) and the "emission" socket, also found on the output node.
  • 2D Coordinate (pink) Found on some texture nodes, such as Image Map. Used to connect the "2D Coordinate" node.
  • 3D Coordinate (purple) A cousin of the 2D Coordinate socket, it is used to connect that node's cousin, the 3D Coordinate node. Note that the 2D Coordinate node cannot be connected to this socket. If you want UV mapping for a 3D texture, use the "UV" option on the 3D Coordinate node.

Nodes List

Inputs

An assortment of nodes that have no connections of their own, but merely pipe in data for other nodes to use.

2D Coordinate

Generates 2D mapping settings to be fed to one or more 2D textures. Note that this node is optional, if it is not connected the texture will use it's own defaults. These happen to be the same ones the 2D coordinate node uses by default. In short, if you aren't going to change parameters on this node, you don't need to use it at all.

3D Coordinate

Generates 3D transformation coordinates used by the 3D textures. Like the 2D coordinate node, it's defaults are what textures default to anyway, so it is only necessary if you want to use something other than the default mapping (global coordinates with no transform, in this case).

Blackbody Spectrum

The blackbody texture

Gaussian Spectrum

The gaussian texture

Glossy Exponent

Allows inputting of glossy roughness settings using a more traditional "exponent". You can technically plug it into any float (grey) socket, but it's mainly useful on the U-Roughness and V-roughness sockets on material nodes that have them.

Tabulated Data Spectrum

The tabulated data texture. Reads a text file containing a spectrum of some sort (usually absorption or emission of some real world object).

Value

LuxRender's "constant" texture, represented as a hybrid of the Blender compositor's "RGB" and "Value" nodes. (it also has a fresnel option). It is somewhat looser with sanity checks on values than most nodes are themselves, and will allow things like manually setting an RGB color of [100.0, 100.0, 100.0]. This can be useful when used with textures like "add" or "scale".

Vertex Colors

LuxRender's hitpointcolor texture. It simply returns the objects vertex RGB data. If you added vertex colors to an object, add this node to its material to use them.

Vertex Mask

LuxRender's hitpointgrey texture. It works the same way as hitpointcolor (the Vertex Colors node), but it has a float output instead of a color. It's useful for things like controlling the mix amount of materials and textures, such as with vertex color dirt or vcol-painted masks.

Output

This section contains only one node, the output node. See above for more information on it.

Material

Surface materials. There is one node for each of the materials described on the LuxRender_Materials page. With the exceptions of the volume and emission outputs, these are the only nodes that can be attached to the green shader sockets. A node from this list should always be connected to the "surface" socket on the output node. If you want your object's surface to be invisible, use the "null material" node.

Texture

A set of textures. The imagemap and normalmap textures can be found at the top of the list. A variety of procedural textures are here as well, along with the "smoke data" node which can convert smoke simulations for LuxRender.

Volume

This section contains the volume shaders. These nodes are the only ones that can be connected to the interior/exterior volume sockets on the output node

Light

This section contains a single, special node: the area light node. If you want objects with your material to act as mesh light, add one of these nodes, and connect it to the "emission" socket on the output node. (it will not work anywhere else). It has the standard mesh/area light options, and you can connect any color nodes to the "light color" socket.

Fresnel Data

A special subset of input nodes for adding fresnel data. They represent the textures listed on the LuxRender_Textures_Fresnel page.

Converter

A variety of mixing and conversion nodes.