buffers
Tag: buffers
Parent tag: scene
Attributes:
name
(string) – scene object’s nameprimitive
(enum) – the rendering primitive. Possible values are {TRIANGLES
,TRIANGLE_STRIP
,TRIANGLE_FAN
,LINES
,LINE_LOOP
,POINTS
,TRIANGLES_ADJACENCY
}material
(string): the name of a material.
Child tags:
index
position
normal
color
texCoord0
..texCoord3
tangent
bitangent
custom0
..custom5
All the child tags are of type string and specify the name of a buffer and the material library where it is defined, see the example below. Note that the material library must have been previously added to the project (see materialLibs)
Nau will build a scene with a VAO using the specified buffers.
Example:
<buffers name="myRays" primitive="TRIANGLES" material="showRays"> <position name="pos" fromLibrary="Ambient Occlusion" /> <index name="index" fromLibrary="Ambient Occlusion" /> <texCoord0 name="texCoord" fromLibrary="Ambient Occlusion" /> </buffers>
In the example above, the vertex attribute position
will use data from a buffer named “pos” defined in the library “Ambient Occlusion”.