Sceneform asset file reference

The Sceneform Asset Definition (*.sfa) file is a human-readable description of the Sceneform Binary asset (*.sfb). It points to the models and textures in your source asset and also defines materials by providing material parameters for Sceneform’s physically-based materials.

This file gets automatically generated on first import by the Sceneform Android Studio plugin, but you can tweak the parameters to change the look of your asset. This reference describes a list of parameters that you can configure.
syntax:
{
   materials: [
      {
         name: "<name>",
         parameters: [
            {
               <parameterName>: <parameterDefaultValue>,
            },
            ...
         ],
         source: "path/to/source_material.sfm",
      },
      ...
   ],
   model: {
      attributes: [
         "Position",
         "TexCoord",
         "Orientation",
      ],
      file: "path/to/source_asset.ext",
      name: "<Name>",
     [scale: 1.0,]
     [recenter: false,]
   },
   samplers: [
      {
         file: "path/to/source_texture.ext",
         name: "<name>",
         params: {
            usage_type: "Color",
           [mag_filter: "Linear",]
           [min_filter: "NearestMipmapLinear",]
           [wrap_s: "Repeat",]
           [wrap_t: "Repeat",]
         },
         pipeline_name: "<pipeline_name>",
      },
      ...
   ]
}
description:
Defines a Renderable and it's associated data.
attributes:
materials[].parameters
The contents of this block will depend on the source .sfm used to build this material:
model.attributes
Defines the set of exported vertex streams computed during import of the source model.
model.scale
Optional attribute controlling the scale of the exported model vs. the source asset contents.

A scale of 2.0 will make the asset twice as big

model.recenter
Optional attribute, defaults to false. Setting this to true will place the center of the exported geometry at the origin.
samplers[].params.usage_type
Defines how the runtime interprets the encoded image data. Setting this to "Color" for sRGB image textures. A value of "Data" or "Normal" tells the runtime to treat the contents of the image as if they are in linear space.
samplers[].params.mag_filter
Defines the minification filter used when the sampled mipmap is larger than the pixel size of the geometry sampling it. Possible values are:
Value Description
"Nearest" Corresponds to GL_NEAREST. Returns the value of the texture element that is nearest (in Manhattan distance) to the center of the pixel being textured.
"Linear" Corresponds to GL_LINEAR. Returns the weighted average of the four texture elements that are closest to the center of the pixel being textured. These can include border texture elements, depending on the values of texture wrap_s and texture wrap_t, and on the exact mapping.
samplers[].params.min_filter
Defines the minification filter used when the sampled mipmap is larger than the pixel size of the geometry sampling it. Possible values are:
Value Description
"Nearest" Corresponds to GL_NEAREST. Returns the value of the texture element that is nearest (in Manhattan distance) to the center of the pixel being textured.
"Linear" Corresponds to GL_LINEAR. Returns the weighted average of the four texture elements that are closest to the center of the pixel being textured. These can include border texture elements, depending on the values of texture wrap_s and texture wrap_t, and on the exact mapping.
"NearestMipmapNearest" Corresponds to GL_NEAREST_MIPMAP_NEAREST. Chooses the mipmap that most closely matches the size of the pixel being textured and uses the "Nearest" criterion (the texture element nearest to the center of the pixel) to produce a texture value.
"LinearMipmapNearest" Corresponds to GL_NEAREST_MIPMAP_LINEAR. Chooses the two mipmaps that most closely match the size of the pixel being textured and uses the "Nearest" criterion (the texture element nearest to the center of the pixel) to produce a texture value from each mipmap. The final texture value is a weighted average of those two values.
"LinearMipmapLinear" Corresponds to GL_LINEAR_MIPMAP_LINEAR. Chooses the two mipmaps that most closely match the size of the pixel being textured and uses the "Linear" criterion (a weighted average of the four texture elements that are closest to the center of the pixel) to produce a texture value from each mipmap. The final texture value is a weighted average of those two values.
samplers[].params.wraps
Optional attribute, defaults to "Repeat". Controls the horizontal wrapping behavior.
Value Description
"ClampToBorder" Corresponds to GL_CLAMP_TO_BORDER.
"ClampToEdge" Corresponds to GL_CLAMP_TO_BORDER.
"MirroredRepeat" Corresponds to GL_MIRRORED_REPEAT.
"MirrorClampToEdge" Corresponds to GL_MIRROR_CLAMP_TO_EDGE.
"Repeat" Corresponds to GL_REPEAT.
samplers[].params.wrapt
Optional attribute, defaults to "Repeat". Controls the vertical wrapping behavior.
Value Description
"ClampToBorder" Corresponds to GL_CLAMP_TO_BORDER.
"ClampToEdge" Corresponds to GL_CLAMP_TO_BORDER.
"MirroredRepeat" Corresponds to GL_MIRRORED_REPEAT.
"MirrorClampToEdge" Corresponds to GL_MIRROR_CLAMP_TO_EDGE.
"Repeat" Corresponds to GL_REPEAT.
parameters for obj_material:
Breakdown of parameters in obj_material.sfm.
Parameter Description
baseColor

<sampler_name>: Compute baseColor as the value from the sampler times the interpolated color

null: Compute baseColor as the interpolated color (or white if no interpolated color is present)

baseColorTint

vec4: Applies a tint to the computed baseColor value. Color specified as [r, b, g, a].

metallic

float: Controls the metallicity of the material. Use 0 for non-metallic materials, 1 for metallic materials

roughness

float: controls the roughness of the material. Use low roughness for shiny materials, high roughness for diffuse materials

opacity

null: opaque

float: transparency enabled; 1.0 == fully opaque, 0.0 == fully transparent

parameters for fbx_material:
Breakdown of parameters in fbx_material.sfm.
Parameter Description
baseColor

vec4: A tint factor on the result of baseColorMap. Specified as [r, g, b, a].

baseColorMap

sampler_name: Result is the value of the baseColorMap sampler.

null: Resolves to White.

normalMap

sampler_name: Interprets the sample result as a tangent-space normal, uses in lighting computations.

null: Use a constant [0, 0, 1] as our tangent-space normal.

metallic

float: Controls the metallicity of the material. Use 0 for non-metallic materials, 1 for metallic materials. Scales metallicMap.

metallicMap

sampler_name: Use the red channel value from the sampler as our metallicMap value.

null: Emit a constant 1.0 to be scaled by metallic.

roughness

float: Controls the roughness of the material. Use low roughness for shiny materials, high roughness for diffuse materials. Scales roughnessMap.

roughnessMap

sampler_name: Use the red channel value from the sampler as our roughnessMap value.

null: Emit a constant 1.0 to be scaled by roughness.

reflectance

float: Controls the reflectance of a material. The default of 0.5 covers almost all possible materials.

opacity

null: No explicit opacity control. If an opacity map was specified in the source data, the material will be rendered with transparent blending.

parameters for gltf_material:
Breakdown of parameters in gltf_material.sfm.
Parameter Description
baseColorFactor

vec4: A tint factor on the result of baseColor. Specified as [r, g, b, a].

normal

sampler_name: Interprets the sample result as a tangent-space normal, uses in lighting computations.

null: Use a constant [0, 0, 1] as our tangent-space normal.

metallicFactor

float: Controls the metallicity of the material. Use 0 for non-metallic materials, 1 for metallic materials. Scales metallicRoughness.

roughnessFactor

float: controls the roughness of the material. Use low roughness for shiny materials, high roughness for diffuse materials. Scales metallicRoughness.

metallicRoughness

sampler_name: Use the green channel from the sampler for roughness (scaled by roughnessFactor). Use the blue channel from the sampler for metallic (scaled by metallicFactor).

null: Use metallicFactor and roughnessFactor.

occlusion

sampler_name: Use the red channel from the sampler for ambient occlusion.

null: If the metallicRoughness texture is present, use the red channel to drive ambient occlusion.

emissiveFactor

float: controls the emission of the material. Use 0 for materials which do not generate their own light. Scales emissive.

emissive

sampler_name: Use the color from the sampler as our emissive value.

null: No emission.

reflectance

float: Controls the reflectance of a material. The default of 0.5 covers almost all possible materials.

opacity

null: no explicit opacity control. If alpha cutoff was specified in the source data, the material will be rendered with masked blending. If blending was enabled on the source content, transparency will be enabled.

Send feedback about...