Skip to content

Commit 2a7afd2

Browse files
committed
README update
1 parent afe5db3 commit 2a7afd2

File tree

1 file changed

+26
-16
lines changed

1 file changed

+26
-16
lines changed

README.md

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,12 @@ const { bvh, textures, materials, lights } = generator.generate( scene );
110110

111111
// update bvh and geometry attribute textures
112112
ptMaterial.bvh.updateFrom( bvh );
113-
ptMaterial.normalAttribute.updateFrom( geometry.attributes.normal );
114-
ptMaterial.tangentAttribute.updateFrom( geometry.attributes.tangent );
115-
ptMaterial.uvAttribute.updateFrom( geometry.attributes.uv );
113+
ptMaterial.attributesArray.updateFrom(
114+
geometry.attributes.normal,
115+
geometry.attributes.tangent,
116+
geometry.attributes.uv,
117+
geometry.attributes.color,
118+
);
116119

117120
// update materials and texture arrays
118121
ptMaterial.materialIndexAttribute.updateFrom( geometry.attributes.materialIndex );
@@ -557,9 +560,7 @@ _extends MaterialBase_
557560

558561
// Geometry and BVH information
559562
bvh: MeshBVHUniformStruct,
560-
normalAttribute: FloatVertexAttributeTexture,
561-
tangentAttribute: FloatVertexAttributeTexture,
562-
uvAttribute: FloatVertexAttributeTexture,
563+
attributesArray: AttributesTextureArray,
563564
materialIndexAttribute: UIntVertexAttributeTexture,
564565
materials: MaterialsTexture,
565566
textures: RenderTarget2DArray,
@@ -658,36 +659,45 @@ updateFrom( camera : PerspectiveCamera | PhysicalCamera ) : void
658659

659660
Copies all fields from the passed PhysicalCamera if available otherwise the defaults are used.
660661

661-
## GeometryAttributesTextureArray
662+
## AttributesTextureArray
662663

663-
### .setNormalAttribute
664+
A combined texture array used to store normal, tangent, uv, and color attributes in the same texture sampler array rather than separate samplers. Necessary to save texture slots.
665+
666+
Normals, tangents, uvs, and color attribute data are stored in the 1st, 2nd, 3rd, and 4th layers of the array respectively.
667+
668+
### .updateNormalAttribute
664669

665670
```js
666-
setNormalAttribute( attr : BufferAttribute ) : void
671+
updateNormalAttribute( attr : BufferAttribute ) : void
667672
```
668673

669-
### .setTangentAttribute
674+
### .updateTangentAttribute
670675

671676
```js
672-
setTangentAttribute( attr : BufferAttribute ) : void
677+
updateTangentAttribute( attr : BufferAttribute ) : void
673678
```
674679

675-
### .setUvAttribute
680+
### .updateUvAttribute
676681

677682
```js
678-
setUvAttribute( attr : BufferAttribute ) : void
683+
updateUvAttribute( attr : BufferAttribute ) : void
679684
```
680685

681-
### .setColorAttribute
686+
### .updateColorAttribute
682687

683688
```js
684-
setColorAttribute( attr : BufferAttribute ) : void
689+
updateColorAttribute( attr : BufferAttribute ) : void
685690
```
686691

687692
### .updateFrom
688693

689694
```js
690-
updateFrom( normal : BufferAttribute, tangent : BufferAttribute, uv : BufferAttribute, color : BufferAttribute ) : void
695+
updateFrom(
696+
normal : BufferAttribute,
697+
tangent : BufferAttribute,
698+
uv : BufferAttribute,
699+
color : BufferAttribute
700+
) : void
691701
```
692702

693703
## MaterialsTexture

0 commit comments

Comments
 (0)