Materials

The puzzles from this category perform various operations with materials and textures.

Materials visual programming blocks

Contents

Puzzles Reference

assign material

Assigns a material to an object, completely replacing the old material. Also works for a list of objects, a group (or a list of groups) or with the all objects puzzle.

Visual programming block to assign material

This puzzle requires a material which must be assigned to some existing model (can be hidden), kinda a swatch card:

Assigning material in configurator

Also, the source and destination meshes should have the same layout for UVs and color attributes, e.g in Blender:

UVs in Blender

In some situations, namely when a normal-mapped material is assigned to an object without normal mapping, this puzzle might render your material completely black. If this happens, disable mesh attributes optimization in the export settings:

Disabling geometry optimization in Blender
Disabling geometry optimization in 3ds Max
Disabling geometry optimization in Maya

replace texture

Replaces a texture found for a specified material with the one loaded from the provided image URI, video asset, or canvas.

Visual programming block to replace textures

Puzzle options:

enable "once ready do" slot
Show/hide the slot for puzzles which will be executed right after the texture is done loading.
flexible texture input
Allow using text puzzles inside the "texture" input instead of the default dropdown selector.

For usage example, check out the Custom Image demo (source files available in the Asset Store).

To use transparent videos, encode your content in WebM or HEVC format and set the material type to Blend (see: transparency in Blender / Max / Maya).

get texture param

Retrieves the following parameters for a texture found for a specified material: width, height, aspect or dimensions.

Visual programming block to get texture param

set color

Set R, G and B components of a color parameter found for a specified material.

Visual programming block to set material color

You can add RGB nodes in your node-based materials and their names will be shown in the dropdown menu. In addition, Base Color (or Color) inputs for BSDF Principled, BSDF Diffuse and BSDF Glossy nodes are also accessible.

Blender material with customizable color

In case of glTF-compliant PBR materials, the BaseColor and Emissive inputs are only accessible with this puzzle.

You can add Controllers in your materials (standard or physical) and their names will be shown in the dropdown menu. In addition, Diffuse (or Base Color) color inputs for standard or physical material nodes are also accessible.

3ds Max material with customizable color

In case of glTF-compliant PBR materials, the Base Color and Emission inputs are only accessible with this puzzle.

You can add Color Constant nodes in your materials and their names will be shown in the dropdown menu.

Maya material with customizable color

In case of glTF-compliant PBR materials, the color and emissive inputs are only accessible with this puzzle.

This puzzle can also be used to modify the environment shader. In the drop-down, the name of the environment shader starts with "Verge3D_Environment".

For more information on materials available to Verge3D users, please refer to Material system overview chapters of this manual: Blender, 3ds Max, Maya.

get color

Get color parameter found for a specified material:

Specify flexible color input parameter to assign custom material parameter as string value.

Visual programming block to get material color

set value

Set a value parameter found for a specified material.

Visual programming block to set material value

You can add Value nodes in your node-based materials and their names will be shown in the dropdown menu.

Blender material with customizable value

In case of glTF-compliant PBR materials, the following inputs are accessible with this puzzle: metalness, roughness, bumpScale, emissiveIntesity, and envMapIntensity.

You can add Controllers in your materials (standard or physical) and their names will be shown in the dropdown menu.

3ds Max with customizable value

In case of glTF-compliant PBR materials the following inputs are accessible with this puzzle: Metalness, Roughness, Bump Scale, Emissive Intensity and Environment Map Intensity.

You can add Float Constant nodes in your material and their names will be shown in the dropdown menu.

Maya material with customizable value

In case of glTF-compliant PBR materials, the following inputs are accessible with this puzzle: metalness, roughness, bumpScale, emissiveIntensity and envMapIntensity.

This puzzle can also be used to modify the environment shader. In the drop-down, the name of the environment shader starts with "Verge3D_Environment".

For more information on materials available to Verge3D users, please refer to Material system overview chapters of this manual: Blender, 3ds Max, Maya.

get value

Get a value parameter found for a specified material. Specify flexible value input parameter to assign custom material parameter as string value.

Visual programming block to get material value

get material

Retrieves the name of a material assigned to an object. If multiple materials are assigned to the same object, returns the first one.

Visual programming block to get object material

texture from text

Creates an image from specified text and returns it in Data URL format.

Texture from text visual programming block

Parameters:

text
input text.
width, height
dimensions of the generated image (in pixels). Power-of-two values are recommended (256, 512, 1024 etc).
font family
font-family CSS property to render the text with. You can use system fonts such as "Arial" or custom fonts loaded with the load font puzzle.
size
size of the text drawn on the generated image (in pixels).
horizontal align
how the text is horizontally aligned on the generated image: center, left, right.
vertical align
how the text is vertically aligned on the generated image: middle, top, bottom.
line height
line height of the text (in pixels). If set to 0, it is auto-detected.
justify
justify the text if enabled, inserts spaces between words when necessary.

Box parameters (activated via "gear" icon):

When activated, the text rendered inside a box container the size and position of which can be tweaked using the following parameters:

box x
Box left edge (in pixels).
box y
Box top edge (in pixels).
width
Box width (in pixels).
height
Box height (in pixels).

Color parameters (activated via "gear" icon):

text color
the color of the text.
background color
the color of the background.

In the example below, the image generated from text is used on a model via the replace texture puzzle:

Creating texture from text with visual logic blocks

color picker

Return selected color as CSS value.

Color picker visual programming block

compose color

Compose color from linear RGB (or RGBA with alpha input enabled) components and return it as CSS value.

Compose color visual programming block

generate normal map

Converts an image to normal map and returns it in Data URL format.

Visual logic block to generate normal maps

Parameters:

(source image)
image URL, usually black and white height map. Also images in Data URL format can be supplied such as the output of the texture from text puzzle.
strength
linear factor affecting the height. Recommended values: 0.01 to 5.
level
exponential factor affecting the height. Recommended values: 4 to 10.
blur / sharp
blurriness/sharpness factor in the Gaussian filter. Recommended values: -10 (blur) to 10 (sharp).
filter
selector between Sobel or Scharr algorithms used for edge detection.
invert R
invert direction in the normal map's R channel. At the moment this must be disabled for Blender, 3ds Max, and Maya but may require enabling for some other tool supported in the future.
invert G
invert direction in the normal map's G channel. Must be enabled for compatibility with 3ds Max’ normal map space but left disabled for Blender/Maya.
invert height
change interpretation of height to make darker pixels correspond to lower height.

In the example below, the normal map generated from a loaded image is used on a model via the replace texture puzzle:

Generating normal maps with logic blocks

enable/disable wireframe

Enable or disable wireframe rendering for a specified material. Can be used as a non-photorealistic rendering technique, for debugging, or performance optimization.

Enable wireframe rendering with visual programming

Having Troubles with Puzzles?

Seek help on the forums!