Enfusion Blender Tools: Materials Preview – Arma Reforger

From Bohemia Interactive Community
Jump to navigation Jump to search
(Add more images)
(Add more images)
Line 65: Line 65:
User can edit material's properties by selecting one of the material slots and panels change according to selected Enfusion shader type (PBRBasic, PBRMulti, etc.).
User can edit material's properties by selecting one of the material slots and panels change according to selected Enfusion shader type (PBRBasic, PBRMulti, etc.).


{{Feature|informative|User can leave any UV source widget blank in case first UV set supposed to be used.}}
{{Feature|informative|User can leave any UV source widget blank in case first UV set supposed to be used.<br>
[[File:armareforger-ebt_materialspreview_uv_1.png]]
[[File:armareforger-ebt_materialspreview_uv_2.png]]
}}


{{Feature|important|
{{Feature|important|
Do not manually edit text field in texture slots widgets!
Do not manually edit text field in texture slots widgets!
[[File:armareforger-ebt_materialspreview_textureslot_field.png]]


User has to use only textures from one of the addon folders defined in Enfusion Tools preferences, in other words, texture must be already registered (have meta file).
User has to use only textures from one of the addon folders defined in Enfusion Tools preferences, in other words, texture must be already registered (have meta file).
Line 79: Line 83:
| style="width: 33%" |
| style="width: 33%" |
Users can take advantage of debug channels like in Workbench.
Users can take advantage of debug channels like in Workbench.
See the feature's location and list of supported debug channels below:
[[File:armareforger-ebt_materialspreview_debugchannels.png]]
Supported channels:
* None
* None
* Albedo
* Albedo

Revision as of 11:00, 13 June 2022

🚧
TODO: add images

Materials Preview (referenced as MP in this document) feature allows to mimic Enfusion shaders in Blender to visually assist users while creating a model from scratch, to help creating additional data like baking textures for last LODs and more. MP feature currently supports loading of MatPBRBasic, MatPBRMulti, MatPBRDecal, MatPBRBasicGlass shader classes. MP feature focuses mainly to support (mimic) core functionality of particular shaders wherever possible, good example is PBRMulti shader, its core functionality is based on layering several materials and textures on top of each other by using various masks.

armareforger-ebt materialspreview comparison1.jpg armareforger-ebt materialspreview comparison2.jpg


because of compression there may be visual differences spotted for example when playing with Alpha Test/Alpha Mul parameters

Please be aware that even though both Blender and Enfusion uses PBR pipeline, it's necessary to point out few facts that makes delivery of exactly the same visual experience in Blender (EEVEE renderer) impossible:

  • PBR implementation in Blender and Enfusion is different
  • there's currently no Shader API in Blender (EEVEE) that could be used to write Enfusion shader "twin", instead Shader Editor has to be used to manually build up a material by connecting various nodes togetherarmareforger-ebt materialspreview shadereditor 1.pngarmareforger-ebt materialspreview shadereditor 2.png
  • nodes provided by Shader Editor doesn't allow to access things like GBuffer or scene lighting information therefore some specific material's properties can't be supported via MP feature
  • PP effects implementation in Blender is different, some PP effects aren't implemented at all
  • shaders in Blender use source texture formats (tif, png...) whereas shaders in Enfusion use compressed edds textures


Features

Materials Import

EBT provides custom FBX Import via EnfusionTools menu, that imports meshes with Enfusion materials.
armareforger-ebt materialspreview fbximport menu.png

In order to successfully import meshes with Enfusion materials, it's expected that:

  • FBX is registered in Workbench (xob and xob.meta files already exists)
  • path to your addon (mod) folder is properly set in EBT addon preferences (EBT will search for source textures there)
    armareforger-ebt materialspreview fbximport path.png
  • meshes have materials assigned
Materials Preview feature can only import materials/textures from within your own addon (expects source textures to be in PNG, TIFF... format), in other words you cannot import materials inherited from Vanilla Reforger.

Loading time depends on model's complexity as well as total number of unique materials/textures that need to be loaded.

Once loading is done, a log of issues (in case there are any) is provided. You can access the log by changing one of the editors to INFO editor. armareforger-ebt materialspreview fbximport infowindow menu.png

armareforger-ebt materialspreview fbximport infowindow example.png
Example of an issue

Logs provides valuable information in case some materials or textures could not be loaded.

armareforger-ebt materialspreview material sync.png

Materials Synchronisation

The feature let user to keep materials synced with Enfusion after FBX Import, in case user makes a change to material in Workbench (changing texture or value), pressing Update Materials button will reflect these changes in Blender.

Valid (absolute) path to xob.meta file has to be provided, note that during EBT custom FBX Import this path gets filled automatically if such file exists.

In case user creates an asset from scratch, before using Update Materials for the first time, FBX must be exported and registered in Workbench, this creates xob.meta file that holds materials mapping, material's name (in Blender) → Enfusion material (emat).

Make sure that changes made to a material in Workbench get saved before Update Materials button is pressed.

armareforger-ebt materialspreview materialsediting ui.png

Materials Editing

Along with Materials import, EBT also allows users to edit supported Enfusion materials. For this, custom panels were added to Material Properties. Note that editing material's properties is local right now, it means that changes can't be exported to Workbench.

User can edit material's properties by selecting one of the material slots and panels change according to selected Enfusion shader type (PBRBasic, PBRMulti, etc.).

User can leave any UV source widget blank in case first UV set supposed to be used.

armareforger-ebt materialspreview uv 1.png

armareforger-ebt materialspreview uv 2.png
Do not manually edit text field in texture slots widgets!

armareforger-ebt materialspreview textureslot field.png

User has to use only textures from one of the addon folders defined in Enfusion Tools preferences, in other words, texture must be already registered (have meta file).

Debug Channels

Users can take advantage of debug channels like in Workbench. armareforger-ebt materialspreview debugchannels.png Supported channels:

  • None
  • Albedo
  • Roughness
  • Metallic
  • World Normals
  • Mask