包含三个子项目: - avatar-h5-renderer: Live2D Cubism 4 H5 渲染器 (Vite + TS) - avatar_flutter_app: Flutter 容器 App (打包 H5 进 WebView) - gif-export: puppeteer 导出 32 个动作的透明 GIF (供 ESP32 圆屏播放) 模型资源: Haru, Natori (含贴图、moc3、motions, expressions) 设计文档: AI驱动虚拟形象渲染方案_v5.1.md Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
26 lines
736 B
GLSL
26 lines
736 B
GLSL
/**
|
|
* Copyright(c) Live2D Inc. All rights reserved.
|
|
*
|
|
* Use of this source code is governed by the Live2D Open Software license
|
|
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
|
|
*/
|
|
|
|
|
|
precision mediump float;
|
|
varying vec2 v_texCoord; //v2f.texcoord
|
|
varying vec4 v_myPos;
|
|
uniform vec4 u_baseColor; //v2f.color
|
|
uniform vec4 u_channelFlag;
|
|
uniform sampler2D s_texture0; //_MainTex
|
|
|
|
|
|
void main()
|
|
{
|
|
float isInside =
|
|
step(u_baseColor.x, v_myPos.x/v_myPos.w)
|
|
* step(u_baseColor.y, v_myPos.y/v_myPos.w)
|
|
* step(v_myPos.x/v_myPos.w, u_baseColor.z)
|
|
* step(v_myPos.y/v_myPos.w, u_baseColor.w);
|
|
gl_FragColor = u_channelFlag * texture2D(s_texture0, v_texCoord).a * isInside;
|
|
}
|