KudanAR - iOS  1.6.0
ARTextureMaterial Class Reference

#import <ARTextureMaterial.h>

Inherits ARMaterial.

Instance Methods

(instancetype) - initWithTexture:
 
- Instance Methods inherited from ARMaterial
(void) - postRender
 
(BOOL) - prepareRendererWithNode: [implementation]
 

Class Methods

(instancetype) + materialwithTexture:
 

Properties

ARTexturetexture
 
ARTextureblendTexture
 
float alpha
 
float blendParameter
 
- Properties inherited from ARMaterial
NSString * name
 
BOOL isTranslucent
 
ARBlendMode blendMode
 
BOOL depthTest
 
BOOL depthWrite
 
BOOL colourWrite
 
ARFaceCullMode cullMode
 
ARShaderProgramshaderProgram [implementation]
 

Detailed Description

An ARTextureMaterial is a material for shading a texture. This is commonly used with 3D models that do not require dynamic lighting. This type of material is functionally the same as setting the colour property of an ARLightMaterial with a texture.

Method Documentation

◆ initWithTexture:

- (instancetype) initWithTexture: (ARTexture *)  texture

Initialise with an existing ARTexture.

Example of use:

ARTexture *texture = [[ARTexture alloc] initWithUIImage:[UIImage imageNamed:@"exampleTexture.jpg"]];
ARTextureMaterial *textureMaterial = [[ARTextureMaterial alloc] initWithTexture:texture];
Parameters
textureThe texture to initialise with.
Returns
The material, initialised with the texture.

◆ materialwithTexture:

+ (instancetype) materialwithTexture: (ARTexture *)  texture

Class method to create an instance of an ARTextureMaterial using an ARTexture.

Example of use:

ARTexture *texture = [[ARTexture alloc] initWithUIImage:[UIImage imageNamed:@"exampleTexture.jpg"]];
ARTextureMaterial *textureMaterial = [ARTextureMaterial materialWithTexture:texture];
Parameters
textureThe texture to initialise with.
Returns
The initialised material.

Property Documentation

◆ alpha

- (float) alpha
readwritenonatomicassign

The alpha factor. Combine with the texture sample to alter transparency. Range is 0..1, where 0 is fully transparent and 1 is fully opaque. Default value is 1.

◆ blendParameter

- (float) blendParameter
readwritenonatomicassign

The blend parameter. Mixes blendTexture with texture based on value. Range is 0..1, where 0 is only the main texture and 1 is only the blend texture. Default value is 0.

◆ blendTexture

- (ARTexture*) blendTexture
readwritenonatomicassign

The blend texture is a secondary texture with an inverted alpha value. It blends with the colour texture based on the blend parameter. The level of transparency for both the main and blend textures depends on the blend parameter. If the blend parameter is 0, the renderer will draw only the main texture. If the blend parameter is 1, the renderer will draw only the blend texture. Anything in between displays both textures at varying degrees of transparency.

◆ texture

- (ARTexture*) texture
readwritenonatomicassign

The main texture displayed on the material.


The documentation for this class was generated from the following files:
ARTextureMaterial::texture
ARTexture * texture
Definition: ARTextureMaterial.h:16
ARTexture
Definition: ARTexture.h:12
ARTextureMaterial
Definition: ARTextureMaterial.h:12