Difference between revisions of "PBR Terrain"

From Second Life Wiki
Jump to navigation Jump to search
 
(20 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{hint
[[Category:glTF]]
|mode=warning
|title_desc=Future feature
|desc=This function will be supported in the upcoming PBR Terrain project.</b><br/>Currently it will only work in supported testing areas with a supported test viewer.
}}


== What is it? ==
== What is it? ==


The PBR Terrain project brings [[PBR_Materials|PBR materials]] to the [[Terrain]] in Second Life.
[[File:Pbr_terrain_mountain_pass.jpg|400px]]
 
PBR Terrain is a feature which allows applying [[PBR_Materials|PBR materials]] to the [[Terrain]] in Second Life.
 
PBR Terrain was released in the Second Life Featurettes viewer, which also added 2K textures and mirrors. Unlike PBR materials on prims, PBR terrain does not provide a non-PBR fallback. Older viewers will see grey terrain.
 
PBR Terrain supports all of the features of SL PBR material assets, with the exception of double-sided and alpha blend. Material assets with these unsupported features cannot be applied to terrain.


This viewer is a prototype. Safety not guaranteed.
Triplanar mapping is enabled by default on PBR terrain when the graphics quality setting is set to "High" or higher.


== How to apply PBR Terrain ==
== How to apply PBR Terrain ==


Before you can apply PBR terrain, you will need to acquire some PBR material items, which can currently be found on the Beta grid.
Before you can apply PBR terrain, you will need to acquire some PBR material items.
 
A PBR region is not required, but PBR terrain will only be visible to other users who also are using the PBR terrain viewer.


Method 1: Use the Region/Estate tool (requires region terrain edit permission)
Method 1: Use the Region/Estate tool (requires region terrain composition edit permission)


# Click World > Region/Estate > Terrain
# Click World > Region/Estate > Terrain
# Click on Terrain Textures and set the drop-down to Material Textures
# Click on Terrain Textures and ensure "PBR Metallic Roughness" is checked
# Set PBR materials for all four material swatches
# Set PBR materials for all four material swatches
# Click Apply
# Click Apply
# To go back to using terrain textures, remove all PBR materials, set the drop-down to Terrain Textures, and apply the desired textures
# To go back to using terrain textures, uncheck "PBR Metallic Roughness", and apply the desired textures


Method 2: Use the debug settings (not persistent, visible only to you, debug settings subject to removal)
Method 2: Use the debug settings (not persistent, visible only to you, debug settings subject to removal)
Line 29: Line 29:
# Click Advanced > Show Debug Settings
# Click Advanced > Show Debug Settings
# Copy the material UUID you want from your inventory to your clipboard
# Copy the material UUID you want from your inventory to your clipboard
# Set LocalTerrainAsset1, LocalTerrainAsset2, etc to the material UUIDs you want to use. All of the material terrain ID debug settings must be set in order for the client-only terrain materials to show up.
# Set LocalTerrainAsset1, LocalTerrainAsset2, etc to the material UUIDs you want to use
# To go back to using the real terrain textures/materials, set LocalTerrainAsset1, LocalTerrainAsset2, etc all back to their defaults, or restart your viewer
# To go back to using the real terrain textures/materials, set LocalTerrainAsset1, LocalTerrainAsset2, etc all back to their defaults, or restart your viewer
=== Texture Transforms ===
{{hint
|mode=warning
|title_desc=Future feature
|desc=This feature will be supported in the upcoming "Barbecue" simulator release.</b><br/>Currently it will only work in supported testing areas with a supported viewer.
}}
Custom texture transforms can be applied to PBR terrain, allowing for custom scale, rotation, or offset. There is one texture transform per material swatch (4 total). Applying a texture transform to each individual texture info is not supported.
The transforms are thus compliant with a subset of the [https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_texture_transform KHR_texture_transform] specification. The [https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#images UV origin] is defined as the Southwest corner of the region, with positive U facing East and positive V facing South.
Method 1: Use the Region/Estate tool (requires region terrain composition edit permission)
# Click World > Region/Estate > Terrain
# Click on Terrain Textures and ensure "PBR Metallic Roughness" is checked
# Set PBR materials for all four material swatches as desired
# Go to the "Transforms" sub-tab, and set texture transform parameters for each material as desired
# To go back to using the respective default texture transforms, set the respective settings to their defaults
Method 2: Use the debug settings (not persistent, visible only to you, debug settings subject to removal)
# Click Advanced > Show Debug Settings
# '''Important''': Ensure LocalTerrainAsset1, LocalTerrainAsset2, etc are set to valid materials (Local terrain texture transforms will not affect the persistent region terrain, even if the region terrain uses PBR)
# Look for debug settings prefixed with, "LocalTerrainTransform", and set their values as desired. For example, LocalTerrainTransform1Rotation sets the rotation for material 1.
# To go back to using the respective default texture transforms, set the respective settings to their defaults


== Graphics support ==
== Graphics support ==
=== Emissive texture ===


When possible, PBR terrain respects all parameters of version 1.1 of the [[PBR_Materials|SL Material asset]], with the exception of double-sided.
When possible, PBR terrain respects all parameters of version 1.1 of the [[PBR_Materials|SL Material asset]], with the exception of double-sided.
Line 38: Line 67:
[[File:PBR_Terrain_with_all_textures.jpeg|400px]]
[[File:PBR_Terrain_with_all_textures.jpeg|400px]]


On graphics drivers that do not support binding more than 16 textures, the emissive textures will be dropped, in accordance with the [[https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#additional-textures GLTF specification]].
On graphics drivers that do not support binding more than 16 textures, the emissive textures will be dropped, in accordance with the [https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#additional-textures GLTF specification].


[[File:Pbr_terrain_no_emissive.jpg|400px]]
[[File:Pbr_terrain_no_emissive.jpg|400px]]
=== Other textures ===
Further terrain textures may be dropped at low graphics settings to maintain performance.
== Developer Information ==
The Second Life viewer determines the terrain type via a double-lookup of the asset IDs.
For PBR terrain, texture repeats are sent both ways as [[GLTF_Overrides|GLTF overrides]] in LSL notation format.
Further implementation details of PBR terrain can be found in the following test documents:
* https://github.com/secondlife/viewer/blob/develop/doc/testplans/terrain_loading.md
* https://github.com/secondlife/viewer/blob/develop/doc/testplans/pbr_terrain_appearance.md
* https://github.com/secondlife/viewer/blob/develop/doc/testplans/pbr_terrain_composition.md

Latest revision as of 14:49, 17 October 2024


What is it?

Pbr terrain mountain pass.jpg

PBR Terrain is a feature which allows applying PBR materials to the Terrain in Second Life.

PBR Terrain was released in the Second Life Featurettes viewer, which also added 2K textures and mirrors. Unlike PBR materials on prims, PBR terrain does not provide a non-PBR fallback. Older viewers will see grey terrain.

PBR Terrain supports all of the features of SL PBR material assets, with the exception of double-sided and alpha blend. Material assets with these unsupported features cannot be applied to terrain.

Triplanar mapping is enabled by default on PBR terrain when the graphics quality setting is set to "High" or higher.

How to apply PBR Terrain

Before you can apply PBR terrain, you will need to acquire some PBR material items.

Method 1: Use the Region/Estate tool (requires region terrain composition edit permission)

  1. Click World > Region/Estate > Terrain
  2. Click on Terrain Textures and ensure "PBR Metallic Roughness" is checked
  3. Set PBR materials for all four material swatches
  4. Click Apply
  5. To go back to using terrain textures, uncheck "PBR Metallic Roughness", and apply the desired textures

Method 2: Use the debug settings (not persistent, visible only to you, debug settings subject to removal)

  1. Click Advanced > Show Debug Settings
  2. Copy the material UUID you want from your inventory to your clipboard
  3. Set LocalTerrainAsset1, LocalTerrainAsset2, etc to the material UUIDs you want to use
  4. To go back to using the real terrain textures/materials, set LocalTerrainAsset1, LocalTerrainAsset2, etc all back to their defaults, or restart your viewer

Texture Transforms

Emblem-important-red.png Warning! Future feature

This feature will be supported in the upcoming "Barbecue" simulator release.
Currently it will only work in supported testing areas with a supported viewer.

Custom texture transforms can be applied to PBR terrain, allowing for custom scale, rotation, or offset. There is one texture transform per material swatch (4 total). Applying a texture transform to each individual texture info is not supported.

The transforms are thus compliant with a subset of the KHR_texture_transform specification. The UV origin is defined as the Southwest corner of the region, with positive U facing East and positive V facing South.

Method 1: Use the Region/Estate tool (requires region terrain composition edit permission)

  1. Click World > Region/Estate > Terrain
  2. Click on Terrain Textures and ensure "PBR Metallic Roughness" is checked
  3. Set PBR materials for all four material swatches as desired
  4. Go to the "Transforms" sub-tab, and set texture transform parameters for each material as desired
  5. To go back to using the respective default texture transforms, set the respective settings to their defaults

Method 2: Use the debug settings (not persistent, visible only to you, debug settings subject to removal)

  1. Click Advanced > Show Debug Settings
  2. Important: Ensure LocalTerrainAsset1, LocalTerrainAsset2, etc are set to valid materials (Local terrain texture transforms will not affect the persistent region terrain, even if the region terrain uses PBR)
  3. Look for debug settings prefixed with, "LocalTerrainTransform", and set their values as desired. For example, LocalTerrainTransform1Rotation sets the rotation for material 1.
  4. To go back to using the respective default texture transforms, set the respective settings to their defaults

Graphics support

Emissive texture

When possible, PBR terrain respects all parameters of version 1.1 of the SL Material asset, with the exception of double-sided.

PBR Terrain with all textures.jpeg

On graphics drivers that do not support binding more than 16 textures, the emissive textures will be dropped, in accordance with the GLTF specification.

Pbr terrain no emissive.jpg

Other textures

Further terrain textures may be dropped at low graphics settings to maintain performance.

Developer Information

The Second Life viewer determines the terrain type via a double-lookup of the asset IDs.

For PBR terrain, texture repeats are sent both ways as GLTF overrides in LSL notation format.

Further implementation details of PBR terrain can be found in the following test documents: