GlTF PBR: Difference between revisions

From Open Metaverse Wiki
(Begin glTF documentation)
 
(More on actual data returned.)
Line 6: Line 6:
For glTF materials, two new types of "extra parameter" have been added.
For glTF materials, two new types of "extra parameter" have been added.


=== RenderMaterial ===  
=== Render Material ===  
Extra parameter code: 0x80.
Extra parameter code: 0x80.


Line 13: Line 13:
An example is
An example is


* LLRenderMaterialParamsItem { idx: 2, id: 342177da-8093-c28f-cb5e-e1f02fabaa8b },  
* LLRenderMaterialParamsItem { idx: 0, id: a99f26b5-1cc1-40bc-a666-a6825592b188 },
* LLRenderMaterialParamsItem { idx: 0, id: 00000000-0000-0000-0000-000000000000 }]
* LLRenderMaterialParamsItem { idx: 1, id: a99f26b5-1cc1-40bc-a666-a6825592b188 },
* LLRenderMaterialParamsItem { idx: 2, id: a99f26b5-1cc1-40bc-a666-a6825592b188 },
* LLRenderMaterialParamsItem { idx: 3, id: a99f26b5-1cc1-40bc-a666-a6825592b188 },  
* LLRenderMaterialParamsItem { idx: 4, id: a99f26b5-1cc1-40bc-a666-a6825592b188 },
* LLRenderMaterialParamsItem { idx: 5, id: a99f26b5-1cc1-40bc-a666-a6825592b188 }


A zero UUID is null, and it is not yet clear what a zero UUID means in this context.
This indicates that material UUID a99f26b5-1cc1-40bc-a666-a6825592b188 is to be applied to faces 0..5, overriding any classic material information.
 
All zero UUIDs have been seen in Second Life messages but not in Open Simulator messages. This may be a bug.
 
The asset for this UUID is fetched using the "ViewerAsset" capability obtained from the seed capability.
This will be a URL with no trailing slash. An example from an OSGrid test region:
 
ViewerAsset": "http://plaza16.osgrid.org:9300/147ae4d1-b064-442c-80b3-f76b59e3fc71
 
The UUID points to a remote asset stored in binary LLSD format, with a proper binary LLSD header.
This contains information for finding the relevant glTF assets. The format of the URL to fetch is
 
    http://VIEWERASSETVALUE?material_id=UUID
 
which, in this case, would be
 
    http://plaza16.osgrid.org:9300/75357890-ffde-4d96-8473-a663238dcd21?material_id=a99f26b5-1cc1-40bc-a666-a6825592b188
 
Note that, for Open Simulator, these URLs are only valid for the duration of the login. For Second LIfe, they are persistent.
 
Reading this URL yields a set of key-value pairs in binary LLSD format, with keys such as "baseColor" and "pbrMetallicRoughness". The values are more UUIDs, requiring another stage of asset fetching.


=== Reflection Probe ===
=== Reflection Probe ===
Line 22: Line 46:


Content: One entry of (ambience, clip distance, flags)
Content: One entry of (ambience, clip distance, flags)
More information is needed.

Revision as of 13:15, 28 June 2023

Both Second Life and Open Simulator are adding a new class of assets for physically-based rendering. For an overview, see PBR Materials in the Second Lif Wiki.[1] This Wiki entry covers how the data about physically based materials is conveyed from server to viewer.

Object updates

Object updates can have "extra parameters", for objects such as lights and flexis. For glTF materials, two new types of "extra parameter" have been added.

Render Material

Extra parameter code: 0x80.

Content: an array of (face index, UUID).

An example is

  • LLRenderMaterialParamsItem { idx: 0, id: a99f26b5-1cc1-40bc-a666-a6825592b188 },
  • LLRenderMaterialParamsItem { idx: 1, id: a99f26b5-1cc1-40bc-a666-a6825592b188 },
  • LLRenderMaterialParamsItem { idx: 2, id: a99f26b5-1cc1-40bc-a666-a6825592b188 },
  • LLRenderMaterialParamsItem { idx: 3, id: a99f26b5-1cc1-40bc-a666-a6825592b188 },
  • LLRenderMaterialParamsItem { idx: 4, id: a99f26b5-1cc1-40bc-a666-a6825592b188 },
  • LLRenderMaterialParamsItem { idx: 5, id: a99f26b5-1cc1-40bc-a666-a6825592b188 }

This indicates that material UUID a99f26b5-1cc1-40bc-a666-a6825592b188 is to be applied to faces 0..5, overriding any classic material information.

All zero UUIDs have been seen in Second Life messages but not in Open Simulator messages. This may be a bug.

The asset for this UUID is fetched using the "ViewerAsset" capability obtained from the seed capability. This will be a URL with no trailing slash. An example from an OSGrid test region:

ViewerAsset": "http://plaza16.osgrid.org:9300/147ae4d1-b064-442c-80b3-f76b59e3fc71

The UUID points to a remote asset stored in binary LLSD format, with a proper binary LLSD header. This contains information for finding the relevant glTF assets. The format of the URL to fetch is

   http://VIEWERASSETVALUE?material_id=UUID

which, in this case, would be

   http://plaza16.osgrid.org:9300/75357890-ffde-4d96-8473-a663238dcd21?material_id=a99f26b5-1cc1-40bc-a666-a6825592b188

Note that, for Open Simulator, these URLs are only valid for the duration of the login. For Second LIfe, they are persistent.

Reading this URL yields a set of key-value pairs in binary LLSD format, with keys such as "baseColor" and "pbrMetallicRoughness". The values are more UUIDs, requiring another stage of asset fetching.

Reflection Probe

Extra parameter code: 0x90.

Content: One entry of (ambience, clip distance, flags)

More information is needed.