我想知道如何更新mesh UVs。
当它存在时,超视距似乎应用得很好。但是如果这是动态修改的话,UVs就不会反映它。这是PIXI JS的窃听器吗?还是我的错?
...
uvs: Float32Array = new Float32Array([ 0, 0, 1, 0, 1, 1, 0, 1 ]);
mesh: PIXI.mesh.Mesh = new PIXI.mesh.Mesh(texture, vertices, uvs, indices);在运行时
this.mesh.uvs[2] += this.offset;
this.mesh.uvs[4] += this.offset;不是工作。
发布于 2018-11-22 08:47:25
PixiJS提供给您的数据在CPU上,但是GPU呈现的网格使用GPU中的数据。
您只更新了CPU数据,为了使它对GPU可用,您必须增加YourMesh.dirty,以便PixiJS知道数据已经更改,并且他需要更新GPU数据。
你应该有这样的东西:
this.mesh.uvs[2] += this.offset;
this.mesh.uvs[4] += this.offset;
this.mesh.dirty ++;https://stackoverflow.com/questions/53424680
复制相似问题