diff --git a/animerenderer/src/main/java/com/primogemstudio/advancedfmk/live2d/Renderer.kt b/animerenderer/src/main/java/com/primogemstudio/advancedfmk/live2d/Renderer.kt index 29e3c2c8..ab2c3e77 100644 --- a/animerenderer/src/main/java/com/primogemstudio/advancedfmk/live2d/Renderer.kt +++ b/animerenderer/src/main/java/com/primogemstudio/advancedfmk/live2d/Renderer.kt @@ -17,12 +17,12 @@ class CustomTextureStateShard: RenderStateShard.EmptyTextureStateShard(Runnable }) val renderType = RenderType.create( "live2d_deferred", - DefaultVertexFormat.POSITION_TEX, + DefaultVertexFormat.POSITION_COLOR_TEX_LIGHTMAP, VertexFormat.Mode.QUADS, 0x200, false, false, - CompositeState.builder().setShaderState(RenderStateShard.POSITION_TEX_SHADER) + CompositeState.builder().setShaderState(RenderStateShard.POSITION_COLOR_TEX_LIGHTMAP_SHADER) .setTextureState(CustomTextureStateShard()) .setLayeringState(RenderStateShard.VIEW_OFFSET_Z_LAYERING) .setTransparencyState(RenderStateShard.TRANSLUCENT_TRANSPARENCY) diff --git a/src/main/java/com/primogemstudio/advancedfmk/mmd/entity/Live2DEntityRenderer.kt b/src/main/java/com/primogemstudio/advancedfmk/mmd/entity/Live2DEntityRenderer.kt index 4d38cd47..67171947 100644 --- a/src/main/java/com/primogemstudio/advancedfmk/mmd/entity/Live2DEntityRenderer.kt +++ b/src/main/java/com/primogemstudio/advancedfmk/mmd/entity/Live2DEntityRenderer.kt @@ -34,10 +34,22 @@ class Live2DEntityRenderer(context: EntityRendererProvider.Context) : EntityRend poseStack.pushPose() poseStack.mulPose(Axis.YN.rotationDegrees(entityYaw)) val matrix = poseStack.last().pose() - buff.addVertex(matrix, -1f, 0f, 0f).setUv(0f, 0f) - buff.addVertex(matrix, 0.920f, 0f, 0f).setUv(1f, 0f) - buff.addVertex(matrix, 0.920f, 1.080f, 0f).setUv(1f, 1f) - buff.addVertex(matrix, -1f, 1.080f, 0f).setUv(0f, 1f) + buff.addVertex(matrix, -1f, 0f, 0f) + .setColor(1f, 1f, 1f, 1f) + .setUv(0f, 0f) + .setLight(packedLight) + buff.addVertex(matrix, 0.920f, 0f, 0f) + .setColor(1f, 1f, 1f, 1f) + .setUv(1f, 0f) + .setLight(packedLight) + buff.addVertex(matrix, 0.920f, 1.080f, 0f) + .setColor(1f, 1f, 1f, 1f) + .setUv(1f, 1f) + .setLight(packedLight) + buff.addVertex(matrix, -1f, 1.080f, 0f) + .setColor(1f, 1f, 1f, 1f) + .setUv(0f, 1f) + .setLight(packedLight) poseStack.popPose() } }