Table of Content
- Node Materials
- Standard Nodes
- Engine-Specific Nodes
- Clamp (B4W_CLAMP)
- Glow Output (B4W_GLOW_OUTPUT)
- Levels of Quality (B4W_LEVELS_OF_QUALITY)
- Parallax (B4W_PARALLAX)
- Reflect (B4W_REFLECT)
- Refraction (B4W_REFRACTION)
- Replace (B4W_REPLACE)
- Smoothstep (B4W_SMOOTHSTEP)
- Time (B4W_TIME)
- Translucency (B4W_TRANSLUCENCY)
- Vector View (B4W_VECTOR_VIEW)
- Linear to SRGB and SRGB to Linear (Deprecated)
Shader nodes extend significantly the potential of Blender’s standard materials by means of presenting shading as a batch of basic transformations.
Blend4Web supports all standard Blender nodes, but some of them do not work fast enough and are not recommended to use in real time applications. Creating very complex materials, especially using large numbers of
Texture nodes, is also not recommended.
Cycles nodes are only partially supported: in most cases they will not work in Blend4Web the same way they do in Blender. They also might not work at all or even cause material in which they are used to work incorrectly. However, using Cycles nodes will not cause instabilities in the application workflow.
Standard node performance and degree of support is described in the table.
|Camera Data||Used to obtain data from an active camera||Full||Average|
|ColorRamp||Used to generate gradient||
|Combine HSV||Combines a color from the given Hue, Value and Saturation||Full||Average|
|Combine RGB||Combines a color from the given red, green and blue channel values||Full||High|
|Extended Material||Used to add a material
to the node program.
Has more input and
output channels than
|Gamma||Used to set gamma of a given color||Full||High|
|Geometry||Used to obtain information about object’s geometry||
||Using large numbers of these nodes is not recommended|
|Hue/Saturation||Used to control Hue and Saturation of a given color||Full||Low|
|Invert||Inverts a given color||Full||High|
|Lamp Data||Used to obtain information from a given light source||
|Mapping||Used to transform texture coordinates||Full||Average|
|Material||Used to add a standard material to the node program||Full||Average|
|Math||Used to perform mathematical operations with given values||Full||High|
|MixRGB||Mixes two given colors||Full||Low in the
|Normal||Used to generate a normal vector||Full||High|
|Normal Map ||Used to plug in normal map||Full||Average|
|Output||Outputs the result of the node program||Full||Average|
|Particle Info||Used to obtain information about particle system||In the materials of the
|RGB||Generates an RGB color||Full||High|
|RGB Curves||Sets a curve to modify a given color||Full||Average|
|RGB to BW||Desaturates a given RGB color||Full||High|
|Separate HSV||Separates a given color into Hue, Saturation and Value||Full||High|
|Separate RGB||Separates a given color into red, green and blue channels||Full||High|
|Squeeze Value||Squeezes given value||Full||High|
|Texture||Sets a texture||Full||Using large numbers of these nodes is not recommended|
|Value||Generates a numeric value||Full||High|
|Vector Curves||Sets a curve to modify a given vector||Full||Average|
|Vector Math||Used to perform mathematical operations with two given vectors||Full||High|
|Vector Transform ||Converts Vertor, Point or Normal between World, Camera and Object coordinte spaces||Full||Average|
|||If at least one of the internal parameters, |
Engine-specific nodes extend functionality of the standard nodes to support extra features. These nodes are created as node groups (
Node Groups or
Node Tree) with specially determined names and input formats. For convenience, all special nodes are added to a blend file when it is opened.
The node limits the output value. As a result all the output vector components take values from 0 to 1 inclusive.
- Incident vector.
- Clamped vector.
Applies the Glow effect to the node material. Besides the B4W_GLOW_OUTPUT node, the node material should have the Output node.
- Glow Color
- Glow color.
Glow ratio. Factor \(\in [0, 1]\).
- Factor = 0 - no glow.
- Factor \(\in (0, 1]\) - there is a glow, colored with Glow Color.
Sets up the output color based on the current image quality settings. Can be used to, for example, replace complex material with more simple one if the application is running on a mobile device.
- Node links this parameter to
Colorparameter in case of high and maximum quality usage.
- Node links this parameter to
Colorparameter in case of low quality usage.
- This value specifies what quality setting (
LOW) will be visible in the Blender viewport. Can change from 0 to 1. If the value is lower than 0.5, the
HIGHsetting will be visible, if it is 0.5 or higher, the
LOWsetting will be visible.
The node implements the texture coordinates offset using a height map.
- Source texture coordinates.
- Height Map
- RGBA texture with a height map packed into the alpha channel.
- Texture coordinates offset factor.
- The number of steps for iterative generation of texture coordinates offset. The bigger this value is the better is the final quality.
- Lod Distance
- Maximum distance from camera at which the effect is observed.
- Resulting texture coordinates which are used as input for the texture nodes.
Calculates the reflection direction for an incident vector and a normal vector. Can be used to apply a cubemap to an object.
- Incident vector. Should be connected to the
Viewsocket of the
- Normal vector. Should be normalized in order to achieve the desired result. Should be connected to the
Normalsocket of the
- Reflected vector. Should be connected to the
Vectorsocket of the
Texturenode that contains the cubemap.
Applies refraction effect to an object. This effect works only in the Blend4Web engine and not in the Blender’s viewport.
- A normal vector in camera space for adding perturbations.
- Refraction Bump
Value of perturbation strength.
The default value is 0.001.
- Rendered texture behind object with perturbations.
It’s necessary to set the
Refractions option from the
Render > Reflections and Refractions panel to value
ON. The object’s transparency type must be set to
- Output color.
The node replaces the inputs depending on the working environment (i.e. Blender viewport or Blend4Web). When working in Blender the
Color1 input is connected to the
Color output and the
Color2 input is ignored. On the contrary when working in the engine the inputs are interchanged (the
Color1 one is ignored and the
Color2 one is connected to the output). The node is intended to display one node structure in the viewport and another - in the engine.
As a rule it is used for normal mapping. Blender’s node materials do not support a tangent space of coordinates. Therefore, the only possible method to display normal maps in the viewport correctly is their usage inside the
- Node setup that will be visible in the Blender viewport.
- Node setup that will be visible in the Blend4Web engine.
- Should be connected to the
Colorsocket of the
Performs smooth interpolation between two input values based on first value.
- Value which determines interpolation smoothness.
- First interpolation value.
- Second interpolation value.
- Interpolated value.
For the correct interpolation input
Value had to be between
Provides the timeline counting from the engine start (in seconds). Can be used for animating any parameters in node materials, such as UV coordinates, mixing factors, transparency etc.
The node implements a translucency effect (with respect to light sources only) for thin objects such as cloth, leaves, paper etc. The effect consists of two parts: 1) brightening of the object side which is opposite to the light source and 2) appearance of a light spot right in the light source place.
- One-channel texture which defines material heterogeneity - the white color denotes maximum translucency effect while the black color denotes its absence. White color is used by default.
- Backside Factor
Material color correction coefficient for the side which is opposite to the light source. It describes the color richness effect for the translucent areas.
- Backside Factor < 1 - brightening
- Backside Factor = 1 - no correction
- Backside Factor > 1 - darkening
The default value is 1.
- Spot Hardness
- Light spot blurring factor. The bigger this value is the smaller is the spot and the sharper are the spot edges. The default value is 1000.
- Spot Intensity
- Light spot intensity. The bigger this value is the brighter is the light spot. The default value is 1.
- Spot Diffuse Factor
Material diffuse color influence on the light spot color.
- Spot Diffuse Factor = 0 - the light spot has the diffuse color
- Spot Diffuse Factor = 1 - the light spot color is white
The default value is 1.
The node transforms a vector into the camera’s space of coordinates. Transformation is necessary because the engine defines most vectors in the world space of coordinates. If normal vector is being transformed by this node it should be used only for effects and not for connecting to the output of the
Extended Material nodes.
- Vector coordinates in the world-space.
- Vector coordinates in the camera-space.
Converts colors from linear space to sRGB or vice versa. This function has been declared deprecated since the version 15.04. In the newer versions, the native
Gamma node with the value of 2.200 should be used to convert color from sRGB to linear space, and the same node with the value of 0.455 to convert color from linear space to sRGB.