-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
documentation.lisp
1090 lines (773 loc) · 20.6 KB
/
documentation.lisp
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(in-package #:org.shirakumo.fraf.gltf)
;; accessor.lisp
(docs:define-docs
(function construct-element-reader
"Construct a reader function for the given element.
ELEMENT-TYPE can be (barring extensions) one of the following:
:SCALAR
:VEC2
:VEC3
:VEC4
:MAT2
:MAT3
:MAT4
COMPONENT-TYPE can be (barring extensions) one of the following:
:INT8
:UINT8
:INT16
:UINT16
:INT32
:UINT32
:INT64
:UINT64
:FLOAT
:DOUBLE
This function should return a function of one argument, a
CFFI:FOREIGN-POINTER, and two return values: the read value at the
pointer and a pointer to the memory region immediately following the
read element.
See ACCESSOR (type)")
(function construct-element-writer
"Construct a reader function for the given element.
ELEMENT-TYPE can be (barring extensions) one of the following:
:SCALAR
:VEC2
:VEC3
:VEC4
:MAT2
:MAT3
:MAT4
COMPONENT-TYPE can be (barring extensions) one of the following:
:INT8
:UINT8
:INT16
:UINT16
:INT32
:UINT32
:INT64
:UINT64
:FLOAT
:DOUBLE
This function should return a function of two arguments: the value to
write and a CFFI:FOREIGN-POINTER, and one return value: a pointer to
the memory region immediately following the read element.
See ACCESSOR (type)")
(type buffer
"Representation of an octet buffer.
This is a SEQUENCE and can be used as such.
Once the buffer is no longer required, it must be CLOSEd to free up
potential resources kept by the buffer in the back.
See START
See BYTE-LENGTH
See INDEXED-ELEMENT
See URI-ELEMENT
See NAMED-ELEMENT")
(function start
"Returns a pointer to the start of the memory region represented by the buffer, view, or accessor.
See BUFFER
See BUFFER-VIEW
See ACCESSOR")
(function byte-length
"Returns the length of the buffer in octets.
See BUFFER
See BUFFER-VIEW")
(type buffer-view
"Representation of a view into a buffer.
This is a SEQUENCE and can be used as such.
See BUFFER
See START
See BYTE-OFFSET
See BYTE-LENGTH
See BYTE-STRIDE
See TARGET
See INDEXED-ELEMENT
See NAMED-ELEMENT")
(function buffer
"Returns the buffer indexed into by the buffer-view.
See BUFFER
See BUFFER-VIEW")
(function byte-offset
"Returns the offset in octets from the start of the buffer.
See ACCESSOR
See BUFFER-VIEW")
(function byte-stride
"Returns the number of bytes between valid elements in the buffer.
Note that this may be NIL.
See ACCESSOR
See BUFFER-VIEW")
(function target
"Returns an OpenGL integer representing the target of the buffer data.
See BUFFER-VIEW")
(type accessor
"Representation of an attribute accessor into a buffer.
This is a SEQUENCE and can be used as such.
See BUFFER-VIEW
See BYTE-OFFSET
See COMPONENT-TYPE
See ELEMENT-TYPE
See SIZE
See NORMALIZED
See MAXIMUM
See MINIMUM
See START
See BYTE-STRIDE
See ELEMENT-READER
See ELEMENT-WRITER
See INDEXED-ELEMENT
See NAMED-ELEMENT")
(function buffer-view
"Returns the buffer-view this accessor indexes into.
See ACCESSOR")
(function component-type
"Returns the compound component type this accessor reads.
Barring extensions, this can be one of:
:SCALAR
:VEC2
:VEC3
:VEC4
:MAT2
:MAT3
:MAT4
See ACCESSOR")
(function element-type
"Returns the underlying type of values read by the accessor for each compound value.
Barring extensions, this can be one of:
:INT8
:UINT8
:INT16
:UINT16
:INT32
:UINT32
:INT64
:UINT64
:FLOAT
:DOUBLE
See ACCESSOR")
(function size
"Returns the number of elements this accessor may read.
See ACCESSOR")
(function normalized
"Returns whether the values in the buffer are normalized or not.
See ACCESSOR")
(function maximum
"Returns a representation of the maximal value of any values this accessor may read.
This is typically either a single scalar value or an array of values.
See ACCESSOR")
(function minimum
"Returns a representation of the minimal value of any values this accessor may read.
This is typically either a single scalar value or an array of values.
See ACCESSOR")
(function element-reader
"Accesses the function used to read out values from the underlying buffer memory.
Unless manually set, this function is computed by calling
CONSTRUCT-ELEMENT-READER using the accessor's component-type and
element-type.
See CONSTRUCT-ELEMENT-READER
See ACCESSOR")
(function element-writer
"Accesses the function used to write values to the underlying buffer memory.
Unless manually set, this function is computed by calling
CONSTRUCT-ELEMENT-WRITER using the accessor's component-type and
element-type.
See CONSTRUCT-ELEMENT-WRITER
See ACCESSOR"))
;; format.lisp
(docs:define-docs
(type gltf-element
"Base class for any part of a glTF representation
See EXTENSIONS
See EXTRAS
See GLTF")
(function extensions
"Accessor to opaque extension blobs.
See GLTF-ELEMENT")
(function extras
"Accessor to opaque extras blobs.
See GLTF-ELEMENT")
(function gltf
"Returns the base GLTF instance this element is associated with.
See GLTF-ELEMENT")
(type named-element
"An element with a potential name attached.
See GLTF-ELEMENT
See NAME")
(function name
"Accesses the name of the element. May be NIL or a STRING.
See NAMED-ELEMENT")
(type uri-element
"An element with a URI attached.
See GLTF-ELEMENT
See URI
See PATH")
(function uri
"Accesses the URI. May be NIL or a STRING.
See URI-ELEMENT")
(function path
"Returns the pathname of the URI-ELEMENT, if available.
See URI-ELEMENT")
(type indexed-element
"An element that has a base index within the gltf file's collection.
See GLTF-ELEMENT
See IDX")
(function idx
"Returns the index of the element within its collection.
See INDEXED-ELEMENT")
(type gltf
"Base of a GLTF file's representation.
A GLTF instance is a collection of subobjects, which may nest and
refer to each other.
Once you are done, you **must** call CLOSE on the instance to ensure
backing buffers and other associated resources are properly freed.
See PARSE
See WITH-GLTF
See GLTF-ELEMENT
See URI
See BUFFERS
See BUFFER-VIEWS
See ACCESSORS
See ASSET
See CAMERAS
See MESHES
See IMAGES
See SAMPLERS
See TEXTURES
See MATERIALS
See SKINS
See NODES
See ANIMATIONS
See SCENES")
(function buffers
"Accesses the array of buffer objects.
See GLTF
See BUFFER")
(function buffer-views
"Accesses the array of buffer-view objects.
See BUFFER-VIEW
See GLTF")
(function accessors
"Accesses the array of accessor objects.
See ACCESSOR
See GLTF")
(function asset
"Accesses the asset object.
See ASSET
See GLTF")
(function cameras
"Accesses the array of camera objects.
See CAMERA
See GLTF")
(function meshes
"Accesses the array of mesh objects.
See MESH
See GLTF")
(function images
"Accesses the array of image objects.
See IMAGE
See GLTF")
(function samplers
"Accesses the array of sampler objects.
See SAMPLER
See GLTF")
(function textures
"Accesses the array of texture objects.
See TEXTURE
See GLTF")
(function materials
"Accesses the array of material objects.
See MATERIAL
See GLTF")
(function skins
"Accesses the array of skin objects.
See SKIN
See GLTF")
(function nodes
"Accesses the array of node objects.
See NODE
See SCENE
See GLTF")
(function animations
"Accesses the array of animation objects.
See ANIMATION
See GLTF")
(function scenes
"Accesses the array of scene objects.
See SCENE
See GLTF")
(type asset
"Represents basic metadata about the GLTF file.
See GLTF-ELEMENT
See COPYRIGHT
See GENERATOR
See VERSION
See MIN-VERSION")
(function copyright
"Accesses a string noting the copyright information.
See ASSET")
(function generator
"Accesses a string noting the software used to generate the file.
See ASSET")
(function version
"Accesses a string noting the version of the glTF format.
See ASSET")
(function min-version
"Accesses a string specifying the minimum version required to parse the file successfully.
See ASSET")
(type scene
"Represents a the root node of a scene.
See INDEXED-ELEMENT
See NAMED-ELEMENT
See NODES")
(type node
"Represents a node in the scene graph.
A node may have transformation information associated with it, as well
as several child nodes or a mesh. A node may also not have any
children or meshes, such as in the case of bones or cameras.
See CAMERA
See PARENT
See CHILDREN
See SKIN
See MESH
See MATRIX
See ROTATION
See SCALE
See TRANSLATION
See WEIGHTS")
(function camera
"Accesses the camera attached to the node.
See CAMERA
See NODE")
(function parent
"Accesses the parent of the node.
See NODE")
(function children
"Accesses the array of child nodes.
See NODE")
(function skin
"Accesses the skin attached to the node.
See SKIN
See NODE")
(function mesh
"Accesses the mesh attached to the node.
See MESH
See NODE")
(function matrix
"Accesses the transformation matrix attached to the node.
The matrix should be a 16-element float array representing the 4x4
matrix.
See NODE")
(function rotation
"Accesses the rotation quaternion attached to the node.
Expressed as a 4-element float array.
See NODE")
(function scale
"Accesses the scaling of the node.
Expressed as a 3-element float array.
See NODE")
(function translation
"Accesses the translation of the node.
Expressed as a 3-element float array.
See NODE")
(function weights
"Accesses the weights of the morph target.
Expressed as a float array.
See MESH
See NODE")
(type camera
"Base type for cameras.
See INDEXED-ELEMENT
See NAMED-ELEMENT
See ORTHOGRAPHIC-CAMERA
See PERSPECTIVE-CAMERA")
(type orthographic-camera
"Representation of an orthographic projection camera.
See CAMERA
See XMAG
See YMAG
See ZFAR
See ZNEAR")
(function xmag
"Accesses the horizontal magnification of the view.
See ORTHOGRAPHIC-CAMERA")
(function ymag
"Accesses the vertical magnification of the view.
See ORTHOGRAPHIC-CAMERA")
(function zfar
"Accesses the distance to the far clipping plane.
See ORTHOGRAPHIC-CAMERA
See PERSPECTIVE-CAMERA")
(function znear
"Accesses the distance to the near clipping plane.
See ORTHOGRAPHIC-CAMERA
See PERSPECTIVE-CAMERA")
(type perspective-camera
"Representation of a perspective projection camera.
See CAMERA
See ASPECT-RATIO
See FOV
See ZFAR
See ZNEAR")
(function aspect-ratio
"Accesses the view aspect ratio of the camera.
See PERSPECTIVE-CAMERA")
(function fov
"Accesses the field of view value of the camera.
See PERSPECTIVE-CAMERA")
(type mesh
"Representation of a mesh.
See INDEXED-ELEMENT
See NAMED-ELEMENT
See PRIMITIVES
See WEIGHTS")
(function primitives
"Accesses the array of mesh primitives that make up the mesh.
See MESH-PRIMITIVE
See MESH")
(type mesh-primitive
"Representation of a mesh primitive -- a singular geometric object of a consistent material.
See GLTF-ELEMENT
See ATTRIBUTES
See INDICES
See MATERIAL
See MODE
See TARGETS")
(function attributes
"Accesses the hash table of mesh attributes.
The values are ACCESSORs
The keys are keywords, out of:
:POSITION
:NORMAL
:TANGENT
:TEXCOORD_0 ...
:COLOR_0 ...
:JOINTS_0 ...
:WEIGHTS_0 ...
See ACCESSOR
See MESH-PRIMITIVE")
(function indices
"Accesses the accessor of vertex indices.
See ACCESSOR
See MESH-PRIMITIVE")
(function material
"Accesses the material used for the mesh primitive.
See MATERIAL
See MESH-PRIMITIVE")
(function mode
"Accesses the \"mode\" of the vertices in the mesh.
Can be one of the following:
:POINTS
:LINES
:LINE-LOOP
:LINE-STRIP
:TRIANGLES
:TRIANGLE-STRIP
:TRIANGLE-FAN
See MESH-PRIMITIVE")
(function targets
"Accesses the array of morph targets.
See MESH-PRIMITIVE")
(type material
"Representation of a mesh material description.
See INDEXED-ELEMENT
See NAMED-ELEMENT
See PBR
See NORMAL-TEXTURE
See OCCLUSION-TEXTURE
See EMISSIVE-TEXTURE
See EMISSIVE-FACTOR
See ALPHA-MODE
See ALPHA-CUTOFF
See DOUBLE-SIDED-P")
(function pbr
"Accesses the PBR material descriptor.
See PBR
See MATERIAL")
(function normal-texture
"Accesses the normal-map texture.
See TEXTURE-INFO
See MATERIAL")
(function occlusion-texture
"Accesses the occlusion-map texture.
See TEXTURE-INFO
See MATERIAL")
(function emissive-texture
"Accesses the emission-map texture.
See TEXTURE-INFO
See MATERIAL")
(function emissive-factor
"Accesses the emission factor of the emission-map.
Should be an array of three floats.
See MATERIAL")
(function alpha-mode
"Accesses the alpha-blending mode of the material.
Can be one of the following:
:OPAQUE
:MASK
:BLEND
See MATERIAL")
(function alpha-cutoff
"Accesses the alpha cutoff value when the material is in mask mode.
See MATERIAL")
(function double-sided-p
"Accesses whether the material should be double-sided or not.
See MATERIAL")
(type animation
"Representation of an animation.
See INDEXED-ELEMENT
See NAMED-ELEMENT
See CHANNELS
See SAMPLERS")
(function channels
"Accesses the array of animation-channels.
See ANIMATION-CHANNEL
See ANIMATION")
(function samplers
"Accesses the array of animation-samplers
See ANIMATION-SAMPLER
See ANIMATION")
(type animation-channel
"Representation of an animation channel.
See GLTF-ELEMENT
See SAMPLER
See TARGET")
(function sampler
"Accesses for the index of the animation-sampler used for the animation-channel.
You should reference this into the SAMPLERS array of the ANIMATION.
See ANIMATION-CHANNEL")
(function target
"Accesses for the animation-channel-target.
See ANIMATION-CHANNEL-TARGET
See ANIMATION-CHANNEL")
(type animation-channel-target
"Representation of an animation channel target.
See GLTF-ELEMENT
See NODE
See PATH")
(function node
"Accesses for the node that the channel animates.
See NODE
See ANIMATION-CHANNEL-TARGET")
(function path
"Accesses for the property that the channel animates.
Can be one of the following:
:TRANSLATION
:ROTATION
:SCALE
:WEIGHTS
See ANIMATION-CHANNEL")
(type animation-sampler
"Representation of a sampler for an animation-channel.
See GLTF-ELEMENT
See INPUT
See OUTPUT
See INTERPOLATION")
(function input
"Accesses to the accessor that provides the times of the keyframes.
See ACCESSOR
See ANIMATION-SAMPLER")
(function output
"Accesses to the accessor that provides the values of the keyframes.
See ACCESSOR
See ANIMATION-SAMPLER")
(function interpolation
"Accesses to the interpolation type of the animation sampler.
Can be one of the following:
:STEP
:LINEAR
:CUBICSPLINE
See ANIMATION-SAMPLER")
(type image
"Representation of an image.
An image may either be represented by an URI to another file, an
inline data-uri, or a buffer-view that provides the image data.
See INDEXED-ELEMENT
See URI-ELEMENT
See NAMED-ELEMENT
See MIME-TYPE
See BUFFER-VIEW")
(function mime-type
"Accesses to the string mime-type of the image.
Should be either:
\"image/jpeg\"
\"image/png\"
See IMAGE")
(type sampler
"Representation of a texture sampler.
See INDEXED-ELEMENT
See NAMED-ELEMENT
See MAG-FILTER
See MIN-FILTER
See WRAP-S
See WRAP-T")
(function mag-filter
"Accesses to the magnification filter of the sampler.
Can be one of the following:
:NEAREST
:LINEAR
See SAMPLER")
(function min-filter
"Accesses to the minification filter of the sampler.
Can be one of the following:
:NEAREST
:LINEAR
:NEAREST-MIPMAP-NEAREST
:LINEAR-MIPMAP-NEAREST
:NEAREST-MIPMAP-LINEAR
:LINEAR-MIPMAP-LINEAR
See SAMPLER")
(function wrap-s
"Accesses to the U-wrapping mode of the sampler.
Can be one of the following:
:CLAMP-TO-EDGE
:MIRRORED-REPEAT
:REPEAT
See SAMPLER")
(function wrap-t
"Accesses to the V-wrapping mode of the sampler.
Can be one of the following:
:CLAMP-TO-EDGE
:MIRRORED-REPEAT
:REPEAT
See SAMPLER")
(type skin
"Representation of a mesh's skinning information.
See INDEXED-ELEMENT
See NAMED-ELEMENT
See INVERSE-BIND-MATRICES
See SKELETON
See JOINTS")
(function inverse-bind-matrices
"Accesses to the accessor that contains the inverse bind matrices of the skin.
See ACCESSOR
See SKIN")
(function skeleton
"Accesses the node that represents the root of the skeleton for the skin.
See NODE
See SKIN")
(function joints
"Accesses the array of nodes used as joints for the skin.
See NODE
See SKIN")
(type texture
"Representation of a texture.
See INDEXED-ELEMENT
See NAMED-ELEMENT
See SAMPLER
See SOURCE")
(function sampler
"Accesses the sampler used for the texture.
See SAMPLER
See TEXTURE")
(function source
"Accesses the source image of the texture.
See IMAGE
See TEXTURE")
(type texture-info
"Representation of additional texture information.
See GLTF-ELEMENT
See TEXTURE
See TEX-COORD
See SCALE
See STRENGTH")
(function texture
"Accesses the texture the texture-info supplements.
See TEXTURE
See TEXTURE-INFO")
(function tex-coord
"Accesses the index of the texture coordinates used for the texture indexing.
See TEXTURE-INFO")
(function scale
"Accesses the scalar applied to each normal of the normal-map texture.
See TEXTURE-INFO")
(function strength
"Accesses the scalar for the strength of the occulsion-map texture.
See TEXTURE-INFO")
(type pbr
"Representation of the PBR attributes used for a material.
See GLTF-ELEMENT
See ALBEDO
See ALBEDO-FACTOR
See METALLIC-FACTOR
See ROUGHNESS-FACTOR
See METALLIC-ROUGHNESS")
(function albedo
"Accesses the texture-info for the albedo channel of the material.
See TEXTURE-INFO
See PBR")
(function albedo-factor
"Accesses the albedo-factor for the material.
This should be an array of four float values representing the
per-channel strength factors.
See PBR")
(function metallic-factor
"Accesses the metalness-factor for the material.
See PBR")
(function roughness-factor
"Accesses the roughness-factor for the material.
See PBR")
(function metallic-roughness
"Accesses the metal-roughness-map for the material.