2024 1.0 Help

Example - The Input Node

Intro

The Input Node is the replacement for the Spot Info node from LightWave 2015. That provided access to information regarding the current hit point being evaluated. For surfaces, that basically meant for each pixel of the rendered surface.

As a comparison between the two nodes we can color the surface of two objects with the help of a gradient.

First, let's use the World Position output of the Item Info node to control the gradient. Item info returns the position of the object's pivot point. The whole surface has the same color, depending on the position of the object. World Position is a vector output and the Input for a Gradient is only a scalar, but if you move your object around you should see its whole colour change.

Input_node_02.gif
Input_Node_02.jpg

Now, let's use the World Position output of the Input node to control the gradient. This gives us an individual colour for each spot of the surface. Since we are using World Position output, the colour here also changes depending on the position of the object.

Input_Node_01.jpg

Maybe it would be useful to collect a few use cases for the input node on this page. The Node Editor context is in brackets.

1. Surface Side (Surface Editor)

Description: Determines if the intersection hit the front (output = 0) or back (output = 1) of the surface. This allows you to separate the front and back sides of a polygon (surface).

A very simple setup, but often usable. Usually a polygon has only one visible side, from the other it is invisible. If you switch it to double-sided, it will have the same material on both sides. With a simple node setup you can assign two different materials to the front and the back side of the polygons.

Surface_Side_01.jpg
Tuch_001.jpg

2. Bounce (Surface Editor)

Description: The number of bounces the ray has taken to reach this intersection (starts at 1). Two simple light gray metallic cubes reflect each other. Bounce output from the input node controls a gradient. With each bounce the cubes change their colour.

Bounce_01.jpg

3. Instances (Instance Generator)

Ok, this is not an example for the Surface editor but for the Instance Generator. Like the other node editors, this one also has an input node.

Description: Outputs the base position of the instance. In this scene the output is used to determine if the individual instance is inside another object. The Ray Cast Geometry node is used for this purpose. The gradient outputs black or white.

Base_Posion_01.jpg

The idea behind this is that all instances that are not inside the object are scaled to 0 (become invisible). What remains visible are the instances that form the shape of the object. Here they are lego blocks...

LegoCrest_01.jpg
LegoCrest_02.jpg
Base_Posion_02.png

To be honest, Razor Crest is not the most suitable object for this purpose. It has parts that are too thin.

4. Lights (Light Properties)

Download icon Volumetric Light Scene

This is a really quick example for the light node editor.

Description: Outputs the distance from the light source. We can use this to colour the light beam.

I used a spot light with Affect Volumetrics turned on (enable Volumetric Scattering in Render Properties, too) In the light Node Editor I used a gradient to color the light depending on the length of the beam.

Input_Node_Light_01.jpg

With the help of a Curve node you can shape the light beam. The Curve node controls the size of an image (a white circle on a black background) and thus the diameter of the light beam. The image is multiplied by the gradient.

Input_Node_Light_02.jpg

I added a Ripples texture.

Input_Node_Light_03.jpg
Volumetric_Light_06.gif

Addendum to Input Node Example 4:

You can, of course, animate the positions of the keys of the gradient and curve.

Volumetric_Light_09.gif

For the curve node I used Channel Follower to follow a scalar node (scalar(1)) that also controls the position of the last key of the gradient.

Volumetric_light_01.jpg

Some notes: Since I wanted to have some noise that would not disturb the outer shape of the flame I added a texture only to the key positions of the gradient (not to the curve node).

Because I wanted stripes instead of specks I use a 2D texture in the Z axis (the direction in which a light looks by default).

With a 3D texture (specks):

Turbulence_02.jpg

With a 2D texture on the z axis (streaks):

Turbulence_01.jpg

Some more notes: You can really do crazy things with this setup. This is what it looks like when you take a square image instead of a circle image and rotate it around the Z axis depending on the Distance.

Quad_Shape_01.jpg

And here combined with the Curve node.

Quad_Shape_02.jpg

5. Item ID (Surface Editor)

Description: Outputs the Item ID. The Item ID has encoded the item type too (That's why it's so long and confusing). For what I have in mind, I do not need this additional information. Therefore I simply subtract the unnecessary value and get a numbering of the objects starting with 1.

For example, you can use this numbering to control a gradient.

Item_ID_03.jpg
Item_ID_002.jpg

If you clone the object now, you automatically get different surfaces.

Item_ID_001.jpg

Here are only 5 objects, but of course it works for hundreds.

This could be solved with instances too, but sometimes clones are necessary... :)

Kegel_MB_v006.gif

6. Geometric Normal, Smooth Normal (Surface Editor)

Description: Outputs the un-interpolated geometric normal (Geometric Normal) and interpolated normal (Smooth Normal) as a Vector.

In this example, I blend between the Smooth Normal and the Geometric Normal. An animated black and white image controls the gradient. This simple example could be solved faster in compositing but this method works in 3D space with animated objects too.

Normals_03.gif
Input_Node_Normals_01.jpg

Note: In order to use the Smoothed Normal output you need to check Smoothing in the Surface Editor.

Input_Node_Normal_04.jpg
Input_Node_Normal_02.jpg

You can also control the blending with a weight map.

7. Ray Type (Surface Editor)

Description: Outputs the ray type (Camera ray, Reflection ray, Refraction ray, Dissolve ray, Shadow ray and Occlusion ray). You can use it to switch between materials depending on the ray type. This means that a surface can change its appearance when you look at it through glass, for example.

X-Ray_01.gif

Note: The Ray Type Switch node seems to work without Ray Type input (The manual is not clear on this). However, it is still useful. You can also use the Ray Type output to control a gradient and switch almost everything depending on the Ray Type. Of course, you can also use it for less noticeable but useful things like enhancing the brightness of a reflection and so on.

Input_node_Ray_Type_01.jpg

8. Item Position (Nodal Displacement)

Description: Outputs the position of the item. The Input Node gives us the pre animated position of the IK controller so we can modify it using the Ray Cast geometry node.

Positionlimits_02.jpg

To walk on uneven terrain.

Groundcontrol_04.gif

or, um...

Positionlimits_12.gif

With a Ray Cast Geometry node you can calculate the height of the terrain. Now you just add the Y position of the original animation and you get the new height for the IK controller.

Ray_Cast_01.png

Note: In the original example with the spider, I don't use the Input Node at all yet. The example is older and I don't remember why I didn't use it then. But it shows very well what you can avoid with the help of the input node.

9. Current Position (Nodal Displacement)

Download icon Match deform Scene

Description: Outputs the current deformed vertex position in object coordinates (Vector). You need it when you use the Deform nodes (among others).

Here is a simple setup for the Bend node. We hook Current Position from the Input node into Point Position on Bend deformer. Two null objects control the bend (base and handle).

Bend_deformer_01.jpg
Bend_02.gif

You can plug the individual Deform nodes one after the other. The output goes into the Point Positions input of the next one. Here is a simple node tree with scale, twist and bend deformer. Additionally a Turbulence texture is added to make it more organic. That's all it takes to create the deformation.

Bend_deformer_02.jpg
Zuendholz_01.jpg
Zuendholz_02.gif

10. Ray Weight (Surface Editor)

Description: Outputs the accumulated weight of the ray represented as a color. Here we use it to create an antialiased mask for a surface. The nativ Surface ID buffer is not antialiased (for good reason), but sometimes you need an antialiased surface mask.

To generate a mask, you must first create a custom buffer (Render Properties > Buffer tab).

Render_Buffer_01.jpg

In the Surface Editor of the desired surface, plug the Ray Weight output into the new created buffer input.

Render_Buffer_02.jpg

Done.

B_17_02.gif

11. Fixed Random/ID Index (Instance Generator)

Description: Outputs a random scalar between 0 and 1 (Fixed Random) or the ID of each instance (ID Index). In this example I use it to control the rotation of the instances.

Cars_001.jpg

Normally, you can easily create a random rotation of instances. To do this, set a minimum and maximum rotation for the desired axis in the Rotation tab.

Cars_instance_01.jpg

However, if you want a random rotation in fixed steps, this does not work here.

Cars_002.jpg

A simple node setup does the job. You control a gradient with the Fixed Random output. The gradient has two keys with a value of 0 and 314.159 both set to Step. The unit for the rotation is radian. 314.159 means 180° (actually it is 3.14159 but internally Lightwave reads 100% as 1 ..... :mad:).

Cars_instance_03.jpg

I prefer to use an angle node instead because I don't always want to convert to radians.

Cars_instance_04.jpg
Cars_003.jpg

Of course, you can extend the rotation to a small range around 0° and 180° so that not all cars are completely straight.

Cars_004.jpg

Because I control the color of the cars also with the fixed random output all cars of one color are in the same direction. This is not so noticeable here but can be very annoying in other situations. To correct this, I'm adapting the setup a bit. The ID Index output now provides the seed input for a **Random Scalar ** node, which controls the gradient. The Add node gives the possibility to change the seed easily.

Cars_instance_05.jpg
Cars_005.jpg

Finally, I added a little randomness to the offset (position).

Cars_006.jpg

Note: if you want to use the Node Editor to control rotation you have to set the rotation to Uniform in the Rotation tab of the Instance Generator.

Addendum to example 11

You can easily create the usually double rows. If we take a closer look at the instance ID, we see that all even and odd instances form a row. LD Instance IDs shows the instance IDs:

Cars_ID_overlay_002.jpg

We can use this to offset every second instance by 3.4 meters on the Z axis. A gradient with the value 0 for the first key (position 0 = first instance ID) and a value 340 for the second key (position 1 = second instance ID) is set to repeat. This alternates between moving one car and not moving another.

Cars_instance_06.jpg

I also added a random offset so that it is not so regular. This gradient uses the Fixed Random output as input, has two keys and is switched to Linear.

Cars_instance_07.jpg
Cars_007.jpg

With this method, you can also easily arrange all the parking spaces at an angle.

Cars_008.jpg

Enough with cars....

Parkplatz_01.gif

12. World Position and Geometric Normal (Surface Editor)

Description: Outputs the location of the intersection in world coordinates as a vector (World Position). And the un-interpolated geometric normal as a vector (Geometric Normal). In this example, the World Position gives us the spot position and the Geometric Normal gives us the direction for the Ray Trace node.

Scatter_03.gif

After breaking a porcelain statue with bullet dynamics we are challenged with the following problem. When rendering materials like porcelain, which absolutely need sub surface scattering you can see the fracture lines shining through before breaking.

Breaking_01.jpg

You can easily replace the object with an unbroken one for rendering before breaking, but once the collapse has started, this won't work any more. Larger pieces that have not yet broken show the fracture lines, too. This setup is used for the surface of the fracture edges. We want to make it invisible while the object is still whole. For this we use the output of the gradient as a clip map. The idea behind is that for each point, the Ray Trace node looks at how far away the nearest geometry is and thus determines whether the edge is visible to the camera or is still hidden inside the object. If it is still hidden inside the object it will be clipped by the clip map and it cannot cause shadows in the sub surface scattering of the porcelain.

The node setup and the result:

Node_setup_01.jpg
Breaking_02.jpg

Note: As some may know LightWave has its own solution for this problem: Dynamics Part Info provides an Internal Polygon output that can be plugged into the Clip input of the Surface Node Editor.

Dynamics_Part_Info_01.jpg

So what's the point of another homemade solution? Unfortunately, Dynamics Part Info only works for dynamic parts (as the name implies), which means that if you bake the bullet simulation as an mdd, Dynamics Part Info understandably no longer works.

13. Base Position (Instance Generator)

Description: Outputs the base position of the instance as an Vector. We use this to measure the distance to another object and scale the instanced object to have exactly the length of the distance. This allows you to create instanced connections between two objects that also scale properly in the animation. In this case springs.

Feder_04.gif
Spring_002.jpg

Finally, I set the rotation mode of the instances to Target and select the other object as Target Item.

Spring_003.jpg
Spring_001.jpg
Feder_02.gif

14. Object Position (Surface Editor)

Description: Outputs the location of the intersection in local coordinates as a vector. In this example I use it to colorize the individual tiles (parts) of a mosaic in a single color using an image texture as source. Each tile should be one color.

Part_Color_001.gif

If you use an image as a color map, the individual tiles of the mosaic will be multicolored. But most real mosaic consists of single colored tiles.

Part_Color_001.jpg
Part_Color_002.jpg

A close up to see what is going on:

Part_Color_003.jpg
Part_Color_004.jpg

Here is the node setup: We add the position of the part center to the position of each spot and use it to move the texture for each spot (think about it before you go to sleep...).

Part_Color_007.jpg

Furthermore, we can use this setup to create a custom roughness value for each tile. Again our node setup controls the position of a texture, this time of a turbulence texture.

Part_Color_008.jpg

Note: I use Part Move from DPKit here to rotate each tile a little bit. This is important for a real look, because in real life the tiles never lie completely flat. By the way, this also applies to windows of a house, especially skyscrapers. They should never be perfectly rotated in order to break up the reflection.

Part_Color_002.gif

This setup could be great for motion graphics that use parts.

_p.s.: This fresco from Pompeii (Italy) portrays Sappho, a female Greek poet_C

27 January 2025