-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpseudocode.txt
65 lines (53 loc) · 2.82 KB
/
pseudocode.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Cross level merging
- Build multi map of potential matches for each node, up to a certain depth (1/2 of max by default)
- Add all nodes of level below the root to the list of nodes to check
- For every level
- Rebuild multi-map if necessary (if depth of subtrees is smaller than those in multi-map)
- For every node to check (that has not been eliminated yet)
- For each other level higher up:
- For each potential match
- If equal through deep comparison
- Store correspondences for all nodes in the duplicate subtrees
- If no match found
- Add to list of nodes to check next
- Update pointers of nodes in the level above
- Update pointers of nodes in lower levels to nodes in this level
## Symmetric cross level merging
- Same, for each symmetry option:
- Build match maps for each symmetry option
- Deep comparison for each symmetry option
- Also store symmetry option in correspondence
### -OR-
- Convert to SDAG
- Create multi-map of MirrorNode hashes
- The same as normal cross level merging
# Exploiting hidden geometry
1. Normal based
- Voxels on the surface of a closed object only need to look right from the outside
- The part of the nodes that lay inside of the surface can be changed as we please
2. Inside/outside based
- Any node on the inside of a closed surface can be changed as we please
Question:
- How to implement this
1:
- Store normal in each node in the SVO
- When merging nodes, mark nodes as unusable if their normals differ greater than a threshold
-
2:
- Inner nodes: Do subtree comparisons, but ignore the children that are hidden
- Leaf nodes: Do child bit mask comparison, but ignore bits that are hidden
-
## Current status
- Flood fill from a corner of the scene, marking all nodes on the outside with a bitmask in their parent
- How to ignore the inside children during subtree comparison?
- Single level merging: In the comparator of two nodes, take the AND of the outside masks, only compare those children
- No straightforward compatibility with cross-level merging, since the hashes are precomputed
- Could maybe pre-compute all hash combinations (2^8 match maps), which is O(256) time increase
- Problem: Can't sort nodes anymore (so can't put them in a map)
- Since the comparison between any two nodes is dynamic: ChildMask & OutsideMask
- Therefore, single-level merging doesn't work in the way it is currently implemented
# Lossy compression:
- Currently only in low levels, on nodes that are referenced infrequently
- Todo: Noisiness of voxels and "create no holes, only fill them?"
- Can also use noisiness indicator for fake detail using cycles
- Wouldn't be useful for flat surfaces, but for organic material/smoke/particles