Skip to content

Commit

Permalink
almost certainly obsolete, but some legacy notes
Browse files Browse the repository at this point in the history
  • Loading branch information
John Owens committed Oct 28, 2024
1 parent cec5328 commit 0abe11a
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions notes/obj-to-data-structures.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# How to go from a parsed .obj file to the starting data structures for subdivision

Here's the data structures we need to derive:

```
vertices_size # how many vertices in level-0 + level-1
# this is the entire vertex buffer
base_vertex_positions # given in .obj
base_faces # given in .obj
subdiv_1_faces # must be generated
triangle_indices # f(base_faces, base_face_valence)
# and subdiv_1_{faces, valence}
subdiv_1_triangles_count
base_face_valence # f(base_faces)
base_face_offset # exclusive-scan(+, base_faces)
base_edges # f(?)
base_vertex_valence # f(?)
base_vertex_offset # 2 * exclusive-scan(+, base_vertex_vlnc)
base_vertex_index # f(?)
base_vertices # f(?)
```

## Proposed data structure changes in subdivider code

`offset` and `valence` can probably be put into one data structure that covers all vertices (and is the size of the vertex buffer). `valence` could be done as a segmented scan if necessary.

Be better at explicitly exposing hierarchy (many data structures will be indexed internally by hierarchy level)

## Q: When to convert from 1-based indexing (in .obj) vs. 0-based indexing (in subdivision code)?

Probably after parsing (don't change the parser), then we can update the parser / get a different parser and use that unchanged.

0 comments on commit 0abe11a

Please sign in to comment.