toJson method

Map<String, Object?> toJson({
  1. bool includeUniformBytes = false,
})

includeUniformBytes adds each block's packed bytes, so a loaded capture keeps them.

Implementation

Map<String, Object?> toJson({bool includeUniformBytes = false}) => {
  'pass': passIndex,
  'order': order,
  'phase': phase.name,
  if (nodePath != null) 'node': nodePath,
  if (materialType != null) 'material': materialType,
  if (materialSource != null) 'materialSource': materialSource,
  if (geometryType != null) 'geometry': geometryType,
  if (vertexShaderName != null) 'vertexShader': vertexShaderName,
  if (fragmentShaderName != null) 'fragmentShader': fragmentShaderName,
  if (pipelineId != null) 'pipeline': pipelineId,
  'vertexCount': vertexCount,
  'instanceCount': instanceCount,
  'indexed': indexed,
  'batchedItems': batchedItems,
  'batchBreak': batchBreak.name,
  'uniformBlocks': [
    for (final block in uniformBlocks)
      block.toJson(this, includeBytes: includeUniformBytes),
  ],
};