Difference between revisions of "PBR Materials"
(Add a Troubleshooting Content section to address common complaints.) |
Quinn Elara (talk | contribs) (Add tip to (if required) enable dithering on base color output of Substance to fix color banding issues.) |
||
(30 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
'''Physically Based Rendering''' | {{multi-lang|1=PBR_Materials|2=/en}} | ||
'''Physically Based Rendering''' | |||
{{note|1=This page is being actively updated with new content and links as GLTF PBR Materials and related new features are being released. Contributions to this page may be from Second Life residents and staff members alike.}} | |||
[[Category:glTF]] | [[Category:glTF]] | ||
Line 37: | Line 40: | ||
The {{code|Local Lights}} setting has been superceded by updates made to the '''World > Improve graphics speed...''' "Quality & Speed" slider options. Users on low-end hardware should ensure that their "Quality & Speed" slider is set at an appropriate level for their hardware. | The {{code|Local Lights}} setting has been superceded by updates made to the '''World > Improve graphics speed...''' "Quality & Speed" slider options. Users on low-end hardware should ensure that their "Quality & Speed" slider is set at an appropriate level for their hardware. | ||
== What does this mean for Creators? == | == What does this mean for Creators? == | ||
Line 50: | Line 51: | ||
=== Using Imported Materials in Second Life === | === Using Imported Materials in Second Life === | ||
[[File:Editing_Material.jpg|thumb|right|Material Editing]] | |||
For people who build exclusively within Second Life, the addition of PBR also means that there will be a new [[LlGetInventoryType|Inventory Type]] called “Material”. These new Materials can be purchased on the Marketplace and are shareable like any other permitted object in Second Life. | For people who build exclusively within Second Life, the addition of PBR also means that there will be a new [[LlGetInventoryType|Inventory Type]] called “Material”. These new Materials can be purchased on the Marketplace and are shareable like any other permitted object in Second Life. | ||
PBR materials come as a bundle of textures. These all travel as a single unit and are applied all at once. If you wish to change tint, transparency, or other similar parameters of the Material you’ll need to modify the Material from the "Editing Material" | PBR materials come as a bundle of textures. These all travel as a single unit and are applied all at once. If you wish to change tint, transparency, or other similar parameters of the Material you’ll need to modify the Material from the "Editing Material" floater. | ||
{{KBcaution|Meshes uploaded after the PBR release will look slightly different (and more accurate to your editor of choice) due to a change in the way Second Life handles mesh assets (Previously, some data required for accurate tangent generation was discarded at upload time - this is no longer the case). This will mean that a PBR material applied to a mesh uploaded before PBR launched (28th November 2023) might look incorrect; a simple reupload of the mesh will solve this. '''This is not required, but recommended.'''}} | {{KBcaution|Meshes uploaded after the PBR release will look slightly different (and more accurate to your editor of choice) due to a change in the way Second Life handles mesh assets (Previously, some data required for accurate tangent generation was discarded at upload time - this is no longer the case). This will mean that a PBR material applied to a mesh uploaded before PBR launched (28th November 2023) might look incorrect; a simple reupload of the mesh will solve this. '''This is not required, but recommended.'''}} | ||
Line 64: | Line 66: | ||
==== Switch to PBR and select from Inventory ==== | ==== Switch to PBR and select from Inventory ==== | ||
Alternatively, select a face on the prim or mesh you want to apply your material to and choose the “Blinn-Phong” drop-down and change it to “PBR Metallic Roughness”, then select “Choose an item from your inventory” and apply. | Alternatively, select a face on the prim or mesh you want to apply your material to and choose the “Blinn-Phong” drop-down and change it to “PBR Metallic Roughness”, then select “Choose an item from your inventory” and apply. | ||
[[File:PBRSelectorV3.png | thumb | none | Menu drop-down demonstration.]] | [[File:PBRSelectorV3.png |left| thumb | none | Menu drop-down demonstration.]][[File:Material_Dropdown.jpg|thumb|none|Dropdown as of v7.0.1.689]] | ||
<br clear=all> | |||
==== Texture Transforms ==== | |||
With PBR materials, texture transforms work in a slightly different way to Blinn-Phong transforms. Blinn-Phong (and OpenGL) has the texture origin in the lower left corner of the texture, whereas glTF materials (and Vulkan) has the texture origin in the <b>upper left</b> corner. | |||
This means that PBR materials will react differently (namely, they are inverted in the Y (glTF v) axis) to Blinn-Phong materials. | |||
For a simple solution to convert a Blinn-Phong texture transform to a PBR texture transform, please see [https://community.secondlife.com/forums/topic/507448-lsl-math-for-gltf-transformation/?do=findComment&comment=2678959 this forum thread]. | |||
For more information, [https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#images see here] and [https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_texture_transform here]. | |||
=== Media-on-a-Prim === | === Media-on-a-Prim === | ||
Line 71: | Line 83: | ||
When using MOAP on a face with a PBR texture, it will function as if the media texture has an override to the '''Base Color''' and '''Emissive''' maps. Note that the emissive map is overridden, however the emissive tint is not (so, to disable the emissive map you can set the emissive tint to black <0,0,0>). | When using MOAP on a face with a PBR texture, it will function as if the media texture has an override to the '''Base Color''' and '''Emissive''' maps. Note that the emissive map is overridden, however the emissive tint is not (so, to disable the emissive map you can set the emissive tint to black <0,0,0>). | ||
== Tutorials == | == Tools & Tutorials == | ||
As the PBR system is new, it is expected that existing users may be confused at first on how everything works. As such, Linden Lab and some third parties have | As the PBR system is new, it is expected that existing users may be confused at first on how everything works. As such, Linden Lab and some third parties have provided some tutorials and informational videos: | ||
*'''[https://www.youtube.com/watch?v=JtjGf06B8ZA Second Life University - PBR Materials]''' | *'''[https://www.youtube.com/watch?v=JtjGf06B8ZA Second Life University - PBR Materials]''' | ||
*'''[https://www.youtube.com/watch?v=BJ1eRTlWDYk Second Life University - How to create PBR Materials]''' | *'''[https://www.youtube.com/watch?v=BJ1eRTlWDYk Second Life University - How to create PBR Materials]''' | ||
*'''[https://substance3d.adobe.com/tutorials/courses/pbrguide Allegorithmic (Adobe) PBR Guide]''' | *'''[https://substance3d.adobe.com/tutorials/courses/pbrguide Allegorithmic (Adobe) PBR Guide]''' | ||
The above tutorials require knowledge and access to Adobe's Substance Painter (subscription based software on Adobe website, or sold as perpetual license with one year of updates on Steam). Below are some open source tools and links found Googling 'Blender', 'glTF' (requiring Blender 3.3) | |||
*'''[https://www.khronos.org/blog/art-pipeline-for-gltf Khronos Art Pipeline tutorial]''' | |||
*'''[https://materialmaker.org Material Maker software]''' | |||
*'''[https://aiaicapta.in/gltf-packer/ glTF Packer software]''' | |||
*'''[https://armorpaint.org Armorpaint software]''' | |||
*'''[https://armorlab.org Armorlab software]''' | |||
*'''[https://youtu.be/KTPdNUGwIGc glTF Blender Tutorial]''' | |||
*'''[https://youtu.be/p7OPRoT6FkY Exporting glTF Alpha Textures tutorial]''' | |||
== PBR Stand-In Textures and Outdated Viewers == | == PBR Stand-In Textures and Outdated Viewers == | ||
It is worth mentioning that during the adoption period of a new system, a substantial portion of Second Life Residents view the world through third party viewers and mobile viewer solutions that will not have updated to be able to see the new content. Anyone viewing a PBR Material on a viewer that cannot display it will see the “underlying” non-PBR texture. By default, this is a pine box or a completely blank texture. Those who wish their content to be viewable by as many people as possible, might consider creating a Diffuse texture ( with baked lighting, the kind that is easily generated with tools like Substance Painter's “Baked Lighting Filter” ) and applying it as a regular texture to the object they’re placing the PBR material on, prior to applying the PBR material. While this is an extra step in content creation, and complicates things somewhat, if you wish for your content to be appreciated by all, it’s worth considering adding this extra step to your workflow. People designing PBR materials for distribution and sale might also consider offering a “Diffuse Only fallback” texture to accompany the PBR material specifically for people who cannot see the PBR content. | It is worth mentioning that during the adoption period of a new system, a substantial portion of Second Life Residents view the world through third party viewers and mobile viewer solutions that will not have updated to be able to see the new content. Anyone viewing a PBR Material on a viewer that cannot display it will see the “underlying” non-PBR texture. By default, this is a pine box or a completely blank texture. Those who wish their content to be viewable by as many people as possible, might consider creating a Diffuse texture ( with baked lighting, the kind that is easily generated with tools like Substance Painter's “Baked Lighting Filter” ) and applying it as a regular texture to the object they’re placing the PBR material on, prior to applying the PBR material. While this is an extra step in content creation, and complicates things somewhat, if you wish for your content to be appreciated by all, it’s worth considering adding this extra step to your workflow. People designing PBR materials for distribution and sale might also consider offering a “Diffuse Only fallback” texture to accompany the PBR material specifically for people who cannot see the PBR content. | ||
{{KBcaution|Once a PBR Material is applied, the Blinn-Phong textures cannot be updated. To remedy this, remove the PBR Material, then make changes to the Blinn-Phong textures and then reapply the PBR Material.}} | |||
== Understanding and Assisting the New Reflections System == | == Understanding and Assisting the New Reflections System == | ||
Line 88: | Line 111: | ||
== When is it Recommended to Create a Reflection Probe? == | == When is it Recommended to Create a Reflection Probe? == | ||
Manually placed probes are good for cleaning up undesirable noise and lighting from automatically placed probes that may be visually disruptive or confusing. If you look in the image of the room in a house, on the left hand side of it, you can see a blue tint on the floor, which is the reflected blue light from the sky. The probe filling half the room blocks this, and when it is extended to completely fill the room and just slightly beyond the thickness of the walls, (lower copy of the image) the problem is solved. The probe does not need to be a part of the | Manually placed probes are good for cleaning up undesirable noise and lighting from automatically placed probes that may be visually disruptive or confusing. If you look in the image of the room in a house, on the left hand side of it, you can see a blue tint on the floor, which is the reflected blue light from the sky. The probe filling half the room blocks this, and when it is extended to completely fill the room and just slightly beyond the thickness of the walls, (lower copy of the image) the problem is solved. The probe does not need to be a part of the linkset for the rest of the room in order to function; however, once you have them placed it’s possible to add them into linksets like any other prim. | ||
=== Constructing a Reflection Sample Volume ( aka Reflection Probe ) === | === Constructing a Reflection Sample Volume ( aka Reflection Probe ) === | ||
Line 95: | Line 118: | ||
* <code>Reflection Probe</code>: Enabling this creates a Reflection Sampling Volume within the bounding box of the prim. | * <code>Reflection Probe</code>: Enabling this creates a Reflection Sampling Volume within the bounding box of the prim. | ||
* <code>Box / Sphere Drop-down</code>: Choose whether you want this | * <code>Box / Sphere Drop-down</code>: Choose whether you want this sample to project reflections within a box shaped volume or a spherical one. | ||
* <code>Dynamic</code>: Allow skinned objects (e.g. Avatars, animesh, etc.) to be captured in the reflection. | * <code>Dynamic</code>: Allow skinned objects (e.g. Avatars, animesh, etc.) to be captured in the reflection. | ||
* <code>Ambiance</code>: Affects how much objects within the volume are lit as if they have bounced light hitting them from faked indirect illumination. ''See [[PBR_Materials#Fine-Tuning_Reflection_Sample_Volumes|"Fine-Tuning Reflection Sample Volumes"]] for more info. | * <code>Ambiance</code>: Affects how much objects within the volume are lit as if they have bounced light hitting them from faked indirect illumination. ''See [[PBR_Materials#Fine-Tuning_Reflection_Sample_Volumes|"Fine-Tuning Reflection Sample Volumes"]] for more info. | ||
* <code>Near Clip</code>: Sometimes, there will be a large obstruction in the center of the volume you wish to use as a reflection probe. For example, suppose that there is a large architectural supporting structure in the middle of the room, such as a column | * <code>Near Clip</code>: Sometimes, there will be a large obstruction in the center of the volume you wish to use as a reflection probe. For example, suppose that there is a large architectural supporting structure in the middle of the room, such as a column. If the probe gets placed internally inside this, it will reflect the internal surface of the column instead of the room in which it is placed. Increasing Near Clip will make the sampling volume exclude objects n meters from the center so they don’t get included in the reflection. ''See [[PBR_Materials#Fine-Tuning_Reflection_Sample_Volumes|"Fine-Tuning Reflection Sample Volumes"]] for more info. | ||
Select an appropriate probe shape for your scene. For example, if you want to create a reflection probe that covers a room, select a <code>Box</code> shape, or for other objects a <code>Sphere</code> shape is recommended. | Select an appropriate probe shape for your scene. For example, if you want to create a reflection probe that covers a room, select a <code>Box</code> shape, or for other objects a <code>Sphere</code> shape is recommended. | ||
Line 126: | Line 146: | ||
There are 3 operation modes that are set with the <code>Reflection Probe Ambiance</code> value, in tandem with above: | There are 3 operation modes that are set with the <code>Reflection Probe Ambiance</code> value, in tandem with above: | ||
* '''0''' will allow the Environment Ambient color to be applied at full intensity. | * '''0''' will allow the Environment Ambient color to be applied at full intensity. | ||
* ''' Greater than 0 | * ''' Greater than 0 and less than 1''' will blend the Environment Ambient color and probe irradiance (indirect lighting) in a ratio corresponding to the defined value (e.g. 0.5 is a 50/50 split). | ||
* '''1 or above''' will block the Environment Ambient color from being applied within the probe volume and irradiance is applied at full intensity (or with a multiplier for values above 1). | * '''1 or above''' will block the Environment Ambient color from being applied within the probe volume and irradiance is applied at full intensity (or with a multiplier for values above 1). | ||
** '''4 or above''' works the same as above, however only indirect lighting received from the sky will be multiplied to a value above 4. Local lights are clamped at 4.0. | ** '''4 or above''' works the same as above, however only indirect lighting received from the sky will be multiplied to a value above 4. Local lights are clamped at 4.0. | ||
Line 210: | Line 230: | ||
== Uploading Materials == | == Uploading Materials == | ||
There are two different methods of creating PBR material assets: | There are two different methods of creating PBR material assets: | ||
=== Method 1 : Direct Upload a glTF File === | === Method 1 : Direct Upload a glTF File === | ||
The most convenient method to create an entirely new material is to directly upload a glTF file from your computer. | The most convenient method to create an entirely new material is to directly upload a glTF file from your computer. | ||
This is accessible via <code>Build > Upload > Material</code> | This is accessible via <code>Build > Upload > Material...</code> | ||
[[File:PBRBuildMenu.jpg | thumb | none | PBR Upload in main build menu. ]] | [[File:PBRBuildMenu.jpg | thumb | none | PBR Upload in main build menu. ]] | ||
Select a .GLB or a .GLTF file from your computer and Open it: | Select a .GLB or a .GLTF file from your computer and Open it: | ||
This will give the following window: | This will give the following window: | ||
[[File:PBRMatMenu.jpg | thumb | none| The layout of the PBR material creation and editing interface.]] | |||
All of the editable material properties that most creators are familiar with are integrated into the Material's vertically sizable window on upload. | |||
Clicking “Save” pays the upload fees and creates the Material assets using the local filename. Using "Save As..." provides a window to name all the assets to unique inworld names. There is a 63 char limit for names of inventory assets but the naming floater on this Materials upload <b>has no length restrictions</b>. | |||
Textures will be uploaded to the inventory's default Textures folder (NoMod, NoCopy, Transfer) with an appended "type" added to the given name. (ie. asset name (Base Color), asset name (Normal), asset name (Metallic Roughness). In naming the asset keep in mind that the bracketed appendix is included in the name's 63 character limit. The PBR object is uploaded (Mod, NoCopy, Transfer) to the inventory's Material folder with the appended text (Material). Presently, naming the glTF asset from Save As... will NOT append (Material) to the inventory's name. Saving from the locally named file will. | |||
{{KBcaution|Each individual texture used to compose the Material object is charged a separate upload fee. (ie. If you have 4 textures (Base Color, Metallic Roughness, Emissive, Normal) you are charged 4 times. If you only have a Normal and Metallic-Roughness texture you will be charged for 2, etc.)}} | |||
=== Method 2 : Edit a Blank. Create PBR Materials without a glTF File === | === Method 2 : Edit a Blank. Create PBR Materials without a glTF File === | ||
Line 260: | Line 285: | ||
When designing mesh content for use with the double-sided material parameter, it is also ''very strongly recommended that you separate the triangles you intend to use the double-sided material upon into a separate mesh “face”'', so as to not unintentionally render the portions of the mesh that already have triangles designed to represent the internal portion of the object a second time. | When designing mesh content for use with the double-sided material parameter, it is also ''very strongly recommended that you separate the triangles you intend to use the double-sided material upon into a separate mesh “face”'', so as to not unintentionally render the portions of the mesh that already have triangles designed to represent the internal portion of the object a second time. | ||
== LSL Scripting == | |||
Documentation for the LSL interface with glTF materials can be found on the following pages: | |||
*[[GLTF Overrides]] | |||
*[https://wiki.secondlife.com/wiki/Category:LSL_Material Category:LSL Material] | |||
== Recommended Application Settings == | == Recommended Application Settings == | ||
Line 267: | Line 298: | ||
{{KBtip|'''The recommended HDRi for use in Second Life content creation is available at [https://github.com/Jenna-Huntsman/Second-Life-Resources/tree/main/PBR/HDRi this Github repository].''' This HDRi will closely match the lighting of objects under the PBR "Midday" environment preset.}} | {{KBtip|'''The recommended HDRi for use in Second Life content creation is available at [https://github.com/Jenna-Huntsman/Second-Life-Resources/tree/main/PBR/HDRi this Github repository].''' This HDRi will closely match the lighting of objects under the PBR "Midday" environment preset.}} | ||
{{KBcaution|While every effort has been made to ensure the recommended HDRi matches SL as close as possible, you may need to adjust the "Environment Exposure" parameter in your editing program to get 1:1 results with SL | {{KBcaution|While every effort has been made to ensure the recommended HDRi matches SL as close as possible, you may need to adjust the "Environment Exposure" parameter in your editing program to get 1:1 results with SL.}} | ||
<br> | |||
---- | |||
===[https://www.blender.org/ Blender]=== | ===[https://www.blender.org/ Blender]=== | ||
{{KBwarning|Older Blender versions have bugs in their glTF export tools which make their output incompatible with Second Life. '''Use of Blender versions of 3.3 and above are highly recommended to avoid issues.'''}} | {{KBwarning|Older Blender versions have bugs in their glTF export tools which make their output incompatible with Second Life. '''Use of Blender versions of 3.3 and above are highly recommended to avoid issues.'''}} | ||
<br> | |||
{{KBcaution|Please ensure that you correctly set up an HDRi in your viewport, as otherwise the rendering in Blender and in SL will not match. Please see [[PBR Materials#Recommended_Application_Settings|here for a reference HDRi]]. '''Please see [https://www.polygonartists.com/hdri-environment-maps-in-blender/ this tutorial].'''}} | |||
Upon starting your project: | Upon starting your project: | ||
Line 290: | Line 324: | ||
* '''[https://github.com/Jenna-Huntsman/Second-Life-Resources/blob/main/glTF%20Node%20Tree%20-%20Long%20Form.blend glTF Node Tree - Long Form.blend]''' | * '''[https://github.com/Jenna-Huntsman/Second-Life-Resources/blob/main/glTF%20Node%20Tree%20-%20Long%20Form.blend glTF Node Tree - Long Form.blend]''' | ||
* '''[https://github.com/Jenna-Huntsman/Second-Life-Resources/blob/main/glTF%20Node%20Tree%20-%20Short%20Form.blend glTF Node Tree - Short Form.blend]''' | * '''[https://github.com/Jenna-Huntsman/Second-Life-Resources/blob/main/glTF%20Node%20Tree%20-%20Short%20Form.blend glTF Node Tree - Short Form.blend]''' | ||
<br> | |||
---- | |||
=== [https://www.adobe.com/products/substance3d-painter.html Adobe Substance 3D Painter] === | === [https://www.adobe.com/products/substance3d-painter.html Adobe Substance 3D Painter] === | ||
{{KBcaution|While Substance Painter is generally considered to be stable, in some (rare) situations Substance may output a malformed glTF which will be rejected by the viewer. If this happens, import your materials into Blender, then export a glTF from Blender - this should be fixed in a future version of Substance.}} | {{KBcaution|While Substance Painter is generally considered to be stable, in some (rare) situations Substance may output a malformed glTF which will be rejected by the viewer. If this happens, import your materials into Blender, then export a glTF from Blender - this should be fixed in a future version of Substance.}} | ||
<br> | |||
{{KBcaution|Please ensure that you correctly set up an HDRi in your viewport, as otherwise the rendering in Substance and in SL will not match. Please see [[PBR Materials#Recommended_Application_Settings|here for a reference HDRi]]. Please see [http://y2u.be/6goXJ2CJzaM this tutorial].}} | |||
When starting your project: | When starting your project: | ||
Line 302: | Line 339: | ||
Verify the following settings: | Verify the following settings: | ||
*{{code|Document Resolution: | *{{code|Document Resolution: [Set as desired]}} | ||
*{{code|Normal Map Format: OpenGL (Y+)}} | *{{code|Normal Map Format: OpenGL (Y+)}} | ||
*{{code|Compute Tangents Per Fragment: YES}} | *{{code|Compute Tangents Per Fragment: YES}} | ||
Under " | Under "Color Management": | ||
*{{code| | {{KBtip| For a more in-depth explanation of the below settings, and issues that you may encounter, visit [https://mrlixm.github.io/blog/substance-painter-color-management/#aces-workflow this page].}} | ||
*{{code|Color Management: OpenColorIO}} | |||
*{{code|OpenColorIO Configuration: ACES 1.0.3}} | |||
*{{code|Standard sRGB color space: Utility - sRGB - Texture}} | |||
*{{code|8 bit images: Utility - sRGB - Texture}} | |||
*{{code|16 bit images: Utility - sRGB - Texture}} | |||
*{{code|Material color space default: Utility - sRGB - Texture}} | |||
When exporting: | When exporting: | ||
Line 313: | Line 356: | ||
*{{code|Size: Based on each Texture Set's size}} | *{{code|Size: Based on each Texture Set's size}} | ||
*{{code|Padding: Dilation + default background color - 8 bit}} | *{{code|Padding: Dilation + default background color - 8 bit}} | ||
{{KBtip|If you encounter color banding (AKA posterization) in your base color texture after export, you may wish to enable dithering.}} | |||
*To enable dithering, open the {{code|Export Textures}} window, under the {{code|Settings}} tab, enable an override for the Base Color texture and swap the output format from {{code|8 bits}} to {{code|8 bits + dithering}} | |||
<br> | |||
---- | |||
=== [https://www.adobe.com/products/substance3d-designer.html Adobe Substance 3D Designer] === | === [https://www.adobe.com/products/substance3d-designer.html Adobe Substance 3D Designer] === | ||
{{KBcaution|Substance Designer ''does not support glTF output'', unlike Substance Painter.}} | {{KBcaution|Substance Designer ''does not support glTF output'', unlike Substance Painter.}} | ||
Line 323: | Line 369: | ||
*{{code|16 bit images: Utility - sRGB - Texture}} | *{{code|16 bit images: Utility - sRGB - Texture}} | ||
*{{code|Floating point images: ACES - ACEScg}} | *{{code|Floating point images: ACES - ACEScg}} | ||
*{{code|2D and 3D View Display Default: | *{{code|2D and 3D View Display Default: sRGB}} | ||
When exporting (Export Outputs): | When exporting (Export Outputs): | ||
Line 333: | Line 379: | ||
If you use a custom node to output a [[PBR_Materials#Occlusion_.5BR.5D_.2F_Roughness_.5BG.5D_.2F_Metalness_.5BB.5D|pre-compiled ORM map]], this should also be set to Raw. | If you use a custom node to output a [[PBR_Materials#Occlusion_.5BR.5D_.2F_Roughness_.5BG.5D_.2F_Metalness_.5BB.5D|pre-compiled ORM map]], this should also be set to Raw. | ||
<br> | |||
---- | |||
=== [https://www.maxon.net/en/cinema-4d Cinema 4D] === | === [https://www.maxon.net/en/cinema-4d Cinema 4D] === | ||
Please follow the documentation provided in this [https://www.bakedpixels.nl/blog/export-to-gltf-with-cinema-4d blog post]. | Please follow the documentation provided in this [https://www.bakedpixels.nl/blog/export-to-gltf-with-cinema-4d blog post]. | ||
<br> | |||
---- | |||
===[https://3dcoat.com/ 3DCoat]=== | ===[https://3dcoat.com/ 3DCoat]=== | ||
{{KBwarning|As of version "2022-58", 3DCoat is unable to produce a spec-compliant glTF file, and thus should not be used for Second Life. '''Use at your own risk - you ''will'' have issues!}} | {{KBwarning|As of version "2022-58", 3DCoat is unable to produce a spec-compliant glTF file, and thus should not be used for Second Life. '''Use at your own risk - you ''will'' have issues!}} | ||
glTF export has been implemented since 3DCoat version 2020 and is found in the <code>File >Export > Export to glTF > glTF Separate (gltf + .bin + textures)</code> | glTF export has been implemented since 3DCoat version 2020 and is found in the <code>File >Export > Export to glTF > glTF Separate (gltf + .bin + textures)</code> | ||
<br> | |||
---- | |||
=== [https://quixel.com/mixer Quixel Mixer] === | === [https://quixel.com/mixer Quixel Mixer] === | ||
Quixel Mixer has no glTF output, however, it does generate the functional textures, though they do need to be edited and combined in photo editing software. | Quixel Mixer has no glTF output, however, it does generate the functional textures, though they do need to be edited and combined in photo editing software. | ||
Line 361: | Line 410: | ||
Upload to Second Life using [[PBR_Materials#Method_2_:_Edit_a_Blank._Create_PBR_Materials_without_a_GLTF_File|Method 2.]] | Upload to Second Life using [[PBR_Materials#Method_2_:_Edit_a_Blank._Create_PBR_Materials_without_a_GLTF_File|Method 2.]] | ||
<br> | |||
---- | |||
=== [https://www.autodesk.eu/products/3ds-max/overview Autodesk 3DS Max 2023] === | === [https://www.autodesk.eu/products/3ds-max/overview Autodesk 3DS Max 2023] === | ||
Autodesk just added the ability to create glTF files using their new glTF Material and glTF Export functionalities as outlined in '''[https://help.autodesk.com/view/3DSMAX/2023/ENU/?guid=GUID-EFBB037D-C4EB-42D2-9CE1-30FCAD483C31 Autodesk's official documentation]'''. All prior versions of Autodesk software do not have this functionality. | Autodesk just added the ability to create glTF files using their new glTF Material and glTF Export functionalities as outlined in '''[https://help.autodesk.com/view/3DSMAX/2023/ENU/?guid=GUID-EFBB037D-C4EB-42D2-9CE1-30FCAD483C31 Autodesk's official documentation]'''. All prior versions of Autodesk software do not have this functionality. | ||
<br> | |||
---- | |||
=== [https://www.materialmaker.org/ Material Maker] === | === [https://www.materialmaker.org/ Material Maker] === | ||
While [https://www.materialmaker.org/ Material Maker] does not currently export directly to glTF ([https://github.com/RodZill4/material-maker/issues/479 This may be added in future]), materials created with this program are compatible with Second Life. | While [https://www.materialmaker.org/ Material Maker] does not currently export directly to glTF ([https://github.com/RodZill4/material-maker/issues/479 This may be added in future]), materials created with this program are compatible with Second Life. | ||
Line 371: | Line 422: | ||
Upload to Second Life using [[PBR_Materials#Method_2_:_Edit_a_Blank._Create_PBR_Materials_without_a_GLTF_File|Method 2.]] | Upload to Second Life using [[PBR_Materials#Method_2_:_Edit_a_Blank._Create_PBR_Materials_without_a_GLTF_File|Method 2.]] | ||
<br> | |||
---- | |||
=== Adobe Photoshop === | === Adobe Photoshop === | ||
'''While Photoshop is not officially a PBR authoring tool''', the changes to Alpha Blending (changing into Linear space from sRGB) may require you to change your PS settings to get consistent results. Please see [http://www.kiransprojects.com/blog/2014/photoshop-blending-is-broken/ this article] for more information. (See the section titled "A Partial Solution"). Alternatively, [https://www.reddit.com/r/photoshop/comments/61clf8/how_to_fix_photoshops_incorrect_and_ugly_color/ this Reddit post] also gives a few options on how to achieve blending in the correct manner. | '''While Photoshop is not officially a PBR authoring tool''', the changes to Alpha Blending (changing into Linear space from sRGB) may require you to change your PS settings to get consistent results. Please see [http://www.kiransprojects.com/blog/2014/photoshop-blending-is-broken/ this article] for more information. (See the section titled "A Partial Solution"). Alternatively, [https://www.reddit.com/r/photoshop/comments/61clf8/how_to_fix_photoshops_incorrect_and_ugly_color/ this Reddit post] also gives a few options on how to achieve blending in the correct manner. | ||
<br> | |||
---- | |||
=== GIMP === | === GIMP === | ||
'''While GIMP is not officially a PBR authoring tool''', the changes to Alpha Blending (changing into Linear space from sRGB) in Second Life will make textures created in GIMP display their alphas correctly (GIMP defaults to linear alpha calculation). | '''While GIMP is not officially a PBR authoring tool''', the changes to Alpha Blending (changing into Linear space from sRGB) in Second Life will make textures created in GIMP display their alphas correctly (GIMP defaults to linear alpha calculation). | ||
Line 383: | Line 436: | ||
That said, there are some troubleshooting steps which you can do yourself: | That said, there are some troubleshooting steps which you can do yourself: | ||
* Triple-check the settings used for your editor match the ones given [[PBR_Materials#Recommended_Application_Settings|here]]. '''Any''' deviation from these settings may cause visual differences between your editor and in-world. | * Check that you are using the PBR Linden Midday preset (called "Midday") ''not "Midday (Legacy)"''. Other environments may not match the reference HDRi, causing some visual differences. (This is intended behaviour, and content should be able to be viewed under any light correctly, but for troubleshooting purposes this may be required). | ||
** At present, there is a bug with the PBR Linden Midday preset which results in an excessive blue sheen, due to the use of an over-saturated (unrealistic) sky color, among some other issues. This has been fixed in the upcoming glTF Maintenance viewer. | |||
* Are you using a reflection probe? If not, does the problem reproduce if a manual reflection probe is placed over the object? | |||
** This is because a common source of the "blue sheen" in interior scenes is the use of an auto-probe. Auto-probes sample their surroundings, and combined with the approximate (and often incorrect) placement this will mean the sky is sampled on all sides, thus meaning the reflected light from the surroundings (which counters the blue light from the sky) is absent, leading to a larger-than-expected level of sky contribution on the object. Auto-probe placement can be worse in skyboxes or sky platforms | |||
* Triple-check the settings used for your editor match the ones given [[PBR_Materials#Recommended_Application_Settings|here]], including the reference HDRi. '''Any''' deviation from these settings may cause visual differences between your editor and in-world. | |||
* Check your content against a glTF reference viewer; such as: | * Check your content against a glTF reference viewer; such as: | ||
** [https://modelviewer.dev/editor/ Modelviewer.dev] | ** [https://modelviewer.dev/editor/ Modelviewer.dev] | ||
** [https://github.khronos.org/glTF-Sample-Viewer-Release/ Khronos Sample Viewer] | ** [https://github.khronos.org/glTF-Sample-Viewer-Release/ Khronos Sample Viewer] | ||
If the above steps fail, then please '''file a JIRA.''' | If the above steps fail, then please '''[https://jira.secondlife.com/ file a JIRA.]''' | ||
A good JIRA will include: | A good JIRA will include: | ||
Line 394: | Line 451: | ||
* A copy of the glTF content, attached to the JIRA. | * A copy of the glTF content, attached to the JIRA. | ||
* Screenshots of the representation in-world, in a reference viewer, and in-editor. | * Screenshots of the representation in-world, in a reference viewer, and in-editor. | ||
** You should include screenshots of the object inside a manually placed reflection probe, and outside. |
Latest revision as of 19:26, 7 November 2024
Physically Based Rendering
What is it and Why is it used?
The term “Physically Based Rendering” or “PBR” is a technical term that may need some defining for most people since its use is unique to composing images in computer software. The term itself is an abbreviation for a collection of complex mathematical algorithms that attempt to accurately represent the ways that light reflects off and interacts with objects in the real world. In the real world, it is the behavior of light on a piece of metal that allows us, the observer, to recognize “that object is made of metal” without actually reaching out and touching it. The way a metal reflects light differs from that of a polished plastic or some other material, and these differences have been quantified by science. By mimicking real-world physics principles in the virtual world it allows for the creation of more immersive recognizable realistic spaces, but also it helps us relate to fantastical worlds a little better too. While we may not be familiar with what a newly imagined creation is, a metal's inherent metal-ness and aged wood's inherent wood-ness remain constant, making it easier to intuitively understand what we are interacting with in a virtual environment.
Because tying the mathematics to simulate materials in virtual spaces to how they behave in the real-world makes things more immediately recognizable, PBR has become the foundation for creating imagined worlds over the last decade. The metallic shine of exoskeletal armor in superhero movies is driven by a PBR workflow, as is the plastic sheen of toys or the glint of frozen ice in animated classics. Now we are moving to bring this standardized quality to your home in Second Life.
Bringing PBR to Second Life means updating the basic calculations of how light is represented and interacts with the world of Second Life. The goal is to integrate these changes while minimally changing how everything that presently exists in Second Life (designed prior to the introduction of PBR) looks. While the preservation of creative intent and the aesthetic appeal of items users have enjoyed for over two decades of Second Life is always a priority, Second Life is an ever-evolving platform, and to continue to do so, some changes are inevitable.
Lastly, while we are attempting to mimic real-world reflections and material properties, Second Life has to run on a wide variety of devices, so some shortcuts have to be made. Reflections are not mirror-perfect, as has often been a long-standing hope and request from Residents. While the addition of a reflection system does bring dreams of distortion free mirrors for our avatars in Second Life closer to reality, unfortunately, due to the calculation requirements of doing perfect reflections, mirrors are sadly still, for the moment, not practical. Please see the note in the section below for more info.
What does this mean for Residents?
Changes to Existing Content
The largest change by far is the addition of an environmental reflection system to Second Life. For most existing items, this change shouldn’t have a drastic immediately observable impact. A few things in your inventory that you already own may appear more reflective with the new graphics configuration and those reflections should feel more realistic and immersive with your current environment. As a general rule: the “shinier” an object was before, the more environment reflections it will pick up and the more visual difference there will be.
Another notable change is the addition of tonemapping to the viewer. Tonemapping is a way of representing an image with a higher native dynamic range than the display can support. Tonemapping is a de-facto requirement of PBR pipelines. This means that colors in Second Life will generally appear more saturated with less detail being lost in shadows and highlights. Click here for some additional reading on the subject.
The tonemapping method used is called Academy Color Encoding System (aka "ACES"), and can be read about here and here.
Blinn-Phong content making use of the Specular parameters may look different if the items were never viewed under local lights, as the PBR viewer allows for the environment (sun and sky) to contribute to specular reflections. As such, if the object receives blue specular reflections from the sky, these reflections are tinted, and may look odd. This effect is the same as prior viewers, as if the object was lit by a blue local light.
Removal of Advanced Lighting Model ( ALM ) Graphics Option
There have been changes to the Graphics > Advanced Settings... Preferences. The most notable of which is the removal of the “Atmospheric Shaders”, "Local lights" and “Advanced Lighting Model” options.
For those users on lower-end hardware who depended heavily upon those options to navigate Second Life with an acceptable framerate, we recommend the following settings:
Transparent Water: Disabled
Screen Space Ambient Occlusion: Disabled
Shadows: None
Screen Space Reflections: Disabled
Reflection Detail: Static Only
Reflection Coverage: Manual only
The Local Lights
setting has been superceded by updates made to the World > Improve graphics speed... "Quality & Speed" slider options. Users on low-end hardware should ensure that their "Quality & Speed" slider is set at an appropriate level for their hardware.
What does this mean for Creators?
Nomenclature changes
The PBR project represents a large step towards integrating standard rendering techniques used in the games industry. As such, the nomenclature of some items has changed, notably, what was once called Materials is now referred to as Blinn-Phong. This does not represent any changes to the underlying rendering techniques (beyond those mentioned above); and as such Blinn-Phong is not the same as PBR Spec/Gloss workflows, seen in some game engines such as Unity.
Importing PBR Materials from External Software:
For creators who work with external tools such as Blender, Adobe Substance Painter, Cinema4D, 3D-Coat, or have used the Unreal or Godot game engines, the use of PBR texture sets should already be familiar. In fact, some creators have been using tools that use PBR workflows to create content for Second Life and have then been forced to sacrifice visual quality to convert that information into Second Life’s existing Blinn-Phong materials system.
Second Life is adopting the “Metallic/Roughness” PBR model, and in its ongoing commitment to using Open Source standards whenever it is practical to do so, the glTF 2.0 file format has been chosen as the upload format for PBR Material assets. One of the primary goals of implementing PBR Materials is to have more continuity from content creation applications towards Second Life, and have more consistent content behavior once it’s inworld.
Using Imported Materials in Second Life
For people who build exclusively within Second Life, the addition of PBR also means that there will be a new Inventory Type called “Material”. These new Materials can be purchased on the Marketplace and are shareable like any other permitted object in Second Life.
PBR materials come as a bundle of textures. These all travel as a single unit and are applied all at once. If you wish to change tint, transparency, or other similar parameters of the Material you’ll need to modify the Material from the "Editing Material" floater.
Important: Meshes uploaded after the PBR release will look slightly different (and more accurate to your editor of choice) due to a change in the way Second Life handles mesh assets (Previously, some data required for accurate tangent generation was discarded at upload time - this is no longer the case). This will mean that a PBR material applied to a mesh uploaded before PBR launched (28th November 2023) might look incorrect; a simple reupload of the mesh will solve this. This is not required, but recommended. |
Applying existing materials works similarly to existing textures. You have two means of doing so:
Drag and Drop
Simply drag and drop onto the face of a prim or a mesh. For example, if you have a tiled floor material and you place it on a selected prim cube face that face will now look like a tile floor and reflect light like a tiled floor would with all the material qualities contained in the material.
Switch to PBR and select from Inventory
Alternatively, select a face on the prim or mesh you want to apply your material to and choose the “Blinn-Phong” drop-down and change it to “PBR Metallic Roughness”, then select “Choose an item from your inventory” and apply.
Texture Transforms
With PBR materials, texture transforms work in a slightly different way to Blinn-Phong transforms. Blinn-Phong (and OpenGL) has the texture origin in the lower left corner of the texture, whereas glTF materials (and Vulkan) has the texture origin in the upper left corner.
This means that PBR materials will react differently (namely, they are inverted in the Y (glTF v) axis) to Blinn-Phong materials. For a simple solution to convert a Blinn-Phong texture transform to a PBR texture transform, please see this forum thread.
For more information, see here and here.
Media-on-a-Prim
Media on a prim will continue to work largely as it has done prior to PBR's launch.
When using MOAP on a face with a PBR texture, it will function as if the media texture has an override to the Base Color and Emissive maps. Note that the emissive map is overridden, however the emissive tint is not (so, to disable the emissive map you can set the emissive tint to black <0,0,0>).
Tools & Tutorials
As the PBR system is new, it is expected that existing users may be confused at first on how everything works. As such, Linden Lab and some third parties have provided some tutorials and informational videos:
- Second Life University - PBR Materials
- Second Life University - How to create PBR Materials
- Allegorithmic (Adobe) PBR Guide
The above tutorials require knowledge and access to Adobe's Substance Painter (subscription based software on Adobe website, or sold as perpetual license with one year of updates on Steam). Below are some open source tools and links found Googling 'Blender', 'glTF' (requiring Blender 3.3)
- Khronos Art Pipeline tutorial
- Material Maker software
- glTF Packer software
- Armorpaint software
- Armorlab software
- glTF Blender Tutorial
- Exporting glTF Alpha Textures tutorial
PBR Stand-In Textures and Outdated Viewers
It is worth mentioning that during the adoption period of a new system, a substantial portion of Second Life Residents view the world through third party viewers and mobile viewer solutions that will not have updated to be able to see the new content. Anyone viewing a PBR Material on a viewer that cannot display it will see the “underlying” non-PBR texture. By default, this is a pine box or a completely blank texture. Those who wish their content to be viewable by as many people as possible, might consider creating a Diffuse texture ( with baked lighting, the kind that is easily generated with tools like Substance Painter's “Baked Lighting Filter” ) and applying it as a regular texture to the object they’re placing the PBR material on, prior to applying the PBR material. While this is an extra step in content creation, and complicates things somewhat, if you wish for your content to be appreciated by all, it’s worth considering adding this extra step to your workflow. People designing PBR materials for distribution and sale might also consider offering a “Diffuse Only fallback” texture to accompany the PBR material specifically for people who cannot see the PBR content.
Important: Once a PBR Material is applied, the Blinn-Phong textures cannot be updated. To remedy this, remove the PBR Material, then make changes to the Blinn-Phong textures and then reapply the PBR Material. |
Understanding and Assisting the New Reflections System
Those creators that work at house-scale, or produce items that can be walked through, can gain additional control over the lighting in their creations by taking the time to fully understand the new toolkit that influences environmental reflections. There is a new type of volume that can be created and appended to object linksets specifically for scenes with these kinds of spaces. These volumes define a custom area where reflections are calculated, overriding the default solution. So-called “Reflection Probes” should be placed in a manner such that the fewest number of probes fills the largest amount of space possible with minimal overlap. One probe per room is a good reference point for a general living space like a house. If multiple probes exist in a given area they can cause visual artifacts and negatively impact performance (also known as viewer lag). Do not affix reflection probes to small creations such as furniture or decor. Small items such as tables, chairs, musical instruments, candle sticks etc should use the reflection sample volume in the space in which they are placed. They should not have one appended. It is strongly recommended that any object that contains a reflection sample probe be left as “modify”, so the positioning of the probe can be adjusted or even removed by the owner of the item should they wish.
Editor note: Reflection probes are not intended for use with planar mirrors, and will look incorrect when being used to do so. Planar mirrors have been flagged for future work, but are not directly in the scope of the PBR project.
When is it Recommended to Create a Reflection Probe?
Manually placed probes are good for cleaning up undesirable noise and lighting from automatically placed probes that may be visually disruptive or confusing. If you look in the image of the room in a house, on the left hand side of it, you can see a blue tint on the floor, which is the reflected blue light from the sky. The probe filling half the room blocks this, and when it is extended to completely fill the room and just slightly beyond the thickness of the walls, (lower copy of the image) the problem is solved. The probe does not need to be a part of the linkset for the rest of the room in order to function; however, once you have them placed it’s possible to add them into linksets like any other prim.
Constructing a Reflection Sample Volume ( aka Reflection Probe )
Start off in the Build Menu (Ctrl+3) by rezzing a basic prim. Under the Features
tab, at the bottom check the box labelled Reflection Probe
.
Reflection Probe
: Enabling this creates a Reflection Sampling Volume within the bounding box of the prim.Box / Sphere Drop-down
: Choose whether you want this sample to project reflections within a box shaped volume or a spherical one.Dynamic
: Allow skinned objects (e.g. Avatars, animesh, etc.) to be captured in the reflection.Ambiance
: Affects how much objects within the volume are lit as if they have bounced light hitting them from faked indirect illumination. See "Fine-Tuning Reflection Sample Volumes" for more info.Near Clip
: Sometimes, there will be a large obstruction in the center of the volume you wish to use as a reflection probe. For example, suppose that there is a large architectural supporting structure in the middle of the room, such as a column. If the probe gets placed internally inside this, it will reflect the internal surface of the column instead of the room in which it is placed. Increasing Near Clip will make the sampling volume exclude objects n meters from the center so they don’t get included in the reflection. See "Fine-Tuning Reflection Sample Volumes" for more info.
Select an appropriate probe shape for your scene. For example, if you want to create a reflection probe that covers a room, select a Box
shape, or for other objects a Sphere
shape is recommended.
Move the reflection probe and resize it as necessary to fit your desired purpose. For the room example, resize the box so the probe just touches the walls, ceiling and floor of the room.
Naming your probes is also recommended, so other people ( or yourself later on ) will remember why there’s a large transparent prim in the middle of your build.
If you wish to come back and edit the reflection probe later on, enable both Show Reflection Probe Volumes
and Select Reflection Probes
under Build > Options
.
Fine-Tuning Reflection Sample Volumes
Warning: Sample volumes do not react to prim parameter changes. Options such as “Hollow” or “Taper” or “Shear” do not change how the sampling area behaves. |
That said, it may be helpful to visualize Near Clip
as the hollowing out of your reflection sample volume, but the hollow and near-clip are not in any way linked and doing so is purely a convenience. Reflection probe sample volumes only respond to changes in scale and position; however, different probe volumes behave differently when resized.
Box
Probes: These are affected by position and non-uniform scale.
Example: If I create a box reflection probe and scale it to 10m,30m,10m size, the full volume will be affected by the probe.
Sphere
Probes: These are affected by position and uniform scale only, otherwise the smallest dimension is used.
Example: If I create a spherical probe and scale it to 10m,30m, and 10m size , the probe will sample a 10 meter diameter spherical volume at the center of the probe. However, a 30m,30m,30m sphere will create a sampling volume of a 30 meter diameter sphere.
Reflection Probe Ambiance
controls how ambient light (Found in your environment preset) affects, or does not affect, the contents of the reflection probe, and the intensity of indirect lighting (aka Irradiance).
This value is influenced by the Reflection Probe Ambiance
value found in the user's environment preset, wherein if the Ambiance value given in the environment preset is higher than the value defined by the probe itself, it inherits the ambiance value of the environment preset, or alternately if the ambiance value defined by the probe is higher, the probe's value is used.
There are 3 operation modes that are set with the Reflection Probe Ambiance
value, in tandem with above:
- 0 will allow the Environment Ambient color to be applied at full intensity.
- Greater than 0 and less than 1 will blend the Environment Ambient color and probe irradiance (indirect lighting) in a ratio corresponding to the defined value (e.g. 0.5 is a 50/50 split).
- 1 or above will block the Environment Ambient color from being applied within the probe volume and irradiance is applied at full intensity (or with a multiplier for values above 1).
- 4 or above works the same as above, however only indirect lighting received from the sky will be multiplied to a value above 4. Local lights are clamped at 4.0.
Complex Reflection Probe placement
At times, you may wish to place a reflection probe in an area where the reflection probe types (Sphere or Box) do not conform to the shape of the area. For example, a Box probe in a loft room has a triangular shape, which results in "probe bleed" wherein the influence volume affects an area larger than what is needed, and thus bleeds out onto the exterior roof, which is undesirable.
In these cases, you may need to place multiple probes in order to blend together the sample volumes to achieve the desired result. In the loft room example, it's best to start with 3 box probes, which cover the floor, and each side of the roof. Then, use an additional box probe as "fill" to cover the gap inbetween the 3 probes. The main fill probe may need to be rotated at an angle to get the most coverage possible. If it is not possible to fill the gap between the 3 probes with this fill probe, you may wish to add more box probes to act as "secondary fill".
[TODO: Put photo examples of the above here!]
Alternately, Sphere probes may be used to achieve the same result. Sphere probes have considerably softer blending than box probes, so this may give you the best results in severe bleed conditions.
Unsupported use-cases
Warning: Do not attempt to do anything listed below. These uses are liable to either intentionally be disabled, or stop working in future updates. |
You may be tempted to use reflection probes in the following ways, however these use-cases are either intentionally disabled or result in undefined behavior, and may work now but may not in future. You have been warned.
Under any circumstances, you should NOT:
- Wear a reflection probe. This intentionally does not work. (Reflection probes are a property of the scene, not an individual object / avatar)
- Attach a reflection probe to a physics-enabled object, e.g. vehicles. This intentionally does not work. (As above, the reflection probes are part of the scene; not part of an individual object. Reflection probes by design do not update in real-time, thus the object would always have incorrect reflections anyway.)
PBR Material Composition
PBR-defined values are measured by optical sensors and other capture tools and recorded in databases. These parameters are then put into commercial software to be used by content creators. Using software designed to create PBR content is always recommended; however, understanding how PBR materials are assembled can assist with editing and compiling them. Having a direct understanding of what each individual color channel contributes is essential for editing PBR textures without relying upon some of the more advanced toolkits available.
All PBR Values are listed from 0 to 1.0, though in an actual image, the values range from 0 - 255. PBR Materials are composed of a set of four specifically designed textures; they are as follows:
Base Color [ RGB ] + Transparency [ A ]
[RGB]: This is the unlit color of the surface. This differs from the “Diffuse” texture that Second Life uses. Diffuse textures often include faked reflection and specular information as well as added Ambient Occlusion shadows. Base Color textures do not get any of this added information. For metals ( as defined by the metalness value ), Base Color also determines specular reflection color, whereas, in non-PBR systems, this is defined by the Specular texture and tint. In certain PBR texturing applications, Base Color is sometimes also referred to as “Albedo”.
[ A ]: Alpha Channel, dictates the transparency of the entire material overall.
The Base color texture should be devoid of lighting information.
Occlusion [R] / Roughness [G] / Metalness [B]
This texture is composed of 3 unrelated grayscale images stored in 3 different color channels of an RGB texture.
[R]: (Ambient) Occlusion is lighting data, removing the need to bake down shadows on to the Base Color map. Note that white (<1,1,1>) means no occlusion is applied, and black (<0,0,0>) applies full occlusion.
[G]: Roughness data ranges from 0 to 1.0, but the actual range of physical surfaces ranges from approximately 0.05 to 0.985. No surface is perfectly smooth or completely rough. The rougher a surface is the less mirror-like it behaves.
[B]: Metalness values are mostly black or white. Either the material is a conductive metal like copper, or it’s a non-metal like fabric. 0.0 is Non-Metallic, 1.0 is Metallic. There are almost no materials with gray metalness values.
The alpha channel is ignored, as per the glTF 2.0 specification.
Editor note: The Occlusion map is not controlled by the "Screen Space Ambient Occlusion" toggle in the Advanced Graphics Settings. The Occlusion map is always enabled.
Emissive [ RGB ]
This determines the amount and the color of unlit (ignores ambient light conditions) areas of your material. When giving an object a white emissive map, the object will act as if the Blinn-Phong "Fullbright" option was checked. This map is useful for items which are expected to emit light, e.g. a table lamp, where the lamp shade would appear to glow when the lamp is turned on. If you wish to toggle the lamp on and off, it's recommended to change the Emissive Tint value to black (functionally disabling the emissive map, thus turning the lamp off), and then changing the tint back to your desired color to turn the lamp back on. Leaving the Emissive slot empty is recommended when it’s unused.
Note that glow (The postprocessing effect), is controlled by a separate parameter in the build floater and is intentionally not part of the PBR material window. Glow is modulated by the emissive map, so black areas of an object's emissive map will not glow, similar to how Blinn-Phong emissive maps and glow work.
As per the glTF 2.0 specification, the alpha channel is ignored.
Normal [ RGB ]
The normal maps generated by your baking application / normal map generation toolkit should be compatible with Second Life in most cases. The most common pitfall is using normal maps generated with “inverted” Green channels, such as those that are used for Direct3D and Unreal Engine. Normal texture data redirects light in a different direction based on the vectors indicated by the color, so if the green channel is backward, it’ll seem to be “pointing the wrong way”. To phrase the problem a different way, all the things that should be bumps look like dents, and vice versa. If this occurs, double check that your settings aren’t for Direct3D and try re-generating it. Also, taking it into image editing software and inverting the green channel only sometimes is a sufficient fix.
Normal map tangent spaces are an extremely technical subject that most users need not be concerned with as most modern applications default to the correct setting. However, if your normal maps look drastically different inside Second Life, compared to your source application, and you’ve already confirmed it’s not an inverted green channel, then checking which tangent space settings are being used is the next step. PBR Normals use Mikkelsen Tangent Space. (Often abbreviated MikkT) If you are unsure what this means, use similar workflows and settings for Second Life PBR as those that are generally recommended for the Godot 4 game engine.
As per the glTF 2.0 specification, the blue channel of a normal map is only allowed to contain values above 0.5 to a max of 1 (255).
As per the glTF 2.0 specification, the alpha channel is ignored.
Material Reference Libraries
As PBR is Physically Based, you may wish to know how to recreate a real-life material in PBR form. What color should you use? What metalness value should it have?
Fortunately, reference libraries exist which can tell you how to recreate a given material in a PBR workflow.
List of Reference Color Palettes & libraries
- Physically Based
- Select the Godot Engine, with the Color Space as sRGB Linear and Color Representation as 0-1 (Depending on what you are doing, you may need to convert the value into gamma-corrected sRGB space, which can be done here. Enter the value on the 3rd row.)
- Grzegorz Baran Library
- Available on YouTube (video format, older), or PDF (most up-to-date).
- Dontnod Entertainment Library
- A very small library, but useful nonetheless.
- Studio 397
- A small collection of various materials.
- Polycount Wiki
- Not so much a library in itself, but links out to other libraries. See the Color Charts section.
List of PBR asset libraries
- ambientCG
- Provides CC0 licensed HDRi, Metal-Rough materials and .sbar (Substance Painter material) files.
- Poly Haven
- Provides CC0 licensed HDRi, Metal-Rough materials and models.
Uploading Materials
There are two different methods of creating PBR material assets:
Method 1 : Direct Upload a glTF File
The most convenient method to create an entirely new material is to directly upload a glTF file from your computer.
This is accessible via Build > Upload > Material...
Select a .GLB or a .GLTF file from your computer and Open it: This will give the following window:
All of the editable material properties that most creators are familiar with are integrated into the Material's vertically sizable window on upload.
Clicking “Save” pays the upload fees and creates the Material assets using the local filename. Using "Save As..." provides a window to name all the assets to unique inworld names. There is a 63 char limit for names of inventory assets but the naming floater on this Materials upload has no length restrictions.
Textures will be uploaded to the inventory's default Textures folder (NoMod, NoCopy, Transfer) with an appended "type" added to the given name. (ie. asset name (Base Color), asset name (Normal), asset name (Metallic Roughness). In naming the asset keep in mind that the bracketed appendix is included in the name's 63 character limit. The PBR object is uploaded (Mod, NoCopy, Transfer) to the inventory's Material folder with the appended text (Material). Presently, naming the glTF asset from Save As... will NOT append (Material) to the inventory's name. Saving from the locally named file will.
Important: Each individual texture used to compose the Material object is charged a separate upload fee. (ie. If you have 4 textures (Base Color, Metallic Roughness, Emissive, Normal) you are charged 4 times. If you only have a Normal and Metallic-Roughness texture you will be charged for 2, etc.) |
Method 2 : Edit a Blank. Create PBR Materials without a glTF File
If you have the necessary textures to compose a PBR material but do not have a glTF file you will need to build a Material from inventory. Make sure your textures are in the correct format, with the correct data in the proper channels. This requires some understanding of how PBR materials work. Once you have that, upload your textures as you normally would.
- Find the "Materials" folder in your inventory, right click, and select "New Material" from the context menu.
- Name your new material something appropriate (E.g. "Red Bricks" for a red brick wall, etc.)
- Right click on your new material, and select "Open" from the context menu.
- Upload your PBR textures using the standard texture workflow (Usually, under
Build > Upload > Image
). - In the material window, select the appropriate maps that you just uploaded in their respective slots.
Warning: While there may be a temptation to try and place a Blinn-Phong “Diffuse” texture into the “Base Color” slot and a Blinn-Phong “Specular" into the “Metallic/Roughness” slot, doing so will not produce desirable results. However, trying this won’t generate any warnings as there is no way to check that you’ve put the right texture type into the inputs, and the material will save and be applicable to objects. Unfortunately, what will be created is not a functional PBR material. Please do not do this. |
- Once done, verify the material parameters are correct (E.g. Base color tint, M/R factor, Emissive tint, etc.)
- Save your new material.
- EITHER: Drag and drop the material onto a rezzed prim, OR edit the prim, click the "Blinn-Phong" drop-down, select "PBR Metallic-Roughness", and click "Choose from Inventory", and select your new material.
Creating Color Variants
After you’ve uploaded your first Material for your project, if you’re a store owner who would like to release more than one color palette for your creation, as many clothing and furniture designers find it useful to do, it’s important to not upload a new glTF file for every single variant of your Material. Most variant materials, only the base color will change. The Occlusion, Roughness, Metalness, Emissive and Normal map texture slots will remain the same. Since these maps have already been uploaded once, if we upload a second glTF File, they will be duplicated. Having different copies of the same texture, with differing UUID’s means that they will clog up download bandwidth and video card memory (not to mention your inventory as well). This is very bad for Second Life. So, for this reason, it’s recommended that when you create texture variants, you upload the additional copies of the base-color texture separately. Then open your newly uploaded material in edit mode, choose the Base Color texture, and change it out for one of your newly uploaded Base Color textures, and click “Save As”. This will create a second copy of your material that uses all the correct texture maps without needlessly duplicating them and causing additional lag.
Tip: You can also avoid uploading additional textures altogether by uploading a white color variant, then making use of the Base Color Tint parameter! |
Double Sided Parameter : Uses and Dangers
“Double Sided” is a new property unique to Materials. When “Double Sided” is checked, the surface upon which this material is placed will be drawn twice; once for the outward-facing portion of the surface, and a second time for the inward-facing side of the surface that is normally invisible without a double-sided material. This option should only be used for very specific meshes that were designed to be used with double-sided materials, since placing materials with this parameter checked on normal objects will simply cause the viewer to draw it twice ( and thereby create additional viewer lag ) for no observable change. It is very strongly recommended that this option be unchecked for any material that is to be distributed for general use. Even more so if the “Modify” permission is revoked. If you wish to distribute a version of a material that has “Double Sided” checked, please include a second copy of the material that has “Double Sided” unchecked as well, with an accompanying explanation to the next user as to why this was done.
Example:
- LeafTextures_DoubleSided
- LeafTextures_SingleSided
When designing mesh content for use with the double-sided material parameter, it is also very strongly recommended that you separate the triangles you intend to use the double-sided material upon into a separate mesh “face”, so as to not unintentionally render the portions of the mesh that already have triangles designed to represent the internal portion of the object a second time.
LSL Scripting
Documentation for the LSL interface with glTF materials can be found on the following pages:
Recommended Application Settings
The glTF file format is widely adopted and many applications have export functionality for this type of file. Below is a non-comprehensive list of some of the more popular applications that export glTF files.
Tip: The recommended HDRi for use in Second Life content creation is available at this Github repository. This HDRi will closely match the lighting of objects under the PBR "Midday" environment preset. |
Important: While every effort has been made to ensure the recommended HDRi matches SL as close as possible, you may need to adjust the "Environment Exposure" parameter in your editing program to get 1:1 results with SL. |
Blender
Warning: Older Blender versions have bugs in their glTF export tools which make their output incompatible with Second Life. Use of Blender versions of 3.3 and above are highly recommended to avoid issues. |
Important: Please ensure that you correctly set up an HDRi in your viewport, as otherwise the rendering in Blender and in SL will not match. Please see here for a reference HDRi. Please see this tutorial. |
Upon starting your project:
Under: Scene > Render Properties > Color Management
:
View Transform: Standard
Sequencer: Linear ACEScg
Create your materials within Blender using Principled BSDF Shader Nodes and the glTF Settings node. Export them according to the official Blender Documentation.
Important: Second Life does not support BSDF Clearcoat, Subsurface, Anisotropy or Transmission parameters at this time. |
For materials creation, 2 example .blend files are provided, one using separate Occlusion, Roughness and Metallic textures ("Long Form"), and one that handles a pre-packed ORM map ("Short Form")
The below files are intended for use with Blender versions 3.3 and above.
Adobe Substance 3D Painter
Important: While Substance Painter is generally considered to be stable, in some (rare) situations Substance may output a malformed glTF which will be rejected by the viewer. If this happens, import your materials into Blender, then export a glTF from Blender - this should be fixed in a future version of Substance. |
Important: Please ensure that you correctly set up an HDRi in your viewport, as otherwise the rendering in Substance and in SL will not match. Please see here for a reference HDRi. Please see this tutorial. |
When starting your project:
Template: PBR - Metallic Roughness Alpha-test (starter_assets)
OR
Template: PBR - Metallic Roughness Alpha-blend (starter_assets)
Verify the following settings:
Document Resolution: [Set as desired]
Normal Map Format: OpenGL (Y+)
Compute Tangents Per Fragment: YES
Under "Color Management":
Tip: For a more in-depth explanation of the below settings, and issues that you may encounter, visit this page. |
Color Management: OpenColorIO
OpenColorIO Configuration: ACES 1.0.3
Standard sRGB color space: Utility - sRGB - Texture
8 bit images: Utility - sRGB - Texture
16 bit images: Utility - sRGB - Texture
Material color space default: Utility - sRGB - Texture
When exporting:
Output Template: glTF PBR Metal Roughness
Size: Based on each Texture Set's size
Padding: Dilation + default background color - 8 bit
Tip: If you encounter color banding (AKA posterization) in your base color texture after export, you may wish to enable dithering. |
- To enable dithering, open the
Export Textures
window, under theSettings
tab, enable an override for the Base Color texture and swap the output format from8 bits
to8 bits + dithering
Adobe Substance 3D Designer
Important: Substance Designer does not support glTF output, unlike Substance Painter. |
Under preferences, verify the following Project settings:
Color Management: OpenColorIO
OpenColorIO Configuration: ACES 1.0.3
8 bit images: Utility - sRGB - Texture
16 bit images: Utility - sRGB - Texture
Floating point images: ACES - ACEScg
2D and 3D View Display Default: sRGB
When exporting (Export Outputs):
basecolor: Utility - sRGB - Texture
normal: Utility - Raw
roughness: Utility - Raw
metallic: Utility - Raw
ambientocclusion: Utility - Raw
If you use a custom node to output a pre-compiled ORM map, this should also be set to Raw.
Cinema 4D
Please follow the documentation provided in this blog post.
3DCoat
Warning: As of version "2022-58", 3DCoat is unable to produce a spec-compliant glTF file, and thus should not be used for Second Life. Use at your own risk - you will have issues! |
glTF export has been implemented since 3DCoat version 2020 and is found in the File >Export > Export to glTF > glTF Separate (gltf + .bin + textures)
Quixel Mixer
Quixel Mixer has no glTF output, however, it does generate the functional textures, though they do need to be edited and combined in photo editing software.
Export them by going to Export Target > Custom
Texture Preset: Metalness Maps
Select:
Albedo , Roughness, Normal, AO , Metalness and ( if need be ) Emissive.
Click “Export to Disk” and open the folder that the files were placed into.
Albedo is the Base Color texture in this case.
AO , Roughness , Metalness get combined into the ORM map as per this explanation.
Normal Map : Quixel generates Direct3D Normal Maps. The green channel needs to be inverted as per here.
Upload to Second Life using Method 2.
Autodesk 3DS Max 2023
Autodesk just added the ability to create glTF files using their new glTF Material and glTF Export functionalities as outlined in Autodesk's official documentation. All prior versions of Autodesk software do not have this functionality.
Material Maker
While Material Maker does not currently export directly to glTF (This may be added in future), materials created with this program are compatible with Second Life.
Export your materials using the Godot 4 ORM export preset.
Upload to Second Life using Method 2.
Adobe Photoshop
While Photoshop is not officially a PBR authoring tool, the changes to Alpha Blending (changing into Linear space from sRGB) may require you to change your PS settings to get consistent results. Please see this article for more information. (See the section titled "A Partial Solution"). Alternatively, this Reddit post also gives a few options on how to achieve blending in the correct manner.
GIMP
While GIMP is not officially a PBR authoring tool, the changes to Alpha Blending (changing into Linear space from sRGB) in Second Life will make textures created in GIMP display their alphas correctly (GIMP defaults to linear alpha calculation).
Troubleshooting content
If you upload a piece of PBR content which does not match your editor, the advice from Linden Lab is to STOP: File a JIRA. Do not attempt to "fix" the content.
That said, there are some troubleshooting steps which you can do yourself:
- Check that you are using the PBR Linden Midday preset (called "Midday") not "Midday (Legacy)". Other environments may not match the reference HDRi, causing some visual differences. (This is intended behaviour, and content should be able to be viewed under any light correctly, but for troubleshooting purposes this may be required).
- At present, there is a bug with the PBR Linden Midday preset which results in an excessive blue sheen, due to the use of an over-saturated (unrealistic) sky color, among some other issues. This has been fixed in the upcoming glTF Maintenance viewer.
- Are you using a reflection probe? If not, does the problem reproduce if a manual reflection probe is placed over the object?
- This is because a common source of the "blue sheen" in interior scenes is the use of an auto-probe. Auto-probes sample their surroundings, and combined with the approximate (and often incorrect) placement this will mean the sky is sampled on all sides, thus meaning the reflected light from the surroundings (which counters the blue light from the sky) is absent, leading to a larger-than-expected level of sky contribution on the object. Auto-probe placement can be worse in skyboxes or sky platforms
- Triple-check the settings used for your editor match the ones given here, including the reference HDRi. Any deviation from these settings may cause visual differences between your editor and in-world.
- Check your content against a glTF reference viewer; such as:
If the above steps fail, then please file a JIRA.
A good JIRA will include:
- An LM to a location where the problem can be examined in-world.
- A copy of the glTF content, attached to the JIRA.
- Screenshots of the representation in-world, in a reference viewer, and in-editor.
- You should include screenshots of the object inside a manually placed reflection probe, and outside.