Difference between revisions of "GLTF Overrides"

From Second Life Wiki
Jump to navigation Jump to search
(Create page on GLTF overrides. Targeting a scripting audience for now.)
 
Line 37: Line 37:
== Permissions ==
== Permissions ==


When a no-mod GLTF material is applied to a prim, its GLTF overrides cannot be modified, with the exception of texture transforms.
When a no-mod GLTF material is applied to a prim face, its GLTF overrides cannot be modified, with the exception of texture transforms.

Revision as of 17:15, 28 August 2023

Emblem-important-red.png Warning! Future feature

This function will be supported in the upcoming PBR Terrain project.
Currently it will only work in supported testing areas with a supported test viewer.

What are they?

GLTF Overrides are an implementation detail of PBR materials, which only makes sense when a GLTF material is applied to a face of a prim.

A GLTF override is a collection of changes applied on top of a GLTF material asset, plus texture transforms.

Texture transforms

GLTF texture transforms behave differently than their Blinn-Phong counterparts, and instead follow the [KHR_texture_transform spec]. Because of this, texture animations are animated independently of the texture transforms.

Applying a GLTF material from LSL

These prim params affect the GLTF material on a face:

When setting PRIM_RENDER_MATERIAL on a face, most of the GLTF overrides will be cleared on that face, with the exception of texture transforms (repeats, offsets, and rotation_in_radians).

The rest of these prim params are GLTF overrides. For example, PRIM_GLTF_BASE_COLOR includes the GLTF base color properties as well as the base color texture transform. Setting any GLTF override parameter to the empty string ("") will unset it, causing the property of the underlying GLTF material asset to be used instead.

Note that it is not possible to read properties of the underlying GLTF material asset from scripts. If a property is unset, it will appear to be the default value when read from a script.

Attempting to set a GLTF override when PRIM_RENDER_MATERIAL is NULL_KEY will clear most GLTF overrides on that face, with the exceptions of texture transforms.

Permissions

When a no-mod GLTF material is applied to a prim face, its GLTF overrides cannot be modified, with the exception of texture transforms.