Updated documentation with export / command line arguments changes

This commit is contained in:
RodZill4 2020-03-10 22:44:29 +01:00
parent 2b46a6936d
commit 3ccd3d2e04
7 changed files with 99 additions and 10 deletions

View File

@ -0,0 +1,18 @@
Command line arguments
======================
When launched with no command line argument, Material Maker will start with an empty project.
When launched with the path of a .ptex file as command line argument, Material Maker will
start with this project file. Material Maker can thus be associated to files with .ptex
extension so double-clicking on them will directly open them.
Material Maker can also be used to export several .ptex file with the following command line:
material_maker --export -t <engine> -o <output_path> <input_files>
Where:
* **engine** is the target engine (Godot, Unity or Unreal)
* **output_path** is the path where files will be generated
* **input_files** is the list of input files (wildcards are accepted)

View File

@ -24,7 +24,7 @@ copyright = '2018-2020, Rodz Labs'
author = 'Rodz Labs'
# The short X.Y version
version = '0.8'
version = '0.9'
# The full version, including alpha/beta/rc tags
release = ''

View File

@ -0,0 +1,59 @@
.. _export-section:
Exporting Materials
===================
When exporting a material, using either the Export submenu or the command line arguments,
Material Maker generates PNG image files for all elements of the material as well as
specific files for the target game engine.
In all cases, the generated PNG files (and especially the normal map) is generated in the
correct format.
Godot game engine
-----------------
When exporting for the Godot game engine, Material Maker will generate a .tres file that
describes a fully configured SpatialMaterial.
Note that exporting for Godot is not necessary if you use the Material maker addon, that
provides an import plugin. This import plugin can either generate a precomputed material,
or a material that will be rendered at runtime.
Unity game engine
-----------------
When exporting for the Unity game engine, Material Maker will generate a .mat file that
describes a fully configured material. It is thus possible to export materials directly
into one of your project assets directory, and Unity will automatically detect the newly
exported materials.
Unreal game engine
------------------
When exporting for the Unreal game engine, Material Maker will only generate PNG image
files, and it is necessary to create the material in Unreal.
To create a minimal material:
* import all PNG files into unreal
* create a new material using the **Add new -> Material** menu
* open the new material to edit it
* drag and drop all textures into the material graph to create a Texture Sample node
for each texture
* connect the RGB output of the albedo *Texture Sample* node to the *Base Color* input
of the material node
* connect the R output of the ORM *Texture Sample* node to the *Ambient Occlusion* input
of the material node
* connect the G output of the ORM *Texture Sample* node to the *Roughness* input
of the material node
* connect the B output of the ORM *Texture Sample* node to the *Metallic* input
of the material node
* connect the RGB output of the normal *Texture Sample* node to the *Normal* input
of the material node
More complex materials with support for emission textures, depth maps, texture
coordinate scaling...
.. image:: images/unreal_export.png
:align: center

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

View File

@ -8,3 +8,5 @@ Material Maker User Manual
user_interface
nodes
base_library
export
command_line

View File

@ -21,17 +21,29 @@ Parameters
The **Normal map** node has the following parameters:
* the *format* of the normal map (default, OpenGL or DirectX)
* the *format* of the normal map (default, OpenGL or DirectX). The format should
always be set to "default" when connected to the Normal input of a Material node.
The correct normal map format for the target game engine will be generated when
the material is exported.
* the *size* of the normal map
* the *strength* of the normal map effect
* the *buffer* parameter decides if the input must be stored in a buffer before
generating the normal map. Using a buffer is faster but can create artifacts
in the normal map, and disabling this option will generate more accurate normal
maps. It is recommended to enable the buffer while editing a material and
disable it before exporting.
Notes
+++++
This node outputs an image that has a fixed size.
When using 3D Signed distance functions, it is recommended to use the normal map
generated by the
Example images
++++++++++++++

View File

@ -224,10 +224,10 @@ The main menu bar is organized in 5 menus:
File menu
^^^^^^^^^
* *New material* creates a new material and opens a tab in the right pane to edit it
* *New material* creates a new material and opens a tab in the center pane to edit it
* *Load material* opens a file dialog to select a procedural material (.ptex) file. If
a material file is selected, it will be open in a new tab in the right pane. If the current
a material file is selected, it will be open in a new tab in the center pane. If the current
tab contains an empty material (about material that only consists of a Material node), the
material will be loaded into this tab.
@ -239,12 +239,10 @@ File menu
* *Save all materials* saves all currently open materials. Materials that were already
saved are ignored.
* *Export material* generates PNG image files for all elements of the material. File names are
defined using the path of the **.ptex** material file and their role (albedo, emission...)
in the material.
The Ambient occlusion, roughness and metallic textures are saved into a single file whose
suffix is **orm**.
If the material contains **export** nodes, their textures will be exported as well.
* the *Export* submenu can be used to export the current Material for Godot, Unity
or Unreal. It will prompt for a file name and generate PNG files for all components
of the material. Exporting to one of those engines is described in the
:ref:`export-section` section.
* *Close material* closes the current material.