From 2736605fa55ff0da05802e52036713e5027623cb Mon Sep 17 00:00:00 2001 From: gortnarj Date: Mon, 22 Apr 2019 19:07:25 +0200 Subject: [PATCH] Update documentation --- docs/documentation/README.md | 7 +- docs/documentation/batch.md | 23 ++- docs/documentation/converting.md | 45 ++++- docs/documentation/designer.md | 45 ++++- docs/documentation/groups.md | 308 ++++++++++++++++++++++++++++++- docs/documentation/index.html | 6 +- docs/documentation/interface.md | 14 +- docs/documentation/material.md | 26 ++- docs/documentation/painter.md | 86 ++++++++- docs/documentation/quickguide.md | 15 +- docs/documentation/substance.md | 2 +- docs/documentation/templates.md | 17 +- docs/documentation/theme.css | 12 +- docs/documentation/workflow.md | 78 +++++++- 14 files changed, 657 insertions(+), 27 deletions(-) diff --git a/docs/documentation/README.md b/docs/documentation/README.md index 070dd9f..5e0b65e 100644 --- a/docs/documentation/README.md +++ b/docs/documentation/README.md @@ -1,12 +1,9 @@ -# VMT EDITOR +# VMT EDITOR USER GUIDE > Free open source editor for vmt files. -## Documentation - This documentation is intended to provide you with useful information on how to set up and use VMT Editor and Substance Shaders. ![](images/vmt-01.png) - -?> This documentation is still a work in progress. + diff --git a/docs/documentation/batch.md b/docs/documentation/batch.md index 15d496c..ac8396c 100644 --- a/docs/documentation/batch.md +++ b/docs/documentation/batch.md @@ -1 +1,22 @@ -# Batch material creation \ No newline at end of file +# Batch material creation + +You can use VMT Editor to quickly batch create multiple .vmt files. + +!> In order to use this function you need to have the VTF files ready in the game materials directory. You can convert your textures with [Convert to VTF](converting.md#convert-to-vtf-dialog) dialog first. + +1. Create your base material that has all the parameters you want to have in your batched files. This also includes adding textures. + +2. Open the _Batch VMT_ dialog from the _Tools_ menu. + +3. Click on add and select only diffuse textures. VMT Editor automatically adds the normal, specular, glossiness and other textures based on the texture suffixes in your base material. + +?> This means that if your diffuse is named `floor01` and your bump `floor01_normal`, the suffix for bump will be set as `_normal`. Batched material for `metal01` will then have `metal01_normal` inserted into the bumpmap slot. + +?> If your diffuse is named `floor01` and your bump `ground01_normal`, all the batched VMT files will have `gorund01_normal` inserted into bumpmap slot. + +!> Unfortunately, this doesn't work if your diffuse already has a suffix, as it compares all the texture names with diffuse. + +4. Press on _Batch_ to create materials for all the textures selected in the list. + +?> You can use _Batch VMT_ to quickly create materials for all skybox sides. If you're using half height sides you have to make the top and bottom materials separately. + diff --git a/docs/documentation/converting.md b/docs/documentation/converting.md index b72fbfd..9adf40b 100644 --- a/docs/documentation/converting.md +++ b/docs/documentation/converting.md @@ -1,5 +1,48 @@ # Converting textures +One of the main features of VMT Editor is converting source texture files into .vtf files used by Source engine materials. + +There are two main ways of doing this - automatically when importing textures or by opening the _Convert to VTF_ dialog. + ## Automatic conversion -## Convert to VTF dialog \ No newline at end of file +To use automatic conversion you can either: + +- Drag and drop the texture directly into the text field +- Browse to the texture file + +?> You can also drag and drop multiple textures onto the VMT Editor window (not in any text field) and they will be automatically sorted into their appropriate slots depending on their suffix. Works for diffuse, normal, specular, glossiness and tint mask. + +Textures will be converted by the settings specified in the [Options](options.md#texture-conversion). It uses DXT1 for non alpha textures and DXT5 for textures with an alpha channel. + +After conversion textures will be copied into the directory of the currently open material. If material is not yet saved, they will be copied after the first save. + +If you've made changes to the source texture you can reconvert by clicking on the two arrows at the end of the text field, or reconvert all the textures by pressing F9. + +You can downscale the texture by half by clicking on the scale button at the end of the text field. + +If you want to access more options for converting the texture you can click on the three lines button and it will be opened in the _Convert to VTF_ dialog. + +!> Keep in mind the settings are not saved, so you'll have to open the dialog again if you want to reconvert the texture. + +You can also add alpha channels to diffuse and bump textures. Just drag or browse to your mask in the text field that appears once you've added a texture to the diffuse or bump slot. + +?> For example, this is useful if you have separate diffuse, normal and specular textures. Since you're not able to use a separate spacular map if you're already using a normal, you can add the specular map to the alpha channel of the normal and enable _Bump alpha mask_. + +!> Combining only works with PNG and non RLE compressed TGA files. + +## Convert to VTF dialog + +Convert to VTF dialog behaves similarly to VTFEdit import dialog with a few key differences. + +?> Renaming settings from options are preserved. + +You can convert multiple textures with the same settings at once by clicking on the _Add..._ button and selecting your textures. + +You can specify the output directory in the _Output_ slot. Empty means it will use the source texture location. + +Click on the _Convert_ button to convert all the textures in the list. A checkmark appears next to converted textures. + +You can select a template to quickly access common settings. + +?> If you open an image with VMT Editor, it will open in the _Convert to VTF_ dialog. \ No newline at end of file diff --git a/docs/documentation/designer.md b/docs/documentation/designer.md index 4c0b9cd..68b0109 100644 --- a/docs/documentation/designer.md +++ b/docs/documentation/designer.md @@ -1,8 +1,51 @@ # Substance Designer shader -Hello +Substance Designer shader is designed to emulate both `LightmappedGeneric` and `VertexLitGeneric` shaders. ## Previewing +To add a texture to the shader preview, right click on any node in the graph and select _View in 3D view_, then select the appropriate slot. + +!> At least one light needs to be active for the specular highlight to work. + +Shader behaves differently depending on what shader it's emulating. + +_LightmappedGeneric_ mode can only use one map for envmap and specular mask, which is used by the slot `specularmask`. +Specular highlight can additionally be masked with modulated diffuse, depending on the _Mask Contrast_. +Specular highlight has no fresnel. + +_VertexLitGeneric_ mode can use different maps for `envmapmask` and `specularmask`, and can make use of `Glossiness` and `Metallic` maps. + +?> You can use the same node as both `envmapmask` and `specularmask`. + +Metallic map only tints the highlight with the color of the diffuse. You need to pack the metallic map in the green channel of glossiness map for export and use in source. +Envmap fresnel is dependent on both _Fresnel ranges_ and `Metallic` map. + ## Settings +First switch changes the shader between `LightmappedGeneric` and `VertexLitGeneric` mode. + +_Enable Environment Map_ enables and disables cubemap reflections. + +_Envmap Tint_ behaves the same as [Reflection](groups.md#reflection) group _Tint_ or `$envmaptint`. + +_Envmap Blur_ is a setting that you can use to fake lower cubemap sizes. Only used in Designer preview. + +_Envmap Fresnel_ is the same as [Reflection](groups.md#reflection) group _Fresnel_ or `$fresnelreflection` or `$envmapfresnel` depending on selected shader. + +_Specular Diffuse Mask Contrast_ is the same as [Specular](groups.md#lightmappedgeneric-specular) group _Mask contrast_ or `$phongmaskcontrastbrightness`. + +_Specular Tint_ is the same as [Specular](groups.md#lightmappedgeneric-specular) group _Amount_ and _Tint_ or `$phongamount` and `$phongtint`. + +_Specular Fresnel Ranges_ is the same as [Specular](groups.md#vertexlitgeneric-specular) group _Fresnel_ or `$phongfresnelranges`. + +_Specular Glossiness_ is the same as [Specular](groups.md#vertexlitgeneric-specular) group _Glossiness_ or `$phongexponent`. + +_Specular Boost_ is the same as the [Specular](groups.md#vertexlitgeneric-specular) group _Amount_ and _Boost_ or `$phongamount` and `$phongboost`. + +_Use Glossiness Map_ switches between the specified `Glossiness` input or the _Specular Glossiness_ slider. + +_Use Metallic Map_ enables the `Metallic` input. To use it in the VMT it needs to be packed into the green channel of the `Glossiness` map. + +_Metallic Boost_ boosts the specular in the parts masked with the `Metallic`. Same as [Specular](groups.md#vertexlitgeneric-specular) group _Diffuse tint boost_ or `$phongalbedoboost `. + diff --git a/docs/documentation/groups.md b/docs/documentation/groups.md index 84791aa..0ebc2f7 100644 --- a/docs/documentation/groups.md +++ b/docs/documentation/groups.md @@ -1,37 +1,341 @@ # Parameter groups +Parameter groups consists of all the related parameters for the specified material property, however only the parameters you modify will get added to the .vmt file. + ## Texture +Texture groups is the core group of most materials. It contains the material _Diffuse_ (or albedo or base color) and _Bump_ which is either a normal map or a ssbump map. + +!> You cannot use ssbump on models. + +_Surface_ dropdown determines the physical properties of the materials, like what sound it makes or how bullets penetrate it. + +If you're using a blend material you have an option to specify a second set of _Diffuse_ and _Bump_ textures, however only second _Diffuse_ is required for a blend material. You also have an option to specify a _Blend Modulate_ texture, which controls the border between the two blended textures. + +?> CS:GO can use grayscale blend textures, provided you use the new _Layer Blend_ functions. + ## Detail + Adds a detail texture over the whole material, scales higher than 1 mean smaller than diffuse and lower than 1 mean larger than diffuse. + +_Amount_ controls the visibility of the detail texture. + +You can select the detail blend mode with the dropdown next to the _Amount_ slider. Normal behaves like overlay in Photoshop. + +!> Not all blend modes works in all games. CS:GO only supports blend modes 0, 7, 9, 10, 11, 12. + +## Transparency + +_Opacity_ controls the overall opacity of material, _Translucent_ and _Alpha test_ use diffuse alpha channel. + +?> Translucent is smooth but has sorting issues. Alpha test solves those issues, but has hard edges - useful for materials like foliage or chain link fences. _Alpha to coverage_ allows MSAA to work with alpha test. + +You can control alpha test the cutoff point with threshold. + +_Additive_ doesn't need an alpha channel, black is see through and white is solid (like Photoshop). + +Check _Decal_ if you plan to use the material as decal or overlay. + ## Color +Tints the material. _Color_ is used for brush materials and _Color 2_ is used for model materials. + +_Mask_ is a greyscale mask that controls which areas of the material get tinted (white) and which ones don't (black). Usually used with model tinting in Hammer. + +!> You can't use a mask texture if you use a bump map. It's recommended to place the mask into the alpha channel of the diffuse texture and use the _Diffuse alpha mask_ checkbox. + ## Transform +Texture and Bump Transform allow you to independently change the scale and position of diffuse and bump textures. + +_Centes_ specifies the center coordinate of the scaling and rotation. _Scale_ controls the number of tiles, so a larger value means a smaler scale. + ## Lighting +_Light warp_ is a one dimensional texture that allows you to "gradient map" the lighting. + +!> Looks like _Light warp_ does not work in CS:GO. + +_Reflectivity_ allows you to override the value that VRAD uses when calculating the light bounces. Useful for making materials bounce more light. + +_Seamless scale_ makes material use triplanar mapping, useful for very distorted displacements. + +!> _Seamless scale_ does not support normal maps, only ssbump. + ## Flags +_Tool texture_ is a texture that displays in Hammer texture browser. + +_Keywords_ help you find the texture in the Hammer texture browser. + +_Ignore Z_ makes the material render on top of everything. + +_No fog_ stops the material from reacting to environment fog. + +_Disable CSM lookup_ stops the material from receiving dynamic shadows in CS:GO. Can improve performance with very dense foliage. + ## Specular +Enables phong specular reflections on the material. Group looks different depending on selected shader. + +### LightmappedGeneric specular + +!> Only works in CS:GO + +_Amount_ controls the color as well as the brightness of the specular highlight. Last spinbox brightens and darkens the whole material. + +?> Specular highlight does not change depending on the light color so it's a good idea to tint the specular with your sun color. + +_Glosiness_ controls the size or exponent of the specular highlight. Higher means smaller highlight. + +With _Mask contrast_ and _Mask brightness_ you can adjust the contrast of the specular mask. + +?> Behaves like a ratio, so a value of `[4 2]` is the same as `[2 1]` + +Diffuse luminance is used as default for the specular mask, but you can use alpha channel of either diffuse or bump with _Diffuse alpha mask_ or _Bump alpha mask_. This setting is shared with the _Reflection_ group since you can only have one mask on brushes. + +!> Specular highlight ignores normal map if the material doesn't have a cubemap specified. If you only want specular reflections you can enable cubemap and set the tint to 0. + +### VertexLitGeneric specular + +_Fresnel_ controls the specular highlight brightness when looking at the material from different angles of incidence. F0 means looking directly at the material, while 90 is looking completely parallel to the material. + +?> Surfaces in real life are shinier when looking at them from the side and less shiny when looking diretly perpendicular at the surface. A good starting value for non-metallic materials is `[0.1 0.5 1]`. + +_Boost_ controls the brightness of the specular highlight. + +_Glossiness_ controls the size or exponent of the specular highlight. Higher means smaller highlight. You can also specify a glossiness map which overrides the _Glossiness_ slider. + +?> Glossiness map uses only red channel. You can use green channel of this map as a metallic map, together with diffuse tint. + +_Diffuse tint boost_ only works when you have _Glossiness green channel diffuse tint_ enabled. Controls the amount of tint the specular highlight gets from the diffuse color. Useful for colored metallic looking highlights. + +_Tint_ controls the amount of color tint for the specular highlight. Useful for single color metallic materials without a glossiness map. + +_Warp_ allows you to remap the specular values with a gradient texture. Useful for iridescent effects. + +By default, specular uses the alpha channel of bump for the mask. You can instead use the alpha of the diffuse with _Diffuse alpha mask_. + +?> Unline brush specular, you can use a separate map for both specular and cubemap reflections. + +_Half lambert_ only works on dynamic models and "stretches" the lighting around the whole model. + ## Reflection +Reflection groups controls the static cubemap reflections. + +You can either use the level cubemaps with _Use cubemap_ or specify your own cubemap in the _Reflection_ text field. + +?> You can use the `environment maps/metal_generic_001 - 006` to fake blurred reflections + +For the mask you can either specify a texture or use the alpha channel of either diffuse or bump with _Diffuse alpha mask_ or _Bump alpha mask_. + +!> You cannot use a separate texture if you're using a bump map. + +?> In CS:GO you can also use the red channel of the color mask texture. Only avaiable on models. + +_Tint_ controls the overall brightness and color of the reflection. + +_Fresnel_ on brushes makes the reflection darker when looking straight at the surface. Useful for realistic looking reflections. + +_Fresnel_ on models controls the amount of specular _Fresnel ranges_ and _Diffuse tint_ that get applied to the reflection. + +_Light influence_ makes the reflection get brighter or darker, depending on the lighting. Useful when using a custom cubemap. + +_Anisotropy_ stretches the reflecion downwards. + +!> _Saturation_, _Contrast_, _Light influence_ and _Anisotropy_ don't work on models with a normal map. + ## Self illumination +Adding self illumination makes the material emissive. + +It uses the alpha channel of diffuse for the mask. You can also specify your own texture or use specular map alpha channel. + +_Tint_ controls the brightness and color of the light emission. + ## Normal blend +!> Only works in CS:GO. Brush only. + +Allows you to blend a detail normal map on top of existing normal map. + ## Layer blend -## Emmisive blend +!> Only works in CS:GO. Blend only. + +Enable the effects with _Enable new blend_. Also requires a blend modulate texture. + +_Layer 1 tint_ and _Layer 2 tint_ allow you to tint each blend layer separately. + +?> You can use this to tint the same diffuse texture different colors and blend between them. + +_Blend softness_ controls the softness of the border between the layers. Smaller means harder border. + +_Border strength_, _Border softness_, _Border offset_ and _Border tint_ allow you to create a colored border around the blend point of the two layers. ## Decal +!> Only works in CS:GO. Model only. + +Allows you to specify a texture that uses the model's second UV set to apply decals over the diffuse. + ## Tree sway +!> Does not work with a normal map. + +Simulates foliage swaying in the wind. Effect is based around model origin. + +_Height_ and _Radius_ control the distance in world units at which the effect is fully on. + +_Start height_ and _Start radius_ control the portion of the height or radius at which the effects starts to fade in (0-1). + +_Strength_ controls how much the tree sways. + +_Speed_ controls how quickly the tree sways. + +_Falloff_ controls the falloff of the sway, higher means the core of the tree is more stable. + +_Scrumble strength_ controls how much the leaves move. + +_Scrumble speed_ controls how quickly the leaves move. + +_Scrumble frequency_ controls the size of the sine wave applied to scrumble motion. Usually 10-25. + +_Scrumble falloff_ controls the falloff of the scrumble motion, higher means the core of the tree is more stable. + +_High wind multiplier_ controls the multiplier of the motion at wind speeds. Starts _Lerp start_ and is fully on at _Lerp end_. + ## Rim light +Adds a rim light effect around the models that is always visible. + +_Exponent_ controls the size and _Boost_ controls the brightness. + ## 4 Way Blend +!> Only works in CS:GO + +Allows you to blend 4 materials instead of just regular two. Each texture has its own independent scale and blend controls. + +_Blend value_ of each texture controls the sharpness of the blend transition. + +_Blend range_ controls the texture luminance values that are used for the blend transition. _Blend factor_ controls the amount of this blend. + +!> 4 Way Blends can only use two bump maps and two surface materials. Which surface material is used is still controlled by the alpha channel of the displacement. + ## Water -## Refract \ No newline at end of file +?> Only avaiable when Water shader is selected + +Base group of the Water shader, here you can specify basic properties of the water material. + +_Normal_ is the normal map that's used for the water surface, can be static or animated. + +?> Most water materials use a static normal map and add animation in shader with a flowmap. + +_Bottom material_ is used to specify the material that appears when you go under water. Usually has the same parameters as the top material, except with no reflection, bottom material and _Bottom_ checked. + +_Force expensive_ and _Force cheap_ are deprecated in newer games, though most water materials still use _Force expensive_. + +_Bumpframe_ allows you to specify the start frame of the animated normal map. Usually animated with proxies. + +?> Use the _Animated texture_ proxy +```Proxy +AnimatedTexture +{ +animatedtexturevar $normalmap +animatedtextureframenumvar $bumpframe +animatedtextureframerate 30 +} +``` + +## Water - Flow + +Allows you to add an animated flow effect to the water by using a single static flowmap texture. + +!> When using _Flow_, the normal map scale is controlled by _Normal map size_ in world units. The texture scale in Hammer instead controls the size of the flowmap. You can use _Flow debug_ to see the flowmap in Hammer and align it to your water surface. This means that the material scale in Hammer is usually very big, around `10 - 20` + +_Flowmap_ is a texture that specifies the direction of the water flow. Red channel is X direction with 127 being still and green channel is Y direction with 127 being still. + +_World UV scale_ is the scale multiplier of the flowmap. Usually 1. + +_UV scroll distance_ is the relative amount the water moves in a single cycle. + +_Time scale_ is the multiplier of flow cycle speed. + +_Time interval_ is the duration of a single cycle in seconds. + +_Bump strength_ controls the amount of normal map. + +_Noise scale_ controls the scale of the _Noise texture_ that is used to break up the water repetition. Usually very small. + +## Water - Fog + +Controls the underlying color of the water. + +?> This means the darkest color the water will be. To achieve realistic results use dark (blue) fog color, usually around 20 brightness. Brighter colors result in murkier looking water. + +Water will fade into the specified _Fog color_ after number of units specifies in _Fog start_ and _Fog end_ + +Check _Volumetric fog_ to enable this effect. + +Use _Lightmap fog_ for the water to be able to have shadows cast on it. + +_Flashlight tint_ controls how much the flashlight affects the water color. + +## Water - Reflection + +Controls the water reflections. + +?> Check _Real time reflection_ to enable the effect. + +_Tint_ controls the color of the reflection. + +?> To achieve good looking results the reflection tint should not be very saturated and depending on the fog color should be darker if the fog is brighter. + +_Amount_ contrils the distortion amount applied to the reflection, with `0` looking like completely still water. + +!> _Reflect 2D skybox_ is needed for water to reflect the skybox in CS:GO + +_Only skybox_ only reflects the 3D skybox. Works only in L4D2. + +!> Use `$reflect3dskybox 1` (additional parameter) for the water to reflect 3D sky in CS:GO. + +_Reflect entities_ makes the water reflect all point entities, including prop_statics. Wihtout it water only reflects brushes and displacements. + +_Only marked entities_ makes the water reflect only point entities that have the _Render in cheap reflections_ set to `1` in Hammer. + +_Texture_ allows you to specify a static texture that will be visible as a reflection. Rarely useful. + +?> If you don't want to have a real time reflection, add a normal _Reflection_ group and specify a cubemap. Water _Reflection_ group still controls the tint though. + +## Water - Refraction + +Controls the distortion when looking through the water surface. + +_Tint_ controls the tint of the refraction. Only visible before water fog is fully opaque. + +?> Use a different refraction tint than fog color to have the effect of water being a different color in the shallow areas. + +_Amount_ controls the distortion amount. + +## Water - Scroll + +An older effect for animating the water surface. Overlays the normal map on itself and scrolls it into two directions specified. + +!> _Scroll_ cannot be used together with _Flow_. + +## Refract + +Base group of refract shader. + +Allows you to specify two normal maps that get overlayed together. + +?> Use the `Scroll` proxy to scroll the normal maps in different directions. + +_Tint_ controls the color of the surface. Can also specify a texture. + +_Amount_ controls the distortion amount. + +_Blur_ controls the amount of blur behind the surface. \ No newline at end of file diff --git a/docs/documentation/index.html b/docs/documentation/index.html index 4fac4c7..6193f79 100644 --- a/docs/documentation/index.html +++ b/docs/documentation/index.html @@ -4,9 +4,13 @@ VMT Editor - + + + + +
diff --git a/docs/documentation/interface.md b/docs/documentation/interface.md index b7a728a..d52de6c 100644 --- a/docs/documentation/interface.md +++ b/docs/documentation/interface.md @@ -16,9 +16,15 @@ The _Parameters_ tab is where the most of the main functionality of the VMT Edit Here you select the shader, depending on the use of your material. Most of the time this would be either _LightmappedGeneric_ for brush textures and decals, _WorldVertexTransition_ for displacement blend materials or _VertexLitGeneric_ for model materials. Next to the groupbox are buttons to quickly select the appropriate shader. -### Toolbar +### Texture preview -Toolbar that contains shortcuts for the most used parameter groups. Other groups can be found under _Add..._ menu item, or you can add any missing parameters under the _Additional Parameters_ tab. +On the left side of the parameter groups are the previews of the textures currently used in the material. Preview also reacts to some parameters like color tint or transparency. + +There's also a preview of masks that are used for reflection or specular, even if they're located in alpha channels of other textures. + +You can enlarge the preview by clikcing on it and close it by right clicking. + +!> VMT Editor does not support previewing textures inside game package files. ## Proxies tab @@ -28,6 +34,10 @@ Edit proxies or other nested parameters with syntax validation and autocompletio Here you can add all the parameters VMT Editor doesn't have native support for. Parameters usually require `$` or `%` in front of the parameter name. +## Toolbar + +Toolbar that contains shortcuts for the most used parameter groups. Other groups can be found under _Add..._ menu item, or you can add any missing parameters under the _Additional Parameters_ tab. + ## VMT Preview VMT Preview contains the preview of the .vmt file that will be exported. You can also write your own parameters directly in the preview and click the _Parse_ button to save them. diff --git a/docs/documentation/material.md b/docs/documentation/material.md index 7d56992..3983c8f 100644 --- a/docs/documentation/material.md +++ b/docs/documentation/material.md @@ -1,7 +1,31 @@ # Material creation +Creating materials consists of adding parameter groups and modifying elements within those groups. Most shaders already have the default _Texture_ parameter group visible. + +You can add additional parameter groups with the _Add..._ menu or by using the toolbar on the left side of the window. + +Parameter groups consists of all the related parameters for the specified material property, however only the parameters you modify will get added to the .vmt file. + +?> What each group does is described in the [Parameter Groups](groups.md) section. + ## Text fields +Text fields are used to specify different texture files. If you already have .vtf files you can either browse directly to them or type the path into the text field. + +?> If the file is located outside of the currently selected game directory it will be copied to the location of current saved material. + +!> Textures located in the .vpk or .gcf files will show up as missing, but they will work in game. + +Text fields can also convert your source texture files into .vtf files, different methods are described in the [Converting Textures](converting.md) section. + ## Sliders -## Colors \ No newline at end of file +Sliders are used to control most of the scalar parameters. Though it may seem like they only go up to a certain value, you can manually type the value into the spinbox and the slider will adjust its range. + +## Colors + +Most color selectors are paired with a slider that you can use to control the color's brightness. This also allows the color values to go above `[1 1 1]`. + +?> Colors may look different after saving and opening a material, especially with darker colors. VMT Editor splits the brightness and color part when loading a material, but the end result should be the same. + +?> Color is automatically converted from sRGB to linear for certaion parameters like `$color`. \ No newline at end of file diff --git a/docs/documentation/painter.md b/docs/documentation/painter.md index 7fbc9bf..35bf6e9 100644 --- a/docs/documentation/painter.md +++ b/docs/documentation/painter.md @@ -1,9 +1,89 @@ # Substance Painter shader -this is it +Substance Painter shader is designed to emulate the look of `VertexLitGeneric` shader. + +Select the `source` shader in the _Shader Settings_ rollout. + +?> Add a Fill layer on top of your stack with _Diffuse_ and _Specular_ channels with your AO texture. Set them to multiply to get nicer looking reflections and more defined shapes. + +## Channels + +Shader uses the following Painter channels: + +- Diffuse (sRGB8) +- Normal (RGB16F) +- Height (L16F) +- Specular (L16/L8) +- Glossiness (L16/L8) +- Metallic (L16/L8) +- User0 (L16/L8) (Envmap mask) +- User1 (L16/L8) (Color mask) + +Not all materials need all channels so use only the ones you need. Keep in mind each additional channel means more texture space. + +You can add or remove the channels in the _Texture Set Settings_ rollout. ## Templates -## Settings +There's two templates included: _Source base_ and _Source extended_. + +_Source base_ only includes the most used channels - Diffuse, Normal, Height and Specular. + +_Source extended_ includes all the avaiable channels. + +!> If the model appears black after opening a template, reselect the shader in the _Shader Settings_ rollout. + +## Export presets + +There are several export presets that depend on the use case: + +- _Source All_ exports all the channels, with `Envmap mask` in `Diffuse` alpha and `Specular` in `Normal` alpha. +- _Source Base_ exports `Diffuse` with `Specular` alpha +- _Source Base+Spec_ exports `Diffuse` with separate `Specular` +- _Source Normal_ exports `Diffuse`, and `Normal` with `Specular` Alpha +- _Source Normal+Tint_ exports `Diffuse` with `Color Mask` alpha and `Normal` with `Specular` Alpha + +You can edit or make your own eport presets by clicking on the _Configuration_ tab in the _Export textures_ window. + +## Shader Settings + +_Common parameters_ is a default Painter group and has no effects on the shader. + +_Diffuse Color_ is the same as [Color](groups.md#color) or `$color2`. + +_Envmap Tint_ behaves the same as [Reflection](groups.md#reflection) group _Tint_ or `$envmaptint`. + +_Envmap Fresnel_ behaves the same as [Reflection](groups.md#reflection) group _Fresnel_ or `$envmapfresnel`. + +_Use Specular Channel_ makes the envmap reflection use the _Specular_ Painter channel. If left unchecked it uses the _User0_ channel instead. + +_Enable Envmap_ enables and disables envmap reflections. + +_Fresnel Ranges_ behaves the same as [Specular](groups.md#vertexlitgeneric-specular) group _Fresnel_ or `$phongfresnelranges`. + +_Specular Boost_ behaves the same as the [Specular](groups.md#vertexlitgeneric-specular) group _Boost_ or `$phongboost`. Boost values may vary from Source shader to a real material. + +_Specular Glossiness_ behaves the same as [Specular](groups.md#vertexlitgeneric-specular) group _Glossiness_ or `$phongexponent`. + +_Use Glossiness Channel_ switches between using the _Glossiness_ channel input or the _Specular Glossiness_ slider. + +_Use Metallic Channel_ enables the _Metallic_ channel input. To use it in the VMT it needs to be packed into the green channel of the `Glossiness` map. + +_Metallic Boost_ boosts the specular in the parts masked with the `Metallic`. Same as [Specular](groups.md#vertexlitgeneric-specular) group _Diffuse tint boost_ or `$phongalbedoboost `. + +_Light Color_ changes the color of the light shining on the model in the preview. + +## Gloss wizard + +Gloss wizard is a Painter filter included with the Source shader. It automatically creates the _Specular_, _Glossiness_ and _Envmap mask_ channels from either _Roughness_ or _Specular_ channel information. + +Drag the wizard on the top of your layer stack, but below AO if you have any. Note that your project needs to have the _Specular_, _Glossiness_ and _User0_ (Envmap mask) channels for it to work. + +Select _Use Roughness_ to use the _Rougness_ channel information. Otherwise it will use the _Specular_ channel. + +_Specular Adjust_ adjusts the curve of the _Specular_ channel. + +_Gloss Curve Adjust_ adjusts the curve of the _Glossiness_ channel. + +_Envmap Mask Cutoff_ adjusts at which value the envmap reflections start to fade in. -## Channels \ No newline at end of file diff --git a/docs/documentation/quickguide.md b/docs/documentation/quickguide.md index 1afda01..90ff0b2 100644 --- a/docs/documentation/quickguide.md +++ b/docs/documentation/quickguide.md @@ -1 +1,14 @@ -# Quick guide \ No newline at end of file +# Quick guide + +After you've installed the VMT Editor you're ready to start making your own materials. + +?> You don't need to use any external tools to convert the textures, all can be done in the VMT Editor. + +First, make sure the game you're making materials for is selected. Then select the appropriate shader either with the dropdown or by clicking on the buttons next to the dropdown. + +To import textures simply drag and drop the source files into appropriate slots or use _Browse_ to look for your textures. + +Use the toolbar on the left side or the _Add..._ menu to add different material effects such as detail textures or reflections. + +Once you save the material, VMT Editor will copy the converted .vtf files to the material location. If you make changes to your source files you can simply click on the two arrows icon at the end of the text fields to quickly reconvert testures to .vtf. + diff --git a/docs/documentation/substance.md b/docs/documentation/substance.md index 627f21a..a876aa5 100644 --- a/docs/documentation/substance.md +++ b/docs/documentation/substance.md @@ -12,7 +12,7 @@ Copy the contents of the `shaders` folder to `...\\resources Copy the shader to your Painter shelf. -?> Drag the `source.glsl` file onto your Painter window. In the dialog that appears select type _shader_ and import into your shelf. +?> Drag the `source.glsl` file onto your Painter shelf. In the dialog that appears select type _shader_ and import into your shelf'shelf'. To install the templates copy both `templates` and `export-presets` to your shelf folder. diff --git a/docs/documentation/templates.md b/docs/documentation/templates.md index 307ff19..8099fa1 100644 --- a/docs/documentation/templates.md +++ b/docs/documentation/templates.md @@ -1,2 +1,17 @@ # Templates -## Creating templates \ No newline at end of file + +You can create and use templates to speed up your workflow. The parameters in the template will be automatically added to your open material. + +!> This also means that the shader and parameters from the template will overwrite any parameters currently set. + +You can apply them by going into _File > Templates_ and selecting a template. + +## Creating templates + +Templates are created the same as any other material. + +Change the parameters you want to have in the template, then go to _File > Save as Template..._ Template should then appear on the list of templates and ou should be able to use it. + +VMT Editor already includes some example templates that you might find useful. + +?> Templates are stored in the `templates` folder inside your VMT Editor instalation directory. If you want to edit or delete a template you can do it from there. \ No newline at end of file diff --git a/docs/documentation/theme.css b/docs/documentation/theme.css index c5ab795..0301e5d 100644 --- a/docs/documentation/theme.css +++ b/docs/documentation/theme.css @@ -1,4 +1,4 @@ -@import url("https://fonts.googleapis.com/css?family=Work+Sans:400,600|Montserrat:400,600|Roboto+Mono"); +@import url("https://fonts.googleapis.com/css?family=Work+Sans:400,600|Montserrat:400,600|Source+Code+Pro"); * { -webkit-font-smoothing: antialiased; -webkit-overflow-scrolling: touch; @@ -58,7 +58,7 @@ body { -webkit-font-smoothing: antialiased; color: #333; font-family: 'Work Sans', 'Helvetica Neue', Arial, sans-serif; - font-size: 18px; + font-size: 16px; letter-spacing: 0; margin: 0; overflow-x: hidden; @@ -215,7 +215,7 @@ main.hidden { color: #383838 !important; } .sidebar { - font-family: 'Montserrat', Arial, Helvetica, sans-serif; + font-family: 'Work Sans', Arial, Helvetica, sans-serif; text-transform: none; border-right: 1px solid rgba(0,0,0,0.07); overflow-y: auto; @@ -742,7 +742,7 @@ ul .app-sub-sidebar li a{ background-color: #f8f8f8; border-radius: 2px; color: #e96900; - font-family: 'Roboto Mono', Monaco, courier, monospace; + font-family: 'Source Code Pro', Monaco, courier, monospace; font-size: 0.9rem; margin: 0 2px; padding: 3px 5px; @@ -752,7 +752,7 @@ ul .app-sub-sidebar li a{ -moz-osx-font-smoothing: initial; -webkit-font-smoothing: initial; background-color: #f8f8f8; - font-family: 'Roboto Mono', Monaco, courier, monospace; + font-family: 'Source Code Pro', Monaco, courier, monospace; line-height: 1.5rem; margin: 1.2em 0; overflow: auto; @@ -844,7 +844,7 @@ ul .app-sub-sidebar li a{ border-radius: 2px; color: #525252; display: block; - font-family: 'Roboto Mono', Monaco, courier, monospace; + font-family: 'Source Code Pro', Monaco, courier, monospace; font-size: 0.8rem; line-height: inherit; margin: 0 2px; diff --git a/docs/documentation/workflow.md b/docs/documentation/workflow.md index 65d0819..235c875 100644 --- a/docs/documentation/workflow.md +++ b/docs/documentation/workflow.md @@ -1,3 +1,79 @@ # Workflow -## Yes \ No newline at end of file +Here are some workflow examples for different types of materials. + +## Concrete + +`LightmappedGeneric` shader. + +Textures required: diffuse, normal. + +1. Drag both diffuse and normal into VMT Editor window to automatically convert them. + +2. Set the _Surface_ to `Concrete`. + +3. Add _Specular_ group. + +4. Set the _Amount_ color slightly orange to mimic the sun color. + +5. Set the _Glossiness_ to around `10-25`. + +6. Load up the material in game, then adjust the _Mask contrast_ amount until you get a more pronounced specular effect. You can also adjust the _Amount_ to compensate for darkening. + +7. If the concrete normal map is very rough, add the _Reflection_ group, check _Use cubemap_ and set the _Tint_ to `0`. This makes the specular affected by the normal map. + +## Shiny wood floor + +`LightmappedGeneric` shader. + +Textures required: diffuse, normal, specular. + +1. Drag your textures into the VMT Editor window to convert them. They should get automatically sorted into _Diffuse_, _Bump_, and _Bump alpha_ slots. + +2. Set the _Surface_ to `Wood`. + +3. Add _Reflection_ group. + +4. Check _Use cubemap_ and _Bump alpha mask_. + +5. Set _Fresnel_ to around `0.95`. + +6. Load up the material in game, build cubemaps, then adjust the _Tint_ brightness to get the material to fit in the environment. + +## Car paint + +`VertexLitGeneric` shader. + +Textures required: diffuse, normal, specular (optional), tint mask (optional). + +For best results make the car paint part of the model its own material. + +?> Make the diffuse based on a white car so you can easily make more variants with _Color_. + +1. Drag your textures into the VMT Editor window to convert them. They should get automatically sorted into _Diffuse_, _Bump_, and _Bump alpha_ slots. Drag the tint mask into _Diffuse alpha_ (optional). + +2. Add _Color_ group. Check _Diffuse alpha mask_ (optional). + +3. Add _Reflection_ group. + +4. Check _Use cubemap_ and _Bump alpha mask_. + +5. Set _Tint_ to around `0.5` and _Fresnel_ to `1`. + +6. Add _Specular_ group. + +7. Set _Fresnel_ to `0.2 0.6 1.0`, _Boost_ to `4` and _Glossiness_ to `50`. + +8. Decide on the color of your car. This method requires you to make separate materials for each car color instead of tinting the model in Hammer. + +?> You can use online car configurators to find realistic colors. + +9. Set both the _Color 2_ and specular _Tint_ to that color. This creates a metallic looking highlight. + +10. Load up the material in game, build cubemaps, then adjust specular _Boost_ and reflection _Tint_ to better match the environment if necessary. + + + + + +