Capítulo 94 de 859

Chapter 94: SpriteNodeMaterial

Core Idea

Node material version of SpriteMaterial.

Key Concepts

  • isSpriteNodeMaterial : boolean (readonly): This flag can be used for type testing.
  • positionNode : Node.<vec2>: This property makes it possible to define the position of the sprite with a node. That can be useful when the material is used with instanc…
  • rotationNode : Node.<float>: The rotation of sprite materials is by default inferred from the rotation, property. This node property allows to overwrite the default a…
  • scaleNode : Node.<vec2>: This node property provides an additional way to scale sprites next to Object3D.scale. The scale transformation based in Object3D.scale
  • sizeAttenuation : boolean: Whether to use size attenuation or not.
  • transparent : boolean: In Sprites, the transparent property is enabled by default.

Reference Tables

Constructor

Signature
new SpriteNodeMaterial( parameters : Object )

Properties

PropertyDescription
.isSpriteNodeMaterial : boolean (readonly)This flag can be used for type testing.
.positionNode : Node.<vec2>This property makes it possible to define the position of the sprite with a node. That can be useful when the material is used with instanced rendering and node data are defined with an instanced att…
.rotationNode : Node.<float>The rotation of sprite materials is by default inferred from the rotation, property. This node property allows to overwrite the default and define the rotation with a node instead.
.scaleNode : Node.<vec2>This node property provides an additional way to scale sprites next to Object3D.scale. The scale transformation based in Object3D.scale is multiplied with the scale value of this node in the vert…
.sizeAttenuation : booleanWhether to use size attenuation or not.
.transparent : booleanIn Sprites, the transparent property is enabled by default.

Methods

MethodDescription
.setupPositionView( builder : NodeBuilder ) : Node.<vec3>Setups the position node in view space. This method implements the sprite specific vertex shader.

Key Takeaways

  1. SpriteNodeMaterial extends: EventDispatcher → Material → NodeMaterial
  2. Most relevant properties: isSpriteNodeMaterial, positionNode, rotationNode, scaleNode.
  3. Key methods: setupPositionView.

Connects To