Skip to main content

glTF Files

This section provides additional information on the use of glTF files.files in Scene Composer.


Animations

ThereScene isComposer provides a working sample availablethat showingshows thehow usageto ofuse glTF animations. For this, please refer toSee Physically Based Rendering Solution for details.

InterpolationScene animationComposer issupports available,interpolation howeveranimation; Morphinghowever, andmorphing or the channel path "weights" are not available.supported.

AnimationThe of:following animation types are supported:

  • translation
  • rotation
  • scale is available.scale.

Also, theThe following Interpolationinterpolation strategies are available:supported:

  • linear
  • step
  • cubicspline

InglTF glTFspecifies rotation angles are specified in quaternions,quaternions. forCGIStudio usage in CGIStudio,converts the values are converted to Euler-Euler angles.

For a more detailedinformation descriptionabout onanimations, animationssee please refer to the Khronos website: animations. For a more detailed description onabout interpolation types please refer tosee the Khronos website: animation sampler.



SDKThe Software Development Kit (SDK) version

The glTF importer uses the Microsoft glTF-SDK in version v1.9.1.0. ItDownload canthe beMicrosoft downloadedglTF-SDK from GithubMicrosoft gtTF-SDK GitHub repository.



Reference models

AScene Composer uses the boombox as a reference modelmodel. thatThe isfolder beingcgi_studio_content/3D/glTF/ used iscontains the boombox. The glTF filefile. is available at the folder cgi_studio_content/3D/glTF/. Available reference models can be found at:Visit The Khronos website: glTF Sample Models. to find more available reference models.

drawing-4-1676342296.pngdrawing-4-1676342296.png


Supported glTF Extensions and Multi UV

Scene Composer’s glTF import supports the following glTF 2.0 extensions as well as multiple UV sets (Multi UV).

Extension Description KHR_lights_punctual Imports point, spot, and directional lights defined in the glTF file as lights in Scene Composer. KHR_materials_anisotropy Reproduce materials with anisotropic highlights, such as brushed metal. KHR_materials_clearcoat Reproduces materials that have a clear-coat layer (clear paint). KHR_materials_ior Specifies the Index of Refraction (IOR) and improves refraction for materials such as glass. KHR_materials_iridescence Represents iridescence effects where the color changes depending on the viewing and incident angles.

KHR_materials_specular

Supports materials that independently control the intensity and color of specular reflection. KHR_materials_unlit

Supports “unlit” materials that are not affected by lighting calculations.

 

KHR_texture_transform

Interprets UV transforms such as offset, scale, and rotation per texture.

 

KHR_materials_emissive_strength

This extension scales the emissive color or texture by a scalar emissiveStrength factor, allowing materials to represent much brighter emission, especially in HDRhigh dynamic range (HDR) rendering environments.

 

KHR_materials_sheen

This extension adds a sheen layer on top of an existing PBRphysically based rendening (PBR) material to simulate soft, fabric-like highlights caused by fine microfibers such as cloth or velvet.

 

Even when UV sets other than `uv0`uv0 are specified in these extensions, Scene Composer imports multiple UV sets (Multi UV) and assigns them to the corresponding textures.

Limitations
  • InLimitations ESin OpenGL Embedded Systems (ES) 2.0 environments,might due to the limitations of ES 2.0, importingprevent some sample glTF files that use these extensions mayfrom not produceproducing the expected visual results.results in ES 2.0 environments.

  • Some extensions, such as KHR_materials_anisotropy, KHR_materials_iridescence, KHR_materials_specular, KHR_materials_ior, KHR_materials_emissive_strength and KHR_materials_sheen cannot be used together with KHR_materials_unlit by design.

  • Meshes that use KHR_materials_anisotropy must have normal and tangent attributes, or the base material must have a normal map. If these conditions are not met, the anisotropy effect may not be rendered correctly.

For details on the properties and parameters of each extension, refer to the glTF 2.0 extension specifications  provided by Khronos.


PyhsicallyPhysically Based Shading (PBS)

OnThe importer applies the metal-roughness material model to the imported 3d modelmodel. If the metalglTF roughnessfile materialdoes modelnot isdefine applied.image-based Iflightning no(IBL) IBLtextures, texturesthe areimporter definedapplies a default materialmaterial. isScene applied.Composer Theprovides shaders are provided for OpenGL ES 2.0 and 3.0.

InThe property names used in SceneComposer the properties are called differentlydiffer from the glTF standard:

    Standard theProperty standardName propertyUsage in SceneComposer baseColor is called u_Base Color Factor the standard propertymetallic metallic is determined by the X value in the u_Metallic Roughness ValuesValue the standard propertyroughness roughness is determined by the Y value in the u_Metallic Roughness
    Values

    The followingimporter propertiesautomatically ofsets the following appearance and shader are automatically set by the Importer,properties, but you can also beconfigure configuredthem manually:

    Uniforms:
    Optional
      Uniform "u_MetallicRoughnessValues"Name Description

      u_MetallicRoughnessValues holds the metallic factor in X,X and the roughness factor in Y. TheseThe shader multiplies these values are multiplied with the metallic and roughness values from the metallic-roughness texture on a per per-pixel basis. If there is no such texture,texture exists, the shader uses the values from the uniform areinstead. used instead. "u_BaseColorFactor"
      (RGBA)u_BaseColorFactor is multiplieda factor that the shader multiplies with the value from the albedo texture on a per per-pixel basis. If there is no such texture,texture exists, the shader uses the values from the uniform areinstead. used instead. "u_MipmapCount"
      Theu_MipmapCount specifies the number of mipmapsmipmaps, (excluding level 0)0, from the specular/radiance texture. (Optional) "u_NormalScale" optional u_NormalScale is a factor that isthe multipliedshader multiplies with the X and Y component of the normal. This uniform is available only available if HAS_NORMALMAP has been defined in the fragment shader and vertex shader.shader (Optional)define "u_OcclusionStrength"HAS_NORMALMAP. optional u_OcclusionStrength is a factor for the linear interpolation between the color and the color times ambient occlusion. This uniform is available only available if HAS_OCCLUSIONMAP is defined in the fragment shader and the vertex shader.shader (Optional)define "u_EmissiveFactor"HAS_OCLUSIONMAP. (RGB) optional u_EmissiveFactor is multiplieda factor that the shader multiplies with the value from the emissive texture on a per per-pixel basis. This uniform is available only available if HAS_ HAS_EMISSIVEMAP is defined in the fragment shader and the vertex shader.shader define HAS_EMISSIVEMAP

       

      drawing-5-1726241135.pngdrawing-5-1726241135.png
       Textures:


      • (Optional)Optional TheTexture Name Channels Texture Level Description
      optional albedo texture (RGBA)RGBA must0 be setSet at texture unit 0, and define HAS_BASECOLORMAP must be defined in the fragment shader. (Optional) The optional metallic-roughness texture (GB)GB must1 be setSet at texture unit 1, and define HAS_METALROUGHNESSMAP must be defined in the fragment shader. The metallic values must be stored in the blue channel. The roughness valuesvalue must be stored in the green channel of the texture. (Optional) The optional tangent-space normal (RGB)RGB texture2 must be setSet at texture unit 2, and define HAS_NORMALMAP must be defined in the fragment shader and vertex shader. (Optional) The optional occlusion textureR (R)3 must be setSet at texture unit 3, and define HAS_OCCLUSIONMAP must be defined in the fragment shader and vertex shader. The occlusion values are stored in the red channel of the texture. (Optional) The optional emissive textureRGB (RGB)4 must be setSet at texture unit 4, and define HAS_EMISSIVEMAP must be defined in the fragment shader and the vertex shader. optional Image-based lighting (Optional)IBL) IBL
      textures. The

      Provide the following textures must be present for IBL to work correctly.correctly:

      • Thediffuse diffuse/irradianceradiance cubemap (RGB)see mustbelow)
      bespecular/radiance setcubemap (see below) bidirectional reflectance distribution function (BRDF) (see below) optional IBL - diffuse radiance cubemap RGB 5

      Set at texture unit 5, and define USE_IBL must be defined in the fragment shader.

      The optional IBL - specular/radiance cubemap (RGB)RGB must6 be set

      Set at texture unit 6, and define USE_IBL must be defined in the fragment shader. TheBuild the specular pre-convolved environment must be built into the mipmaps. The importer automatically sets the number of mipmapsmipmaps, (excluding level 0) is set0, in the shader uniform "u_MipmapCount"u_MipmapCount. automaticallyIf byyou the importer, or must be configured manually ifset this cubemap ismanually, setconfigure this value manually.

      The BRDF texture optional IBL - bidirectional reflectance distribution function (RG)BRDF) mustRG be7 set

      Set at texture unit 7, and define USE_IBL must be defined in the fragment shader.


      DetailsThe Scene Tree shows details of the imported appearance are shown in the scene tree:appearance:

      drawing-5-1732892596.pngdrawing-5-1732892596.png



      Mesh:
      Optional
        Mesh PositionProperties isDescription mandatory.
        (Optional) If
        position Provide the meshmandatory hasposition normals,attribute. optional normals Define HAS_NORMALS must be defined in the fragment shader and vertex shader. (Optional) If theoptional meshtangents hasDefine tangents, HAS_TANGENTS must be defined in the fragment shader and vertex shader. (Optional) If theoptional mesh as a uv set,set Define HAS_UV must be defined in the fragment shader and vertex shader.

         

        glTF_shader_variants.pngglTF_shader_variants.png

        The image shows different shader variants variants (Click the image to enlarge image)it).
        Uniform Setter:
          Optional ModelUniform ViewSetter ProjectionDescription   model view projection Provide the mandatory model view projection.   model matrix isProvide mandatory.the Model matrix is mandatory. Normalmandatory model matrix
          normal model matrix Provide the normal model matrix, which is mandatory if the shader defines HAS_NORMALS and HAS_TANGENTS. are defined
          in
          the

           shader.

          Optimization tips:Tips:
          • Use one texture for occlusion, roughness, and metallic values, stored as an RGB texture.
          • Providing tangents in the mesh avoids calculating the tangent space matrix on a per pixel basis.

          For a more detailedinformation descriptionabout onphysically Pysicallybased Basedrendering, Rendering please refer tosee the Khronos website: metallic roughness.



          Khronos Referencesreferences include the following resources:

          The Khronos Specificationspecification is available here:

          ViewersThe following viewers are available: