doc
This commit is contained in:
1 parent
bab7865389
commit
0e6e0fab08
3 files changed
+16
-43
No files matched your search
@@ -9,6 +9,8 @@ Fork自 https://github.com/GunwooHan/EasyVtuber
|
||||
并且省略了ifacialmocap pc端,通过UDP直连的方式使ios面捕刷新率达到30fps,解决了面捕刷新率的瓶颈
|
||||
最后,将EasyVtuber中使用的OBS虚拟摄像头方案切换为Unity Capture,解锁RGBA输出能力,无需绿背即可直接使用
|
||||
|
||||
[视频介绍和安装说明](https://www.bilibili.com/video/BV1uu411r7DR)
|
||||
|
||||
## Requirements
|
||||
|
||||
### 硬件
|
||||
@@ -87,6 +89,20 @@ https://github.com/pkhungurn/talking-head-anime-2-demo#download-the-model
|
||||
|
||||
### 输入输出设备
|
||||
|
||||
#### OBS Virtual Camera
|
||||
|
||||
目前更推荐这个方案,UnityCapture存在未查明的性能瓶颈
|
||||
如果你选择自己进行抠像你可以直接输出到obs,如果你需要RGBA支持则需要额外使用一个Shader
|
||||
下载并安装StreamFX https://github.com/Xaymar/obs-StreamFX
|
||||
下载Shader(感谢树根的协助) https://github.com/shugen002/shader/blob/master/merge%20alpha2.hlsl
|
||||
之后,使用`--alpha_split`参数运行
|
||||

|
||||
你会看到这样的输出画面,透明通道单独使用灰度方式发送了
|
||||
之后对OBS中的视频采集设备添加滤镜-着色器-选择你下载的`merge alpha2.hlsl`-关闭
|
||||
这样透明通道就应用回左边的图像了
|
||||
你可能需要手动调整一下裁剪把右侧的无用画面切掉
|
||||
(看不到着色器滤镜的话就是StreamFX没装好或者OBS不是最新版)
|
||||
|
||||
#### UnityCapture
|
||||
|
||||
如果需要使用透明通道输出,参考 https://github.com/schellingb/UnityCapture#installation 安装好UnityCapture
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 136 KiB |
@@ -1,43 +0,0 @@
|
||||
uniform float4x4 ViewProj<
|
||||
bool automatic = true;
|
||||
string name = "View Projection Matrix";
|
||||
>;
|
||||
uniform texture2d InputA<
|
||||
bool automatic = true;
|
||||
>;
|
||||
|
||||
uniform int mode;
|
||||
|
||||
sampler_state textureSampler {
|
||||
Filter = Linear;
|
||||
AddressU = Clamp;
|
||||
AddressV = Clamp;
|
||||
};
|
||||
|
||||
struct VertData {
|
||||
float4 pos : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
VertData VSDefault(VertData vtx)
|
||||
{
|
||||
vtx.pos = mul(float4(vtx.pos.xyz, 1.0), ViewProj);
|
||||
return vtx;
|
||||
}
|
||||
|
||||
float4 PSAlphaFilter(VertData vtx) : TARGET
|
||||
{
|
||||
float2 uv = vtx.uv;
|
||||
float3 pixel = InputA.Sample(textureSampler, float2(vtx.uv.x, vtx.uv.y)).rgb;
|
||||
float alpha = InputA.Sample(textureSampler, float2(vtx.uv.x + 0.5, vtx.uv.y)).g;
|
||||
return float4(clamp(pixel.rgb / alpha, 0.0, 1.0), alpha);
|
||||
}
|
||||
|
||||
technique Draw
|
||||
{
|
||||
pass
|
||||
{
|
||||
vertex_shader = VSDefault(vtx);
|
||||
pixel_shader = PSAlphaFilter(vtx);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user