[英]Blur a samplerExternalOES texture in a fragment shader
I'm running a video on a OpenGL texture and applying multiple image filters to it using a fragment shader. 我正在OpenGL纹理上运行视频,并使用片段着色器对其应用多个图像滤镜。
Code snippet from the shader: 着色器中的代码片段:
private static final String fragmentShaderCode =
"#extension GL_OES_EGL_image_external : require\n" +
"precision mediump float;" +
"uniform samplerExternalOES texture;" +
"varying vec2 v_TexCoordinate;" +
...
I'd like to also blur this, but I only found examples to blur a sampler2D texture, not a samplerExternalOES one. 我也想对此进行模糊处理,但是我只找到了一些示例来模糊sampler2D纹理,而不是samplerExternalOES 。
Is it possible to convert from one to the other? 是否可以从一个转换为另一个? Or how would that work?
或如何运作?
You can use this same as sampler2D
. 您可以将其与
sampler2D
相同。 You can access texture using texture2D
function itself. 您可以使用
texture2D
函数本身访问纹理。 Apply your blurr filter as if it was a normal texture. 像对待普通纹理一样应用模糊滤镜。 It should work.
它应该工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.