GlTF PBR: Difference between revisions
(More on actual data returned.) |
m (Adding backlink to the opensimulator main index page and to the Asset types list) |
||
Line 1: | Line 1: | ||
''[[Opensimulator]]: Documentation: [[Asset types]]: GlTF PBR'' | |||
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.[https://wiki.secondlife.com/wiki/PBR_Materials] This Wiki entry covers how the data about physically based materials is conveyed from server to viewer. | 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.[https://wiki.secondlife.com/wiki/PBR_Materials] This Wiki entry covers how the data about physically based materials is conveyed from server to viewer. | ||
Revision as of 02:48, 29 June 2023
Opensimulator: Documentation: Asset types: GlTF PBR
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.