Last updated
Was this helpful?
Last updated
Was this helpful?
Published: ??? by Last documented edit: Sep 19 2024 by
This page contains information on .mesh files and their properties.
See -> for a guide on export/import
To edit a mesh's appearance, check
If you just want to use a textured material, check
To learn about mesh materials, see
To hide parts of a mesh under different circumstances, check
To stop copy-pasting so much, check
In the context of Cyberpunk, a mesh is the file that defines the and the of an object in the game world.
A mesh can have several submeshes, each of which has own material assignments. You can learn more about this on the sub-page for .
Mesh files for inanimate objects also tend to contain extensive physics parameters governing their physical weight and general behavior.
There are two ways of adding shadows to meshes:
To make a mesh cast a real-time shadow, set the component's property castShadows
to Always
.
Depending on your geometry, this can impact performance.
Many meshes have dedicated shadow meshes, which have a much lower level of detail and will be hidden by default. You can open any clothing item's mesh entity to see this in action.
You can see which submesh is which in the Mesh Preview
tab after opening the mesh file:
With the boxes on the left, you can toggle submeshes on and off.
An appearance
is the entry point into a mesh.
One appearance
has a number of chunkMaterials
, which tell Cyberpunk how they are supposed to look:
Wolvenkit will follow these entries to materialEntries, where they are defined:
Summary:
Assign material for submesh in appearance -> chunkMaterials
Register the material by name in materialEntries
Define the material in either localMaterialInstances.materials
or externalMaterials
Here's an overview:
You assign materials based on the "chunks" (the individual submeshes) inside a mesh. Open the mesh file in Wolvenkit and open the "appearances" array, then make sure that each of your submeshes has an entry inside the array.
Materials are registered in the array materialEntries
inside your mesh:
Many of CDPR's early meshes use preloadLocalMaterialInstances
instead of localMaterialBuffer.materials
. As far as we are concerned, you can use the two interchangeably, but:
If you are using a mix of local and external materials, you must use the corresponding lists:
If you mix the two, the materials outside of preload
… will appear as transparent the first 1-2 times you trigger your item's appearance.
The materials themselves are inside the array localMaterialBuffer.materials
(or preloadLocalMaterials
in case of older meshes).
A material instance looks like this:
Meshes are loaded via (e.g. ). Components are defined either in files or in an , where each has its own array.
For more information on this, please check ->
Submesh numbers correspond directly to a component's property. For technical reasons, the chunkmask dropdown supports up to 64 entries — just ignore the missing numbers.
This section describes how materials are assigned inside each mesh. To learn more about submeshes and chunkmasks, check .
This page only contains mesh-specific information. Find more details on materials under .
The index
property in materialEntries will finally point at the material's instance, where you can find its properties. Depending on isLocalInstance
, that can be one of several places — find a list in .
You can find more information on this under .
While you can mix external and local materials, you can not mix preloaded and non-preloaded ones. For details, see .
A material's actual definition (instance) can be in a CMaterialInstance
inside the mesh or in a in the project. Wolvenkit will display material names as defined in the materialEntries
, making it easier for you to see what's what.
For more details on material instances, check ->
You can't go wrong by using those. However, if you don't have any properties that are unique to your mesh or appearance (for example a custom normal map), you might consider .
You can find a guide about and in the Modding Guides section.
For an overview of existing materials, check .
For how to find out which properties a material has, check .
A relative path to an external material, usually encapsulated in a . Use this if you don't need to add extra properties.
index
numerical index of corresponding material in target list (as defined by isLocalInstance
)
isLocalInstance
Selects the material target list.
True: local material in localMaterialBuffer.materials
or preloadLocalMaterialInstances
False: material reference inexternalMaterials
or preloadExternalMaterials
For more information on this, see the page for local/external materials.
name
unique name of material, used to select the material via chunkMaterial
localMaterialBuffer.materials
externalMaterials
preloadLocalMaterialInstances
preloadExternalMaterials
Documentation on .mesh files and their properties.