vault backup: 2024-10-16 12:45:55
This commit is contained in:
parent
a9e34b66d1
commit
1f48905114
@ -146,4 +146,44 @@ UNDIMediaReceiver::CaptureConnectedVideo
|
||||
=>
|
||||
DisplayFrame NDIlib_frame_format_type_progressive NDIlib_FourCC_video_type_UYVY
|
||||
=>
|
||||
DrawProgressiveVideoFrame
|
||||
DrawProgressiveVideoFrame
|
||||
|
||||
## 解决方案
|
||||
[NDI plugin质量问题](https://forums.unrealengine.com/t/ndi-plugin-quality-trouble/1970097)
|
||||
|
||||
I changed only shader “NDIIO/Shaders/Private/NDIIOShaders.usf”.
|
||||
For example function **void NDIIOUYVYtoBGRAPS (// Shader from 8 bits UYVY to 8 bits RGBA (alpha set to 1)):**
|
||||
|
||||
_WAS:_
|
||||
|
||||
```c++
|
||||
float4 UYVYB = NDIIOShaderUB.InputTarget.Sample(NDIIOShaderUB.SamplerB, InUV);
|
||||
float4 UYVYT = NDIIOShaderUB.InputTarget.Sample(NDIIOShaderUB.SamplerT, InUV);
|
||||
float PosX = 2.0f * InUV.x * NDIIOShaderUB.InputWidth;
|
||||
float4 YUVA;
|
||||
float FracX = PosX % 2.0f;
|
||||
YUVA.x = (1 - FracX) * UYVYT.y + FracX * UYVYT.w;
|
||||
YUVA.yz = UYVYB.zx;
|
||||
YUVA.w = 1;
|
||||
```
|
||||
|
||||
_I DID:_
|
||||
|
||||
```c++
|
||||
float4 UYVYB = NDIIOShaderUB.InputTarget.Sample(NDIIOShaderUB.SamplerB, InUV);
|
||||
float4 UYVYT0 = NDIIOShaderUB.InputTarget.Sample(NDIIOShaderUB.SamplerT, InUV + float2(-0.25f / NDIIOShaderUB.InputWidth, 0));
|
||||
float4 UYVYT1 = NDIIOShaderUB.InputTarget.Sample(NDIIOShaderUB.SamplerT, InUV + float2(0.25f / NDIIOShaderUB.InputWidth, 0));
|
||||
float PosX = 2.0f * InUV.x * NDIIOShaderUB.InputWidth;
|
||||
float4 YUVA;
|
||||
float FracX = (PosX % 2.0f) * 0.5f;
|
||||
YUVA.x = (1 - FracX) * UYVYT1.y + FracX * UYVYT0.w;
|
||||
YUVA.yz = UYVYB.zx;
|
||||
YUVA.w = 1;
|
||||
```
|
||||
|
||||
Small changes but result is seems much more better.
|
||||
Of course, I added a bit of sharpness to the material after I changed the shader, but even without that, the result looks better than in the original version.
|
||||
## UYVY(YUV422)
|
||||
- https://zhuanlan.zhihu.com/p/695302926
|
||||
- https://blog.csdn.net/gsp1004/article/details/103037312
|
||||

|
Loading…
x
Reference in New Issue
Block a user