Difference between revisions of "PBR Materials"

From Second Life Wiki
Jump to navigation Jump to search
(Add another link. Add LSL section.)
 
Line 100: Line 100:
== 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 ==

Latest revision as of 19:24, 25 January 2024

Physically Based Rendering [Work in Progress]

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?

The lamp in this screenshot uses Blinn-Phong (Classic SL Materials), and was created before PBR's integration into SL; and demonstrates some of the visual differences to existing content. The environment used for the screenshot is the viewer's default Midday preset (Note that the PBR viewer has a new Midday preset).

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.

Limited Advanced Graphics Options.

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

Material Editing

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.

KBcaution.png 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.

Drag and Drop Functionality.

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.

Menu drop-down demonstration.
Dropdown as of v7.0.1.689


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:

The above tutorials require knowledge and access to Adobe's Substance Painter (subscription based software on Adobe website, or sold as perpetual licence with one year of updates on Steam). Below are some open source tools and links found Googling 'Blender', 'glTF' (requiring Blender 3.3)

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.

KBcaution.png 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.

Essay.png
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.

Manual Probe Creation UI.
  • 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

KBwarning.png 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.

A diagram of how spherical probes function (or, don't function as you may expect) while non-uniformly-scaled.

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

KBwarning.png 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.

Essay.png
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

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...

PBR Upload in main build menu.

Select a .GLB or a .GLTF file from your computer and Open it: This will give the following window:

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 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.

KBcaution.png 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.

The PBR Materials UI in the Build Floater.
  • 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.
KBwarning.png 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.

KBtip2.png 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.

KBtip2.png 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.
KBcaution.png 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

KBwarning.png 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.


KBcaution.png 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.

KBcaution.png 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

KBcaution.png 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.


KBcaution.png 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: 1024
  • Normal Map Format: OpenGL (Y+)
  • Compute Tangents Per Fragment: YES

Under "Display Settings":

  • Tonemapping - Function: ACES

When exporting:

  • Output Template: glTF PBR Metal Roughness
  • Size: Based on each Texture Set's size
  • Padding: Dilation + default background color - 8 bit

Adobe Substance 3D Designer

KBcaution.png 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

KBwarning.png 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.