The example explained in this article is creating a blend between a mud material, and a mud-leaves material using a mask (Alpha) texture.
>> The scanned PBR materials in demonstrated in this post are from Texture Haven (texturehaven.com)
How does it work? There is actually no blending of Unreal materials, but rather a regular Unreal material in which each of the parameters is defined as a linear blend between 2 different source values for that parameter.
We could create such a material blueprint that uses a Lerp (Linear Interpolate) node’s to provide each of the material parameters with a blend of 2 input textures/colors or parameters, connecting the alpha texture to all the Lerp nodes’s Alpha input, and effectively achieve blending of 2 different materials, but it would be a complex blueprint in which it’s very inconvenient to design each of the individual materials participating in the blend:
This complexity can be greatly simplified by collecting each of the participating materials parameters into a Material Attributes data structure.
The Material Attributes data structure contains all the data needed to compile a material, and allows input, output, and processing of this data as a single blueprint data stream (connection).
For example, when the material parameters are grouped as a Material Attributes data structure, they can be blended by connecting them into a single BlendMaterialAttributes node, instead of “Lerping” (blending) between 2 inputs to create each individual material parameter, which produces an unworkable complex material blueprint like the previous example.
> To collect material parameters into a Material Attributes data structure, connect them into a MakeMaterialAttributes node:
> To create a blend between 2 Material Attributes data streams, use the BlendMaterialAttributes node:
* The Alpha parameter determines the weights of the blend (a black and white texture can be connected to it as the blend mask)
> In order for the material output to receive a grouped Material attributes input instead of individual inputs for each parameter, select the material output, and in the Details panel, check the Use Material Attributes option:
Using the Material Attributes data structure, the blended material’s Blueprint in now much simpler and cleaner, while producing the exact same result as before:
But designing 2 different materials within one material Blueprint is still far from being ideal..
What if we want to use just one of these materials on some surfaces?
What if the individual materials are not as simple as the materials shown here, it would be mush more efficient to be able to have one Blueprint for each of the materials allowing to focus on its development and preview it.
We can achieve this desired workflow by developing each of the materials as a Material Function.
Each of the participating materials is created as a Material Function with a Material Attributes output.
> One of the huge advantages of UE4’s material editing is that it allows us to preview a full material while developing it as a Material Function.
* This may sound trivial, but it isn’t. the Material Function isn’t compiled by itself as a material, it just produces data needed to define a material. in many other media production systems, this would have meant that you can develop data within the function but only preview it in the main material where the function is used.
The Material Function defining the mud-leaves material:
The Blend material using the Material Function nodes:
Note:
When blending a non-metallic material with a metal material, the alpha values (mask colors) should be only 0 or 1 (black or white), otherwise blend areas that have a mid-range metallic value will make no sense visually.
> A RemapValueRangenode can be used to force a color threshold on the mask texture or value.
Having to remap a value range is very common in designing shaders, whether it’s to perform a traditional “levels” operation on a texture, or use just a specific range of values in a float input.
The RemapValueRange node let’s us do just that. this node has 5 inputs:
Input: The input value
Input Low: Input mapping range minimum
Input High: Input mapping range maximum
Target Low: Output range minimum
Target Height: Output range maximum
Mono Noise examples:
The original noise pattern:
Mapping input 0 -> 1 to output 0 -> 1 obviously has no effect:
Mapping input 0 -> 1 to output 0.3 -> 0.7 reduces the pattern contrast:
Mapping input 0.3 -> 0.7 to output 0 -> 1 increases the pattern contrast:
Mapping input 0 -> 1 to output 1 -> 0 inverts the pattern:
In this example RemapValueRange nodes are applied to a texture’s individual color channels to increase contrast (Levels): > Note that this operation can be performed using a simpler graph by using float3d adding and multiplication operations on the texture color (this will be a subject for a different post) > Note that a different remapping operation can be performed on each color channel of a texture to adjust its color balance.
Before the value remapping:
After the value remapping tha value in each channel 0.1 -> 0.9 to 0.0 to 1.0:
The same operation performed by multiplication by 1.2 and subtracting 0.1:
CG-Lion Architectural Glazing Presets Pack 1.0 is an custom architectural glazing shader I developed for Cycles render engine, that provides easy setup of real world architectural glazing surfaces, and ships with 40 ready to use material presets.
The shader has architecture-friendly real world parameters like ‘frosted‘, ‘milky‘, ‘smoked‘ glass etc., has convenient built-in inputs for effects like selective sand blasting or selective graphic coating and is internally optimized for transparent shadow casting.
Software: 3ds max 2019 | V-Ray Next | V-Ray next GPU
In V-Ray Next (4) for 3ds max, a new Metalness parameter has been added to the Reflect parameters of the VRayMtl material.
This allows for easy creation of realistic metal materials and also effectively enables a PBR workflow with V-Ray.
When the Metalness parameter is set to 1.0, the material becomes completely reflective, the Diffuse color controls the general reflection color, and the Reflect color (which should generally be set to white) controls the reflection color at grazing incidence angle.
The IOR parameter still controls how fast will the main reflection color (set by the Diffuse color) blend into the Reflection color, and I don’t know whether some form of complex Fresnel has been implemented or if it’s just a dielectric simple Fresnel blended over a reflective surface.
The UE4 Fresnel node is actually a “Facing Ratio” node (aka Perpendicular / Parallel) with some extra control.
It basically allows controlling material effects according to the incident angle the surface is viewed at, which is a hugely important feature for designing advanced material effects.
Exponent:
The steepness of the value / angle curve.
Base Reflect Fraction:
The value at perpendicular angle.
Normal:
An option to connect World Space surface normals input to affect the output of the Fresnel node.
* Tangent Space normals must be converted to World Space by using a Transform Vector node.
Note:
A value of 1.0 for the Exponent parameter, and a value of 0.0 for the Base Reflect Fraction will produce a linear “Facing Ratio” (“Perpendicular / Parallel”) falloff blend.
Create a new material, and double click it to edit it.
In the Details panel, under Material, set Blend Mode to Translucent.
In the Details panel, under Translucency, set Lighting Mode to Surface Translucency Volume.
Set Base Color to White.
Set Metallic to 1.
Set Roughness to 0.
Create a Fresnel node and connect it to the Opacity input.
In the Fresnel node, set Base Reflect Fraction to control reflection amount in perpendicular surface viewing angle (front).
* Note that its connected to Opacity, but since the material is basically a flat mirror, when it’s not purely transparent it will be reflective.
In the Fresnel node, set Exponent to control the reflection amount falloff curve from perpendicular surface viewing angle (front) to parallel surface viewing angle (sides).
* Higher values will create a steep falloff curve, resulting in less reflection in most viewing angles.
Material Parameters and Material instances allow you to create a customizable material template that can be easily reused with variations across the project.
In the Parent Material, you define the parameters that will be exposed for tweaking in the Material Instances.
Changing the Parent Material will affect all its instances.
Defining customizable parameters in the Parent Material:
Create 3VectorConstant. (press 3 and left click the blueprint background)
* Parameters can also be created with other types of data like a Constant or a Texture Sample and more.
Right click the 3Vector node you created and choose Convert to Parameter.
In the Details Panel, name the parameter.
Creating the Material Instance:
Right click the Parent Material and choose Create Material Instance.
Name the Material Instance.
Double click the Material Instance to edit it.
In the Details panel, under Parameter Groups you will be able to edit the exposed parameters and create a variation of the material.
UE4 Material Blueprint Numerical Vector Parameters / Constants and Colors are one and the same, which makes perfects sense, since in computer graphics colors are in fact 3D vectors, RGB quantities being equivalent to XYZ spatial dimensions (4D with an Alpha channel)
But take note that when setting the Vector values in the color picker you can’t set negative values, and when doing so through the Details window in Default Value you can.
* You can create 3D Vector Constants by clicking the background while pressing 3