Skip to content

Commit fcaac34

Browse files
authored
Merge pull request #1626 from drsnuggles8/feature/groom-wet-coats-scene-lighting-1615-1618
feat(groom): wet coats and scene lighting for coats (#1615, #1618)
2 parents 48bf205 + 5b525d4 commit fcaac34

111 files changed

Lines changed: 6494 additions & 483 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitattributes‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ OloEditor/SandboxProject/Assets/Grooms/Bernese/Bernese.ologroombinding filter=lf
4444
tools/dog-authoring/sources/Samoyed/Samoyed.bin filter=lfs diff=lfs merge=lfs -text
4545
tools/dog-authoring/sources/SamoyedLidSource/Samoyed.bin filter=lfs diff=lfs merge=lfs -text
4646
tools/dog-authoring/sources/Bernese/Bernese.bin filter=lfs diff=lfs merge=lfs -text
47+
# The golden's coat source (build_dog_groom.py's archive, which its cooked coat records).
48+
OloEditor/SandboxProject/Assets/Models/Dog/Dog.abc filter=lfs diff=lfs merge=lfs -text
4749

4850
# Mark vendor as vendored (hides from GitHub linguist and other tooling)
4951
vendor/** linguist-vendored
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:270c3496fe051acab66abe4b4bfe3fbf31cf764ec848ec0c76ec95e9826afa7e
3-
size 98542247
2+
oid sha256:019ab73f2a07844fb1d0fe36f333285040fbb11c0ff967feee3e010abf5157b3
3+
size 100476730
243 KB
Binary file not shown.
1 Byte
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:c0d9fc7945036d8104a309b3710de591b38695c92f0d6316d4aef93afe9cecbe
3-
size 116251543
2+
oid sha256:620197de3a2580a6a326cfb7a1bbd1221ce23f3026adbab651f3c3c07de7c8ac
3+
size 118364531
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:74fbcc6bde87001d168ac8fd79a8481734c237d985db9ba3985a1339cd85fe93
3-
size 162850982
2+
oid sha256:24db73294ad4b1bfc953bd5d0a79316ea78b6ee58ac051064777ce1d42ead432
3+
size 162851014
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:b92c9b8fc3eff71ba115b5aaa6f216b5bf1fa67bcecab7d76c8646be3e7cbfa2
3+
size 57000219

‎OloEditor/SandboxProject/Assets/Models/Dog/Dog.rig.json‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
{
22
"units": "metres, glTF Y-up, the head faces +Z",
3+
"assembly": {
4+
"pelt": [
5+
0.58,
6+
0.48,
7+
0.38
8+
],
9+
"lid": [
10+
0.2,
11+
0.14,
12+
0.1
13+
],
14+
"fibre": [
15+
1.0,
16+
0.93,
17+
0.8
18+
],
19+
"pigment": "baseColor"
20+
},
21+
"coatSource": "Assets/Models/Dog/Dog.abc",
22+
"walkSpeed": 0.312,
323
"eyeRadius": 0.0235,
424
"lidInnerRadius": 0.0245,
525
"socketRadius": 0.02625,

‎OloEditor/SandboxProject/Assets/Models/Dog/README.md‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@ writes it as Alembic hair curves, which the engine cooks into `Grooms/Dog/Dog.ol
1414
| file | what it is |
1515
|---|---|
1616
| `build_dog.py` | the Blender 5.x script that writes everything below, from nothing, and runs the next one |
17-
| `build_dog_groom.py` | the coat: grown on `Dog.gltf`, written to `.dog-groom/Dog.abc` at the repository root |
17+
| `build_dog_groom.py` | the coat: grown on `Dog.gltf`, written to `Dog.abc` |
18+
| `Dog.abc` | the coat's source (Git LFS): one hair object per coat group, which the engine cooks into `Grooms/Dog/Dog.ologroom` |
1819
| `Dog.gltf` + `Dog.bin` | one skinned mesh (~256k triangles) on a 50-bone rig, eight materials, six clips |
1920
| `DogCoatColor.png` | 2048² coat colours: DogSkin's albedo and the groom's colour map |
2021
| `DogNoseNormal.png`, `DogNoseOcclusion.png` | 2048² each, the nose leather's own UV square: its cobblestones, and the occlusion that keeps its nostrils dark |
2122
| `DogTongueColor.png`, `DogTongueNormal.png`, `DogTongueOcclusion.png` | 1024² each, the tongue's own UV square: its colour (redder root and edges, paler tip, the median groove, the papillae's pale tips, a veined underside), its filiform papillae, and its occlusion |
2223
| `DogGumColor.png`, `DogGumOcclusion.png` | 1024² each: pink gums with black pigment patches, and the oral cavity's occlusion |
2324
| `DogLipOcclusion.png`, `DogTeethOcclusion.png` | 1024² each: the lips' and teeth's occlusion, all of the mouth's baked in the Pant pose |
2425
| `DogIrisColor.png` | 2048², the eyeball's albedo on a planar UV across the gaze: the painted iris (fetched at the refracted iris point), its crisp pupil, and the sclera round it |
25-
| `Dog.rig.json` | eye radius, eye centres and gaze, lid and socket radii, the clip list |
26+
| `Dog.rig.json` | eye radius, eye centres and gaze, lid and socket radii, the clip list, the dressing (`assembly`: pelt, lid and fibre colours and the pigment mode), the coat source and the walk speed |
2627
| `DogEyeball.gltf` + `.bin` | the unit sphere each eye entity draws (128 x 64: the engine's primitive sphere reloads at 16 segments) |
2728

2829
Units are metres, Y-up, and the head faces +Z, the convention `Horse.gltf` and `Fox.gltf` use. The
@@ -106,9 +107,18 @@ undercoat, guard hair, long hair and strays per region, Voronoi locks, darkened
106107
sun-bleached tips. A last pass, `keep_off_other_parts`, cuts any strand short of the other side
107108
of an ear's edge: the face and cheek fur under a flap otherwise grew straight through it (52% of
108109
the face's guard hair) and showed as a slit of hair at the flap's front edge. Fur dipping into the
109-
skin it grows on is left alone. It writes one hair object per coat group into `.dog-groom/Dog.abc`: ~410k
110-
strands, 57 MB. The archive is a build output, git-ignored, and it stays out of `SandboxProject/Assets`,
111-
because the editor registers everything it finds there.
110+
skin it grows on is left alone. It writes one hair object per coat group into `Dog.abc`, beside
111+
the model: ~410k strands, 57 MB, the coat's source, committed through Git LFS as the other breeds'
112+
are. `Dog.rig.json` names it (`coatSource`), the shipped coat records it as its provenance, and the
113+
Content Browser's "Import as Groom" cooks it into the same bytes
114+
(`TheShippedCoatIsWhatTheEditorImportWrites`). The archive also carries the card tier
115+
(`groom_card_cell_size`, `groom_card_points`: `CARDS`), so every cook of it builds the same cards.
116+
Root UVs are written in the engine's convention, Blender's v up (#1560).
117+
118+
Blender's Alembic exporter writes the hair objects in a different order on every run, and the
119+
importer numbers the groups in archive order, so a regenerated archive is the same coat in another
120+
curve order: every curve-indexed jitter and stride-based LOD subset moves. Cook the shipped coat from
121+
the committed archive, and regenerate the archive only to change the coat.
112122

113123
Blender's Alembic exporter writes a hair object's points and widths and its custom properties, and
114124
nothing else a groom needs. So each group's coat description (`groom_role`, `groom_tint`,

‎OloEditor/SandboxProject/Assets/Models/Dog/build_dog.py‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
Sit, Walk and Pant (30 fps, in place)
1212
DogCoatColor.png the coat colours, both DogSkin's albedo and the groom's colour map
1313
Dog.rig.json the eye radius, centres and gaze (the engine draws each eye as its own
14-
sphere entity attached to eye_L / eye_R), the clip list
14+
sphere entity attached to eye_L / eye_R), the clip list, the dressing
15+
(ASSEMBLY), the coat's source (COAT_SOURCE) and the walk's speed
1516
DogEyeball.gltf the unit sphere each eye entity draws, at close-up tessellation
1617
1718
Nothing is hand-edited after generation (issue #1533, criterion A6). The surface is a signed
@@ -3365,6 +3366,16 @@ def to_gltf(v):
33653366
return [float(v[0]), float(v[2]), float(-v[1])]
33663367

33673368

3369+
# How the golden is dressed (the engine's DogShowcaseEvidenceTest and the exported Dog.olo read it
3370+
# from Dog.rig.json's "assembly", as they do the other breeds'), linear RGB: DogSkin's and DogLid's
3371+
# base colours, which multiply the coat map, and the strands' base colour under it. "baseColor"
3372+
# pigment tints the light the fibre returns, as #1533 graded the golden.
3373+
ASSEMBLY = {"pelt": [0.58, 0.48, 0.38], "lid": [0.20, 0.14, 0.10], "fibre": [1.0, 0.93, 0.80], "pigment": "baseColor"}
3374+
# Where the coat's Alembic source is (build_dog_groom.py's default_abc_path), as the cooked coat
3375+
# records it: project-relative, beside the model, where the Content Browser imports it.
3376+
COAT_SOURCE = "Assets/Models/Dog/Dog.abc"
3377+
3378+
33683379
def write_rig_json(path):
33693380
import json
33703381

@@ -3374,6 +3385,9 @@ def write_rig_json(path):
33743385
eyes[side] = {"bone": f"eye_{side}", "centre": to_gltf(c), "gaze": to_gltf(f), "up": to_gltf(up)}
33753386
data = {
33763387
"units": "metres, glTF Y-up, the head faces +Z",
3388+
"assembly": ASSEMBLY,
3389+
"coatSource": COAT_SOURCE,
3390+
"walkSpeed": float(WALK_SPEED),
33773391
"eyeRadius": float(EYE_R),
33783392
"lidInnerRadius": float(EYE_R + LID_GAP),
33793393
"socketRadius": float(EYE_R + SOCKET_CLEAR),
@@ -3647,8 +3661,8 @@ def main():
36473661
"""blender -b --factory-startup --python build_dog.py -- [out_dir] [preview_dir]
36483662
36493663
Writes Dog.gltf + Dog.bin + DogCoatColor.png + DogNoseNormal.png + DogNoseOcclusion.png +
3650-
Dog.rig.json into out_dir, then the coat (build_dog_groom.py) into .dog-groom/Dog.abc (default: this
3651-
script's directory) and, when preview_dir is given, Workbench renders of the rest pose,
3664+
Dog.rig.json into out_dir, then the coat (build_dog_groom.py) into Dog.abc beside this script
3665+
(Assets/Models/Dog/, the rig's coatSource) and, when preview_dir is given, Workbench renders of the rest pose,
36523666
every clip, a blink and the pant."""
36533667
import bpy
36543668

0 commit comments

Comments
 (0)