Skip to content

field counting rules v1

Paweł Waligóra edited this page Sep 16, 2024 · 1 revision

Field counting

Introduction

Different variable type values exist in different amounts. For example mesh will usually have different amount of vertices than indices.

variable types can be divided into cointing groups based on amount of data they will output.

Fields from different counting groups cannot be present in the same buffer definition.

Constants do not collide with any counting group and can be added freely to any buffer definition. With only restriction that buffer must contain at least one variable type in order to determine how many times to repeat the constant.

Counting groups:

  • per indice:

    • i, indice - indice
  • per vertex:

    • v, vertex - vertex
    • n, normal - normal
    • t, tangent - tangent
    • b, bitangent - bitangent
    • tex_coord - texture coordinate / uv set 0
    • uv0 - uv set 0
    • uv1 - uv set 1
    • uv2 - uv set 2
    • uv3 - uv set 3
    • uv4 - uv set 3
    • uv5 - uv set 5
    • uv6 - uv set 6
    • uv7 - uv set 7
    • vertex_color0 - vertex color 0 since v1.1.0
    • vertex_color1 - vertex color 1 since v1.1.0
    • vertex_color2 - vertex color 2 since v1.1.0
    • vertex_color3 - vertex color 3 since v1.1.0
    • vertex_color4 - vertex color 4 since v1.1.0
    • vertex_color5 - vertex color 5 since v1.1.0
    • vertex_color6 - vertex color 6 since v1.1.0
    • vertex_color7 - vertex color 7 since v1.1.0

Buffers with field definitions from per vertex group will write to output file as many entries as there are vertices.

Entries

An entry is one repetition of all fields specified in one buffer in .format file. In the followig:


; vertex.x vertex.y vertex.z

vertex.x vertex.y vertex.z make up one entry.

Example


; vertex.x vertex.y vertex.z

Suppose mesh has 100 vertices. The above will output 100×3=300 floating point values (4 bytes each) to the output file. File will have total size of 300×4=1200 bytes.

Clone this wiki locally