Skip to content

Instantly share code, notes, and snippets.

@edecoux
Created September 3, 2022 07:28
Show Gist options
  • Select an option

  • Save edecoux/044d6b74471c3a0cf548d2776fbce9bf to your computer and use it in GitHub Desktop.

Select an option

Save edecoux/044d6b74471c3a0cf548d2776fbce9bf to your computer and use it in GitHub Desktop.
UE5.md

UE5

Nanite geometry

Virtual Texturing

Materials

  • Materials are constructed through a network of visual scripting nodes (called Material Expressions) within the Material Editor
  • Each node contains a snippet of HLSL code, designated to perform a specific task
  • This means that as you construct a Material, you are creating HTML5 code through visual scripting

Working with Colors and Numbers

Much of the work of a Material is simply manipulating these numbers based on a series of circumstances and mathematical expressions.

Materials use floating point values to store color data. This generally means that values for each channel will range from 0.0 to 1.0, instead of 0 to 255 as they do in some image editing applications.

Textures

These are simply images that provide some sort of pixel-based data

A single material may make use of several textures that are all sampled and applied for different purposes

PBR

  • Physically based techniques attempt to simulate reality; that is, they use principles of physics to model the interaction of light and matter.
  • Physically based Materials will work equally well in all lighting environments.
  • Material values can be less complex and interdependent, resulting in a more intuitive interface.
  • There are four different properties

Base Color

defines the overall color of the Material, taking in a Vector3 (RGB) value where each channel is automatically clamped between 0 and 1.

If taken from the real world, this is the color when photographed using a polarizing filter (polarization removes the specular of nonmetals when aligned).

Roughness

The Roughness input controls how rough or smooth a Material's surface is.

Mapping Roughness

Roughness is a property that will frequently be mapped on your objects in order to add the most physical variation to the surface.

Metallic

The Metallic input controls how'metal-like' your surface will be. Nonmetals have Metallic values of 0 and metals have Metallic value of 1.

For pure surfaces, such as pure metal, pure stone, pure plastic, etc. this value will be 0 or 1, not anything in between.

Specular

To update a Material's Specular, input a scalar value between 0 (non-reflective) and 1 (fully reflective)

The default Specular value is 0.5. For very diffuse Materials, you may be inclined to set this to zero.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment