delphi - 如何用delphi绘制YUV纹理?
问题描述
据我所知,YUV 纹理是 2 个纹理(Y 和 UV)的组合。这两个纹理必须使用像这样的着色器在画布上绘制:
#version 100
precision mediump float;
varying vec2 vUV;
uniform sampler2D SamplerY;
uniform sampler2D SamplerUV;
void main() {
mediump vec3 yuv;
lowp vec3 rgb;
yuv.x = texture2D(SamplerY, vUV).r;
yuv.yz = texture2D(SamplerUV, vUV).rg - vec2(0.5, 0.5);
// Using BT.709 which is the standard for HDTV
rgb = mat3( 1, 1, 1,
0, -.18732, 1.8556,
1.57481, -.46813, 0) * yuv;
gl_FragColor = vec4(rgb, 1);
}
我知道如何使用带有一个纹理的着色器,但是我不知道如何在参数中使用带有 2 个纹理的着色器
解决方案
推荐阅读
- html - Chrome 不会在 html 中自动播放我想要的音乐
- database - Data Vault 2.0 - 什么是多活动卫星?
- java - 当另一个 java 程序在进程中启动时,Java jar 执行卡住了
- c# - 无法将 EventToCommand 添加到 TriggerActionCollection
- r - 有没有办法告诉复制函数制作字符串多长时间?
- kibana - 使用 ELK 堆栈跟踪分布式系统中的调用和使用 Dynatrace 分布式跟踪有什么区别?
- python - 如何将双向 LSTM 状态传递给较早的 LSTM 层?
- python - 尝试计算数据框列子集中的 NaN 时出现 Pandas TypeError
- reactjs - 反应路由器 useHistory 钩子返回未定义
- reactive-programming - 并行化过滤操作