Table Of Contents

Previous topic

17.11. The RenderTarget Object

Next topic

17.13. The Shader Object

This Page

17.12. The Semantics Object

A Semantics object is an optimal container for vertex attributes semantic information and it is required for setting streams or for inline geometry drawing.

This object behaves as a JavaScript array, after its creation you can iterate over its elements and modify them directly as with any other array:

// create Semantics object
var semantics = graphicsDevice.createSemantics([graphicsDevice.SEMANTIC_POSITION,
                                    graphicsDevice.SEMANTIC_NORMAL]);

// print the raw semantic values
var numSemantics = semantics.length;
for (var n = 0; n < numSemantics; n += 1)
{
    console.log(semantics[n]);
}

// Append a new one
semantics[semantics.length] = graphicsDevice.SEMANTIC_TEXCOORD;

You can find a list of supported semantics here graphicsDevice.SEMANTIC_.

17.12.1. Properties

17.12.1.1. length

Summary

Number of semantics stored on the Semantics object.

Syntax

var numSemantics = semantics.length;