mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-07 11:16:53 +08:00
Fixed premultiplied alpha.
This commit is contained in:
parent
3ed63ef028
commit
61906bcf1f
@ -71,14 +71,14 @@ public class SkeletonRenderer {
|
|||||||
|
|
||||||
} else if (attachment instanceof MeshAttachment) {
|
} else if (attachment instanceof MeshAttachment) {
|
||||||
MeshAttachment mesh = (MeshAttachment)attachment;
|
MeshAttachment mesh = (MeshAttachment)attachment;
|
||||||
mesh.updateWorldVertices(slot, true);
|
mesh.updateWorldVertices(slot, premultipliedAlpha);
|
||||||
vertices = mesh.getWorldVertices();
|
vertices = mesh.getWorldVertices();
|
||||||
triangles = mesh.getTriangles();
|
triangles = mesh.getTriangles();
|
||||||
texture = mesh.getRegion().getTexture();
|
texture = mesh.getRegion().getTexture();
|
||||||
|
|
||||||
} else if (attachment instanceof SkinnedMeshAttachment) {
|
} else if (attachment instanceof SkinnedMeshAttachment) {
|
||||||
SkinnedMeshAttachment mesh = (SkinnedMeshAttachment)attachment;
|
SkinnedMeshAttachment mesh = (SkinnedMeshAttachment)attachment;
|
||||||
mesh.updateWorldVertices(slot, true);
|
mesh.updateWorldVertices(slot, premultipliedAlpha);
|
||||||
vertices = mesh.getWorldVertices();
|
vertices = mesh.getWorldVertices();
|
||||||
triangles = mesh.getTriangles();
|
triangles = mesh.getTriangles();
|
||||||
texture = mesh.getRegion().getTexture();
|
texture = mesh.getRegion().getTexture();
|
||||||
@ -141,8 +141,10 @@ public class SkeletonRenderer {
|
|||||||
batch.setBlendFunction(srcFunc, GL20.GL_ONE_MINUS_SRC_ALPHA);
|
batch.setBlendFunction(srcFunc, GL20.GL_ONE_MINUS_SRC_ALPHA);
|
||||||
}
|
}
|
||||||
batch.draw(regionAttachment.getRegion().getTexture(), vertices, 0, 20);
|
batch.draw(regionAttachment.getRegion().getTexture(), vertices, 0, 20);
|
||||||
|
|
||||||
} else if (attachment instanceof MeshAttachment || attachment instanceof SkinnedMeshAttachment) {
|
} else if (attachment instanceof MeshAttachment || attachment instanceof SkinnedMeshAttachment) {
|
||||||
throw new RuntimeException("PolygonSpriteBatch is required to render meshes.");
|
throw new RuntimeException("PolygonSpriteBatch is required to render meshes.");
|
||||||
|
|
||||||
} else if (attachment instanceof SkeletonAttachment) {
|
} else if (attachment instanceof SkeletonAttachment) {
|
||||||
Skeleton attachmentSkeleton = ((SkeletonAttachment)attachment).getSkeleton();
|
Skeleton attachmentSkeleton = ((SkeletonAttachment)attachment).getSkeleton();
|
||||||
if (attachmentSkeleton == null) continue;
|
if (attachmentSkeleton == null) continue;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user