Skip to content

Gfx3Material

jay19240 edited this page Jul 18, 2025 · 6 revisions

Gfx3Material

The surface material. It emit 'E_FINISHED' (on texture animation end)

Constructors

  • new Gfx3Material(options: MATOptions): Gfx3Material
    • options: The options to configure the material.

Methods

  • delete(): void
  • enableDecal(enabled: boolean): void
    • enabled: Indicating whether decals should be enabled or disabled.
  • enableShadow(enabled: boolean): void
    • enabled: Indicating whether the shadow should be enabled or disabled.
  • getCustomParam(name: string): number
    • name: The param name.
  • getCustomTexture0(): Gfx3Texture
  • getCustomTexture1(): Gfx3Texture
  • getDiffuseMap(): Gfx3Texture
  • getDisplacementMap(): Gfx3Texture
  • getDissolveTexture(): Gfx3Texture
  • getEmissiveMap(): Gfx3Texture
  • getEnvMap(): Gfx3Texture
  • getGroup02(): Gfx3StaticGroup
  • getGroup03(): Gfx3StaticGroup
  • getNormalMap(): Gfx3Texture
  • getSecondaryTexture(): Gfx3Texture
  • getSpecularMap(): Gfx3Texture
  • getTexture(): Gfx3Texture
  • getToonMap(): Gfx3Texture
  • playAnimation(textureTarget: TextureTarget, looped: boolean, preventSameAnimation: boolean): void
    • textureTarget: The name of the animated texture.
    • looped: Determines whether the animation should loop or not.
    • preventSameAnimation: Determines whether the same animation should be prevented from playing again.
  • setAmbient(r: number, g: number, b: number): void
    • r: The red component.
    • g: The green component.
    • b: The blue component.
  • setBlend(r: number, g: number, b: number, a: number): void
    • r: The red component.
    • g: The green component.
    • b: The blue component.
    • a: The alpha component.
  • setCustomParam(name: string, value: number): void
    • name: The param name.
    • value: The param value.
  • setCustomTextures(textures): void
    • textures: The textures list.
  • setDiffuse(r: number, g: number, b: number): void
    • r: The red component.
    • g: The green component.
    • b: The blue component.
  • setDiffuseMap(diffuseMap: Gfx3Texture): void
    • diffuseMap: The diffuse texture map.
  • setDisplacementMap(displacementMap: Gfx3Texture, angle: number, rate: number, factor: number): void
    • displacementMap: The displacement map texture.
    • angle: The angle at which the texture will be scrolled (in radians).
    • rate: The scrolling rate of the texture.
    • factor: The strength or intensity of the displacement effect.
  • setDisplacementMapScale(x: number, y: number): void
    • x: The horizontal scale.
    • y: The vertical scale.
  • setDisplacementMapScroll(angle: number, rate: number): void
    • angle: The angle at which the texture will be scrolled (in radians).
    • rate: The scrolling rate of the texture.
  • setDissolveAmount(amount: number): void
    • amount: The dissolve amount.
  • setDissolveGlow(r: number, g: number, b: number): void
    • r: The red component.
    • g: The green component.
    • b: The blue component.
  • setDissolveGlowFallOff(falloff: number): void
    • falloff: The dissolve glow falloff.
  • setDissolveGlowRange(glowRange: number): void
    • glowRange: The dissolve glow range.
  • setDissolveTexture(dissolveTexture: Gfx3Texture, glowRange: number, glowFalloff: number, amount: number): void
    • dissolveTexture: The dissolve texture.
    • glowRange
    • glowFalloff
    • amount
  • setDissolveTextureScale(x: number, y: number): void
    • x: The horizontal scale.
    • y: The vertical scale.
  • setDissolveTextureScroll(angle: number, rate: number): void
    • angle: The angle at which the texture will be scrolled (in radians).
    • rate: The scrolling rate of the texture.
  • setDistanceAlphaBlend(distanceAlphaBlend: number): void
    • distanceAlphaBlend: Distance alpha blend factor.
  • setEmissive(r: number, g: number, b: number, a: number): void
    • r: The red component.
    • g: The green component.
    • b: The blue component.
    • a: The emissive factor.
  • setEmissiveFactor(emissiveFactor: number): void
    • emissiveFactor: The factor of emission color (0-1)
  • setEmissiveMap(emissiveMap: Gfx3Texture): void
    • emissiveMap: The emissive texture map.
  • setEnvMap(envMap: Gfx3Texture): void
    • envMap: The env texture map.
  • setFacingAlphaBlend(facingAlphaBlend: number): void
    • facingAlphaBlend: Facing alpha blend factor.
  • setFlipbooks(flipbooks: MATFlipbook[]): void
    • flipbooks: The flipbook list.
  • setJamFrames(frames: number[]): void
    • frames: The flatten frames data.
  • setJamInfos(frameIndexA: number, frameIndexB: number, isAnimated: boolean, interpolated: boolean, frameTimeStamp: number, frameDuration: number, numVertices: number): void
    • frameIndexA: The current frame index.
    • frameIndexB: The next frame index.
    • isAnimated: The animated flag.
    • interpolated: A flag to enable/disable interpolation between frames.
    • frameTimeStamp: Timestamp of the last frame change.
    • frameDuration: The frame duration.
    • numVertices: The number of vertices in a frame.
  • setLightning(lightning: boolean): void
    • lightning: Indicates if light is applied or not to the material.
  • setNormalIntensity(normalIntensity: number): void
    • normalIntensity: The normal intensity.
  • setNormalMap(normalMap: Gfx3Texture): void
    • normalMap: The normal texture map.
  • setSecondaryTexture(texture: Gfx3Texture, angle: number, rate: number, blendMode): void
    • texture: The texture.
    • angle: The angle at which the texture will be scrolled (in radians).
    • rate: The scrolling rate of the texture.
    • blendMode: The blend mode.
  • setSecondaryTextureScale(x: number, y: number): void
    • x: The horizontal scale.
    • y: The vertical scale.
  • setSecondaryTextureScroll(angle: number, rate: number): void
    • angle: The angle at which the texture will be scrolled (in radians).
    • rate: The scrolling rate of the texture.
  • setShininess(shininess: number): void
    • shininess: The shininess/specularity value (0-1)
  • setSpecular(r: number, g: number, b: number): void
    • r: The red component.
    • g: The green component.
    • b: The blue component.
  • setSpecularMap(specularMap: Gfx3Texture): void
    • specularMap: The specular texture map.
  • setSpecularity(specularity: number): void
    • specularity: The level of specularity or shininess.
  • setTexture(texture: Gfx3Texture, angle: number, rate: number): void
    • texture: The texture.
    • angle: The angle at which the texture will be scrolled (in radians).
    • rate: The scrolling rate of the texture.
  • setTextureScale(x: number, y: number): void
    • x: The horizontal scale.
    • y: The vertical scale.
  • setTextureScroll(angle: number, rate: number): void
    • angle: The angle at which the texture will be scrolled (in radians).
    • rate: The scrolling rate of the texture.
  • setToonBlending(toonBlending: number): void
    • toonBlending: Enable or disable the blending between texture and toon texture.
  • setToonLightDirection(direction: vec3): void
    • direction: The toon light direction.
  • setToonMap(toonMap: Gfx3Texture): void
    • toonMap: The toon texture map.
  • stopAnimation(textureTarget: TextureTarget): void
    • textureTarget: The name of the animated texture.
  • update(ts: number): void
    • ts
  • static createFromFile(path: string, textureDir: string): Promise
    • path: The file path.
    • textureDir: The textures directory.
Clone this wiki locally