import { BinaryDataType } from "../../../../../../core/binary/type/BinaryDataType.js";
import { AttributeGroupSpec } from "../../../../geometry/AttributeGroupSpec.js";
import { AttributeSpec } from "../../../../geometry/AttributeSpec.js";

//build particle spec
export const PARTICULAR_PARTICLE_SPECIFICATION = new AttributeGroupSpec();

PARTICULAR_PARTICLE_SPECIFICATION.add(AttributeSpec.fromJSON({
    name: 'position',
    itemSize: 3,
    type: BinaryDataType.Float32,
    normalized: false
}));
PARTICULAR_PARTICLE_SPECIFICATION.add(AttributeSpec.fromJSON({
    name: 'age',
    itemSize: 1,
    type: BinaryDataType.Float32,
    normalized: false
}));
PARTICULAR_PARTICLE_SPECIFICATION.add(AttributeSpec.fromJSON({
    name: 'deathAge',
    itemSize: 1,
    type: BinaryDataType.Float32,
    normalized: false
}));

PARTICULAR_PARTICLE_SPECIFICATION.add(AttributeSpec.fromJSON({
    name: 'atlasPatch',
    itemSize: 4,
    type: BinaryDataType.Uint16,
    normalized: true
}));

// TODO convert "size" to scale instead
PARTICULAR_PARTICLE_SPECIFICATION.add(AttributeSpec.fromJSON({
    name: 'size',
    itemSize: 1,
    type: BinaryDataType.Float32,
    normalized: false
}));

PARTICULAR_PARTICLE_SPECIFICATION.add(AttributeSpec.fromJSON({
    name: 'layerPosition',
    itemSize: 1,
    type: BinaryDataType.Uint8,
    normalized: false
}));

PARTICULAR_PARTICLE_SPECIFICATION.add(AttributeSpec.fromJSON({
    name: 'velocity',
    itemSize: 3,
    type: BinaryDataType.Float32,
    normalized: false
}));
PARTICULAR_PARTICLE_SPECIFICATION.add(AttributeSpec.fromJSON({
    name: 'rotation',
    itemSize: 1,
    type: BinaryDataType.Float32,
    normalized: false
}));
PARTICULAR_PARTICLE_SPECIFICATION.add(AttributeSpec.fromJSON({
    name: 'rotationSpeed',
    itemSize: 1,
    type: BinaryDataType.Float32,
    normalized: false
}));
PARTICULAR_PARTICLE_SPECIFICATION.add(AttributeSpec.fromJSON({
    name: 'color',
    itemSize: 4,
    type: BinaryDataType.Uint8,
    normalized: true
}));
PARTICULAR_PARTICLE_SPECIFICATION.add(AttributeSpec.fromJSON({
    name: 'blending',
    itemSize: 1,
    type: BinaryDataType.Float32,
    normalized: false
}));
PARTICULAR_PARTICLE_SPECIFICATION.add(AttributeSpec.fromJSON({
    name: 'size_initial',
    itemSize: 1,
    type: BinaryDataType.Float32,
    normalized: false
}));
