SpatialMaterial constructor

SpatialMaterial({
  1. Color albedoColor = const Color(0xFFFFFFFF),
  2. Texture? albedoTexture,
  3. double metallic = 0.8,
  4. double roughness = 0.6,
})

Implementation

SpatialMaterial({
  this.albedoColor = const Color(0xFFFFFFFF),
  Texture? albedoTexture,
  this.metallic = 0.8,
  this.roughness = 0.6,
}) : albedoTexture = albedoTexture ?? Texture.standard,
     super(
       vertexShader: Shader.vertex(
         asset:
             'packages/flame_3d/assets/shaders/spatial_material.shaderbundle',
         slots: [
           UniformSlot.value('VertexInfo', {
             'model',
             'view',
             'projection',
           }),
           UniformSlot.value(
             'JointMatrices',
             List.generate(_maxJoints, (index) => 'joint$index').toSet(),
           ),
         ],
       ),
       fragmentShader: Shader.fragment(
         asset:
             'packages/flame_3d/assets/shaders/spatial_material.shaderbundle',
         slots: [
           UniformSlot.sampler('albedoTexture'),
           UniformSlot.value('Material', {
             'albedoColor',
             'metallic',
             'roughness',
           }),
           ...LightingInfo.shaderSlots,
           UniformSlot.value('Camera', {'position'}),
         ],
       ),
     );