SteamVR
Yeterli oy yok
Substance Painter to SteamVR Home material workflow
Rectus tarafından
The main shader used in SteamVR Home supports many features but does not conform to the established PBR workflows. Here are some ways to export materials to be used with the SteamVR Wokshop tools.
   
Ödül
Favorilere Ekle
Favorilere Eklendi
Favorilerden Çıkar
Introduction
The vr_standard shader used in SteamVR Home is a Physically Based Rendering (PBR) shader similar to shaders used in other modern game engines. It does however not conform to the spec/gloss or metal/rough workflows directly, so texture maps designed for other games or exported from texturing tools used may need to be modified before they can be used.

As always, any feedback and suggestions are appreciated.

More general information is available in the official Dev Wiki:
Materials, Details and Props, includes an overview about material creation.
Creating a Physics Prop, includes more information about shader parameters.

My old guide on Destinations PBR materials still applies here (some of the information may be outdated).
http://gtm.steamproxy.vip/sharedfiles/filedetails/?id=783210669

Tips

To properly test materials, make sure to use a testing map with map with properly set up lighting. Bake indirect lighting using light probe volumes and cubemaps.

Indirect specular reflections do not show up in the model and material editors when using world cubemaps. To quickly inspect them, the setting can be switched over to artist cubemaps for a default cloudy sky. Don't forget to switch back afterwards.

Use linear color profiles when working with non-color data such as gloss and reflectance maps.
Supported texture maps
Here is a list of the most commonly used maps in the shader.

Color
Equivalent to the Substance Painter Base Color map. This is the surface albedo of both the diffuse and specular lighting. On metallic materials the color of the metal is defined here.












Normal Map
An OpenGL style tangent space normal map with a positive green channel (+Y).














Reflectance
Describes the reflectivity of the material. This determines how much of the incoming light is reflected specularily and diffusely respectively. This is entirely determined by the type of the material, and there are lists available online of what values different materials should have. A good rule of thumb is between 0.05 - 0.1 for non-metallic materials and around 1 for pure metals. Values between that are uncommon apart for thin layers of corrosion or dirt on metals.






Gloss
Controls the smoothness of the surface. Wear and dirt are primarily applied here, so editing this can apply a lot of personality to the material. This should be the texture primarily edited when you want to adjust the reflections. This seems to come out glossier than in Substance Painter, so toning down the levels can help.









Metalness
Primarily affects the specular color, areas where this is enabled tint reflections from the Color map while unaffected areas have untinted reflections. Metallic areas should be white and non-metals should be black.












Ambient occlusion
Map describing how much the surface is occluded from ambient lighting. Mostly useful for models with unique geometry.









Metalness/Roughness Workflow
For metallic models or composite models with both metallic and non-metallic parts, the metal/rough workflow works the best. It is the standard shader for Substance Painter and it supports conversion to spec/gloss maps.

Exporting from Substance Painter
Create your material using the default maps of the pbr-metal-rough shader, as well as ambient occlusion if needed.




To export, create a new export configuration preset using the settings below. Note the file name postfixes used by the Workshop tools to filter textures by type.



Export the maps using a lossless format such as PNG or TGA.


Adjusting the maps
The converted specularity and gloss maps do not match the ranges used in SteamVR Home, so to get proper results they need to get adjusted in an image editor.

The Reflectance map comes out compressed to the mid-ranges and needs to be stretched out to increase the contrast. Make sure non-metallic areas have a brightness around 0.05 to 0.1 and fully metallic areas around 1.



Original | Adjusted


The gloss map needs to be darkened from the Substance Painter output. This is highly subjective, so test and iterate on the result.



Original | Adjusted



Importing to the Workshop Tools

Move the maps to a subdirectory of the materials directory of your add-on, and open/create a material. In the material editor enable the following options as needed:

Specular - Enables real time reflections and the Reflectance map.

In-Game Cube Map - Enables indirect Cubemap reflections.

Specular Cube Map Projection - Projects box cubemaps to the correct position in the world, very useful on items that are expected to move in the environment.

High Quality Gloss - Having this unchecked bakes the gloss and normal maps in the same texture.

Metalness Texture - If you made a metalness map that is more than a flat color.

Ambient Occlusion Texture - If you made an AO map.


If the maps have the same name/location as the material, they should get filled in automatically based on the postfix when the corresponding options are enabled.
Specular/gloss workflow
If the model does not have any metallic or highly reflective parts, the specular/gloss workflow can be used instead. Substance Painter does not support converting spec/gloss materials to the necessary maps, but with low specular levels the diffuse and specular color maps can be used as the base texture and reflectance maps.

Exporting from Substance Painter
Create your material using the default maps of the pbr-spec-gloss shader, as well as ambient occlusion if needed.




To export, create a new export configuration preset using the settings below. Note the file name postfixes used by the Workshop tools to filter textures by type.



Export the maps using a lossless format such as PNG or TGA.


Adjusting the maps
The specularity and gloss maps do not match the ranges used in SteamVR Home, so to get proper results they need to get adjusted in an image editor.

The Reflectance map comes out compressed to the mid-ranges and needs to be stretched out to increase the contrast. Make sure non-metallic areas have a brightness around 0.05 to 0.1 and fully metallic areas around 1.

Note that a reflectance map is not always required, a single value can be set in the Material editor.




Original | Adjusted



The gloss map needs to be darkened from the Substance Painter output. This is highly subjective, so test and iterate on the result.




Original | Adjusted



Importing the maps to the Workshop tools works the same as for the metal/rough material.


11 Yorum
Rectus  [yaratıcı] 17 Oca 2020 @ 16:13 
Yeah, can't use the heightmap unless you want to add a reveal mask to a blend material.

In-game cubemap should be used for anything glossy that can reflect the environment.

The reflectance can often be the default value unless you have things like metals. It doesn't really matter if it's a textue or slider value then.

I haven't really used GIMP much, so I don't really know what the settings do. You'll likely have to tweak the settings anyway to get a good gloss value, so better to eyeball it than bothering with modifying color spaces. Looking up reference images of similar materials can help a lot.
byteframe 17 Oca 2020 @ 15:50 
Thanks for the kind words new information. My levels look ok I quess, and don't take long to make, but I'm never really pleased atm with how they advance over the previous one. Maybe If I can find other useful things other than just abusing the bridge tool I can create something more interesting. I want to go with larger levels and sparser detail.
byteframe 17 Oca 2020 @ 15:49 
(texture noob here, but is this a good enough importing method?)

So I suppose I know where to put the AO/COLOR/METAL/NORMAL files.

- Is the height map therefore going to go unused?

- Should I use 'In Game Cubemap'?

- Set reflection to the default value, instead of the default or other map

So lots of unity zips dont have the roughness, the UE's do...

- I take the roughness map and invert the colors with Gimp. I figure I should use the 'Linear Invert' menu item instead of just 'Invert' colors. I then set the Precision to Linear, and not sGRB. This new file is used for gloss map.

- Gimp also allows me to specify whether it uses an integer or floating point number of various widths, and some files seem to be grayscale instead of srgb I can change it to 'srgb' or 'grayscale'. Should I just leave all this alone though and just make sure it is using 'Linear Precision' (whatever that means :p).

Hopefully I want have to convert lots of textures to linear, but I suppose I should?
Rectus  [yaratıcı] 17 Oca 2020 @ 2:25 
Awesome work on your environments by the way. I like the geometry with the big windows and curved surfaces. Small environments with a lot of details seems to work well for Home.
Rectus  [yaratıcı] 17 Oca 2020 @ 0:17 
wetcobble_normal-ogl.png
Normal map in the OpenGL format. This is what Source 2 uses. The UE4 version of the material has the DirectX format instead with an inverted green channel. If you are unsure which normal format something has, use the "Source 1 Legacy Format" checkbox in the texture settings to flip the green channel.

TEXTURE_rgh
Roughness map. Needs to be inverted for a gloss map.
The Unity version of the cobblestone material is missing this, but the UE4 version has it. Having a gloss map is very important, especially for photorealistic materials since it gives a lot of lighting detail.

To get good imports, make sure you are testing with good lighting (the editor preview doesn't have any indirect lighting). The main thing to fine tune to get things right is the gloss map, especially if you have specular lighting turned on.
Rectus  [yaratıcı] 17 Oca 2020 @ 0:16 
wetcobble_albedo.png:
Albedo is often the diffuse color only without any lighting information. Unless you have highly specular things like metals, it's the same thing as the color map. If it's just the diffuse colors (when using the specuar/gloss PBR workflow), metals will look black on it and it will come with a separate specular color map.

wetcobble_ao.png, TEXTURE_AO:
Ambient occlusion map. If this isn't included, it's probably baked into the color map.

wetcobble_height.png, TEXTURE_disp:
Height or displacement map. It would be more useful if the shader supported parrallax or diplacement mapping. It can be used for reveal masks in blend materials or thickness for double sided materials.

wetcobble_metallic.psd
If the material has metallic parts, this can be used as both the metalness and reflectance maps(with a little adjustment). In this case it's black and not needed.
Rectus  [yaratıcı] 16 Oca 2020 @ 13:47 
Thanks!
byteframe 16 Oca 2020 @ 13:46 
good night. thanks for being helpful and congrats again on your island level it was stunning.
Rectus  [yaratıcı] 16 Oca 2020 @ 13:28 
I'll check it out in the morning.
byteframe 16 Oca 2020 @ 12:41 
A texture I sampled from https://cc0textures.com has

TEXTURE_AO, TEXTURE_col, TEXTURE_disp, TEXTURE_nrm,TEXTURE_rgh files.

is albedo the same thing as color? What is AO? Etc. tyvm