Skip to content

Commit

Permalink
fix: image&video material shader and skeleton animation event (Orillu…
Browse files Browse the repository at this point in the history
…sion#100)

Fixed VideoMaterial shader abnormal registration
Fixed ImageMaterial shader abnormal registration
Fixed bug with skeleton animation event dispatch
  • Loading branch information
Codeboy-cn authored May 6, 2023
1 parent 2055c45 commit 3a10b25
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/media-extention/ImageMaterial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export class ImageMaterial extends MaterialBase {
*/
constructor() {
super();
ShaderLib.register("ImageShVideoShaderader", ImageMaterialShader);
let shader = this.setShader(`ImageShader`, `ImageShader`);
ShaderLib.register("ImageMaterialShader", ImageMaterialShader);
let shader = this.setShader(`ImageMaterialShader`, `ImageMaterialShader`);
shader.setShaderEntry(`VertMain`, `FragMain`)
shader.setUniformVector4(`transformUV1`, new Vector4(0, 0, 1, 1));
shader.setUniformVector4(`transformUV2`, new Vector4(0, 0, 1, 1));
Expand Down
2 changes: 1 addition & 1 deletion packages/media-extention/VideoMaterial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class VideoMaterial extends MaterialBase {
*/
constructor() {
super();
ShaderLib['VideoShader'] = VideoShader;
ShaderLib.register('VideoShader', VideoShader);
let shader = this.setShader(`VideoShader`, `VideoShader`);
shader.setShaderEntry(`VertMain`, `FragMain`)
shader.setUniformVector4(`transformUV1`, new Vector4(0, 0, 1, 1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class SkeletonAnimationClipState {
triggerFrame = Math.max(triggerFrame, 0);
if (triggerFrame == this.currFrame) {
event.skeletonAnimation = this.animation;
this.animation.events.dispatchEvent(event);
this.animation.eventDispatcher.dispatchEvent(event);
break;
}
}
Expand Down

0 comments on commit 3a10b25

Please sign in to comment.