Apply Texture VI

Owning Palette: Helpers VIs

Requires: Full Development System

Maps a texture to the surface of a 3D object. You must manually select the polymorphic instance to use.

Use the pull-down menu to select an instance of this VI.

 Add to the block diagram  Find on the palette

Apply Texture

Vertical Wrap Mode specifies how to vertically wrap the texture around a 3D object.

0Clamp (default)—The texture does not repeat across the surface of the object when you pass texture coordinates outside the range [0�1]. LabVIEW interprets any texture coordinates in Image outside this range with clamped values.
1Repeat—The texture repeats across the surface of the object when you pass texture coordinates outside the range [0�1]. LabVIEW only considers the fractional part of the texture coordinate. For example, LabVIEW interprets 0.4 and 3.4 as the same texture coordinate.
Horizontal Wrap Mode specifies how to horizontally wrap the texture around a 3D object.

0Clamp (default)—The texture does not repeat across the surface of the object when you pass texture coordinates outside the range [0�1]. LabVIEW interprets any texture coordinates in Image outside this range with clamped values.
1Repeat—The texture repeats across the surface of the object when you pass texture coordinates outside the range [0�1]. LabVIEW only considers the fractional part of the texture coordinate. For example, LabVIEW interprets 0.4 and 3.4 as the same texture coordinate.
Scene Object In specifies a reference to the scene you want to manipulate.
Image Data specifies the image you want to apply as a texture.
Apply Mode specifies how LabVIEW applies the texture to the 3D object.

0As a Decal (default)—Applies the texture as a decal, blending the colors of the texture and the geometry of the object according to the following formula:


Result Color=(1–Alpha in texel)*Color of geometry+Alpha in texel*Color in texel


The alpha of the vertex does not change and is the same as the alpha in the geometry.
1With Modulation—Applies the texture to the surface of the object and modulates the texture by the color of the surface according to the following formulas:


Result Color=Color(texel)*Color(geometry)


Result Alpha=Alpha(texel)*Alpha(geometry)
2With Blending—Blends the texture with the Blend Color of the texture according to the following formula:


Result Color=(–Color in texel)*Color in geometry+Color in texel*Blend Color


The resulting alpha value is Alpha(texel)*Alpha(geometry)
3As a Replacement—Replaces the color of the geometry with the color of the texture. LabVIEW also replaces the alpha value of the geometry with the alpha value of the texture.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
Filter Mode specifies the method to use to filter the texel colors applied to the geometry. Different values affect the quality and speed of the texture mapping.

0No Filtration (default)—LabVIEW uses the closest texel for the texture color.
1Linear Filtration—Filters the texture by taking the weighted linear average of the 2x2 array of texels that lies nearest to the center of the pixels of the texture map.
2Simple Mipmap Filtration—Stores mipmaps, or multiple copies of the texture, at increasingly smaller resolutions. LabVIEW chooses the mipmap with texels closest in size to the pixel it is texturing and then chooses the nearest texel as the texture color.
3Bilinear Filtration—Performs a linear filtration but uses the mipmap with texels closest in size to the pixel LabVIEW is texturing.
4Trilinear Filtration—LabVIEW chooses the two mipmaps that are closest in size to the pixel it is texturing and then performs a linear filtration on both textures. The resulting texture color is the weighted average of the two values.
Blend Color specifies the RGBA color to use to blend the texture you apply to the object. This input blends a color with a texture when Apply Mode is set to With Blending.
Red specifies the red value. The default is 0.
Green specifies the green value. The default is 0.
Blue specifies the blue value. The default is 0.
Alpha specifies the level of opacity. The default value is 0.
Scene Object Out returns a reference to the scene object.
error out contains error information. This output provides standard error out functionality.

Apply Texture with Reference

Note Note  Returns a reference to a texture in a scene.

Vertical Wrap Mode specifies how to vertically wrap the texture around a 3D object.

0Clamp (default)—The texture does not repeat across the surface of the object when you pass texture coordinates outside the range [0�1]. LabVIEW interprets any texture coordinates in Image outside this range with clamped values.
1Repeat—The texture repeats across the surface of the object when you pass texture coordinates outside the range [0�1]. LabVIEW only considers the fractional part of the texture coordinate. For example, LabVIEW interprets 0.4 and 3.4 as the same texture coordinate.
Horizontal Wrap Mode specifies how to horizontally wrap the texture around a 3D object.

0Clamp (default)—The texture does not repeat across the surface of the object when you pass texture coordinates outside the range [0�1]. LabVIEW interprets any texture coordinates in Image outside this range with clamped values.
1Repeat—The texture repeats across the surface of the object when you pass texture coordinates outside the range [0�1]. LabVIEW only considers the fractional part of the texture coordinate. For example, LabVIEW interprets 0.4 and 3.4 as the same texture coordinate.
Scene Object In specifies a reference to the scene you want to manipulate.
Image Data specifies the image you want to apply as a texture.
Apply Mode specifies how LabVIEW applies the texture to the 3D object.

0As a Decal (default)—Applies the texture as a decal, blending the colors of the texture and the geometry of the object according to the following formula:


Result Color=(1–Alpha in texel)*Color of geometry+Alpha in texel*Color in texel


The alpha of the vertex does not change and is the same as the alpha in the geometry.
1With Modulation—Applies the texture to the surface of the object and modulates the texture by the color of the surface according to the following formulas:


Result Color=Color(texel)*Color(geometry)


Result Alpha=Alpha(texel)*Alpha(geometry)
2With Blending—Blends the texture with the Blend Color of the texture according to the following formula:


Result Color=(–Color in texel)*Color in geometry+Color in texel*Blend Color


The resulting alpha value is Alpha(texel)*Alpha(geometry)
3As a Replacement—Replaces the color of the geometry with the color of the texture. LabVIEW also replaces the alpha value of the geometry with the alpha value of the texture.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
Filter Mode specifies the method to use to filter the texel colors applied to the geometry. Different values affect the quality and speed of the texture mapping.

0No Filtration (default)—LabVIEW uses the closest texel for the texture color.
1Linear Filtration—Filters the texture by taking the weighted linear average of the 2x2 array of texels that lies nearest to the center of the pixels of the texture map.
2Simple Mipmap Filtration—Stores mipmaps, or multiple copies of the texture, at increasingly smaller resolutions. LabVIEW chooses the mipmap with texels closest in size to the pixel it is texturing and then chooses the nearest texel as the texture color.
3Bilinear Filtration—Performs a linear filtration but uses the mipmap with texels closest in size to the pixel LabVIEW is texturing.
4Trilinear Filtration—LabVIEW chooses the two mipmaps that are closest in size to the pixel it is texturing and then performs a linear filtration on both textures. The resulting texture color is the weighted average of the two values.
Blend Color specifies the RGBA color to use to blend the texture you apply to the object. This input blends a color with a texture when Apply Mode is set to With Blending.
Red specifies the red value. The default is 0.
Green specifies the green value. The default is 0.
Blue specifies the blue value. The default is 0.
Alpha specifies the level of opacity. The default value is 0.
Scene Object Out returns a reference to the scene object.
Texture Refnum returns the reference to the texture.
error out contains error information. This output provides standard error out functionality.