Skip to content

Latest commit

 

History

History
132 lines (67 loc) · 9.79 KB

File metadata and controls

132 lines (67 loc) · 9.79 KB

Configuring materials

Checking material properties

You can see a material's default properties by opening the .(re)mt file in WolvenKit and inspecting the parameters array. Any properties that you don't overwrite by adding them to your CMaterialInstance or .mi file will take the default properties specified in the file.

Roughness/Metalness

A roughness/metalness preview. Yes, it's not a sphere.

Multilayered Material

For a full documentation, check the corresponding page.

To set it up, use these keys for the "values" array of your material:

GlobalNormal path\to\normal.xbm
MultilayerMask path\to\mask.mlmask (white file)
MultilayerSetup path\to\material.mlsetup

an example multilayered material

Textured Material

The most commonly used material for anything textured is engine\materials\metal_base.remt. Despite its name, this material isn't necessarily metallic.

You can also use this material as emissive, for a documentation, see below.

To make your mesh load a texture, use the following CKeyValuePairs in your material's "values" array:

BaseColor path to your texture.xbm (Diffuse/Albedo)
Roughness path to your roughnessMap.xbm (if you have one)
Metalness path to your metalnessMap.xbm (if you have one)
Normal path to your normalMap.xbm (if you have one)

example use of metal_base.remt as a textured material

The .xbm is a container around the texture. Export the xbm to png via WolvenKit.

If your texture has any brightness issues in-game, toggle around the isGamma flag during import.

The expected isGamma settings are:

normals: false
diffuse/albedo: true
anything that is used in .inkatlas files: true

Further properties

LayerTile

Material scaling (zoom on surface)
> 1 zooms in, >1 zooms out

Plastic

The most commonly used material for anything textured is engine\materials\metal_base.remt. Despite its name, this material isn't necessarily metallic.

To turn the material into plastic, use the following CKeyValuePairs in your material's "values" array:

BaseColorbase\materials\placeholder\white.xbm
Normaloptional: path to your normal map
Roughnessoptional: path to your roughness map
RoughnessBias0.200000003
BaseColorScaleColour as x/y/z values (color picker blend file here)

You can find a ready-to-download template here.

Emissive Material

You can make engine\materials\metal_base.remt glow by adding the correct parameters, or you can poke through the game files and search for emissive > .mi to find Cyberpunk material templates to learn from.

For a list of such templates, check here.

Emissivepath to emissive texture, e.g. engine\textures\editor\white.xbm
The texture works like an alpha mask.
EmissiveEVfloat, e.g. 2.0: emissive brightness. Brightness varies depending on your colour. Unless you want to actively blind people, you might want to stay below 4.
EmissiveColorGlow colour as RGB (copy from e.g. mi_neokitsch_fridge_z_emissive.mi)

Find a ready-to-use glowing .mi file here.

Glass

Cyberpunk's glass material, such as base\materials\glass_onesided.mt

All glass materials can consider the vertex color attribute, which you can edit directly in Blender.

Opacityfloat, 0.0 - 1.0: Controls glass transparency.
GlassTintA texture to tint your glass. (TBD: Does it work as a mask?)
TintColorGlass tint as RGB (copy from e.g. mi_neokitsch_fridge_z_emissive.mi).
IORIndex of refraction as float, 1.0-2.0: The refraction properties of your material.
Refraction Depthfloat 0.0-10.0: Control refraction amount here.
FresnelBiasfloat, 0.0 - 2.0: How much does the glass behave like a lens (that is, warp the picture behind it)?
BlurRadiusfloat, 0.0 - 1.0: Blur amount when looking through the glass
VertexColorTintfloat, 0.0 - 1.0: Transparency of vertex colour tint

Find a ready-to-use bottle glass .mi here.

Non-warping glass

For a glass material without view distortion and warping, use base\vehicles\common\materials\glass_windshield_tinted_black.mi

Opacity/OpacityBackFacefloat, 0.0 - 5.0: Controls glass transparency. OpacityBackFace will only affect inside-facing normals.
FrontFacesReflectionPower / BackFacesReflectionPowerfloat, 0.0-10.0: How strongly should the glass reflect?
TintColor/TintSurfaceSurface and refraction color as RGB (copy from e.g. mi_neokitsch_fridge_z_emissive.mi).

Find a ready-to use glass .mi file here

Half-transparent glass

base\environment\decoration\electronics\devices\device_neokitsch\textures\device_neokitsch_glass_black.mi

Device screen glass

base\fx\shaders\parallaxscreen.mt

ParalaxTextureTexture that your screen should display, e.g. base\materials\placeholder\black.xbm
LayersSeparation1
ScanlinesIntensity0
ScanlinesDensity0
Emissive0
Roughness0.200000003
Metalness0

Find a ready-to-use example of a turned-off screen here.

Liquid

Cyberpunk has its own liquid shader(s) such as base\materials\fillable_fluid_vertex.mt. Projecting this material onto a submesh will turn the submesh into a transparent container filled with the liquid you specified. If you flip the container on its head, the fluid will drain to the bottom and fill it up again.

To control the offsets, you need to adjust the vectors FluidBoundingBoxMax and FluidBoundingBoxMin.

It shares various properties (such as IOR, FresnelBias, BlurRadius) with the glass shader.

TintColorliquid's color as RGB (copy from e.g. mi_neokitsch_fridge_z_emissive.mi).
FillAmountfloat, e.g.0.0: Probably works in combination with the bounding box. You'll have to experiment.
FluidBoundingBoxMin
FluidBoundingBoxMax
Vectors (X, Y, Z, W) controlling the maximum distance from the container's walls. Each value is a float (decimal) speficying the axis in question - you'll simply have to play around with them (you can ignore W).

For a bottle material I've used
Max: 0.03, 0.03, 0.155
Min: -0.03, -0.03, 0.09

Find a ready-to use (black) liquid .mi file here.