nanogl-gltf
Version:
37 lines (36 loc) • 1.51 kB
TypeScript
/**
* An interface to handle GLTF semantics, it means the name of GLSL attributes
*/
export interface ISemantics {
/**
* Method to get the GLSL attribute name for a morphed attribute with a given semantic and index.
* @param semantic Attribute semantic
* @param index Index of the morph target
*/
getMorphedAttributeName(semantic: string, index: number): string;
/**
* Method to get the GLSL attribute name for an attribute with a given semantic.
* @param semantic Attribute semantic
*/
getAttributeName(semantic: string): string;
}
/**
* The default implementation of ISemantics.
*
* It uses the following convention: POSITION = aPosition, NORMAL = aNormal, TANGENT = aTangent, TEXCOORD = aTexCoord, COLOR = aColor, JOINTS = aSkinJoints, WEIGHTS = aSkinWeights
*/
export declare class DefaultSemantics implements ISemantics {
/**
* Get the GLSL attribute name for a morphed attribute with a given semantic and index.
* Typically the same as getAttributeName but with a suffix _mt{index}
* @param semantic Attribute semantic
* @param index Index of the morph target
*/
getMorphedAttributeName(semantic: string, index: number): string;
/**
* Get the GLSL attribute name for an attribute with a given semantic.
* If the semantic is indexed, it will be suffixed with the set index (e.g. TEXCOORD_0 -> aTexCoord0)
* @param semantic Attribute semantic
*/
getAttributeName(semantic: string): string;
}