展开

关键词

TRTCSDK自定义采集Texture2D视频通话

方案: 本篇主要介绍Texture方案:使用安卓系统封装的camera2+GLSurefaceView,采集到OES纹理,使用FBO复制成Texture2D纹理离屏渲染,将纹理ID交给TRTCSDK编码传输 :采样器 采集 aCoord的像素 //赋值给 gl_FragColor 就可以了 gl_FragColor = texture2D(vTexture,aCoord); } 再实例化CameraFilter float; varying vec2 aCoord; uniform sampler2D vTexture; void main(){ gl_FragColor=texture2D 比如美颜操作、水印操作等,都需要处理纹理,将处理之后的Texture2D纹理渲染出来。 image.png 注意,目前TRTCSDK,传输纹理格式,仅支持Texture2D格式,不支持OES格式,而android系统carmera2采集的纹理格式,是OES格式的。

31240

TRTCSDK自定义采集Texture2D视频通话

frame.height = 720; frame.timestamp = 0; TRTCCloud.sendCustomVideoData(frame); 三、Texture2D 方案: 本篇主要介绍Texture方案:使用安卓系统封装的camera2+GLSurefaceView,采集到OES纹理,使用FBO复制成Texture2D纹理离屏渲染,将纹理ID交给TRTCSDK编码传输 float; varying vec2 aCoord; uniform sampler2D vTexture; void main(){ gl_FragColor=texture2D 比如美颜操作、水印操作等,都需要处理纹理,将处理之后的Texture2D纹理渲染出来。 注意,目前TRTCSDK,传输纹理格式,仅支持Texture2D格式,不支持OES格式,而android系统carmera2采集的纹理格式,是OES格式的。

56060
  • 广告
    关闭

    腾讯云618采购季来袭!

    一键领取预热专享618元代金券,2核2G云服务器爆品秒杀低至18元!云产品首单低0.8折起,企业用户购买域名1元起…

  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    TRTCSDK自定义采集Texture2D视频通话

    frame.height = 720; frame.timestamp = 0; TRTCCloud.sendCustomVideoData(frame); 三、Texture2D 方案: 本篇主要介绍Texture方案:使用安卓系统封装的camera2+GLSurefaceView,采集到OES纹理,使用FBO复制成Texture2D纹理离屏渲染,将纹理ID交给TRTCSDK编码传输 float; varying vec2 aCoord; uniform sampler2D vTexture; void main(){ gl_FragColor=texture2D 比如美颜操作、水印操作等,都需要处理纹理,将处理之后的Texture2D纹理渲染出来。 注意,目前TRTCSDK,传输纹理格式,仅支持Texture2D格式,不支持OES格式,而android系统carmera2采集的纹理格式,是OES格式的。

    32641

    【持续更新】Unity代码片段积累

    解决Texture2D提示压缩格式问题,无法转byte[] public static Texture2D DeCompress(Texture2D source) { RenderTexture */ public static Texture2D ResizeTexture(Texture2D source, int newWidth, int newHeight) { FilterMode ConvertTexture(Texture2D orgText, int width, int height) { Texture2D newTex = new Texture2D(width size. */ public static Texture2D CutTexture(Texture2D source, int cutWidth, int cutHeight, int cutOffX Texture2D 90度旋转 public static Texture2D RotateTexture(Texture2D orgTex, bool rotLeft) { FilterMode

    8520

    音视频开发之旅(39)- 高斯模糊实现与优化

    ]).rgb * 0.05; sum += texture2D(inputImageTexture, blurCoordinates[1]).rgb * 0.09; sum += texture2D [3]).rgb * 0.15; sum += texture2D(inputImageTexture, blurCoordinates[4]).rgb * 0.18; sum += texture2D [6]).rgb * 0.12; sum += texture2D(inputImageTexture, blurCoordinates[7]).rgb * 0.09; sum += texture2D [1]).rgb * 0.09; sum += texture2D(inputImageTexture, blurCoordinates[2]).rgb * 0.12; sum += texture2D [4]).rgb * 0.18; sum += texture2D(inputImageTexture, blurCoordinates[5]).rgb * 0.15; sum += texture2D

    78200

    NDK OpenGL ES 3.0 开发(十九):相机抖音滤镜

    (s_textureY, uv).r; u = texture2D(s_textureU, uv).r; v = texture2D(s_textureV, uv).r; u = float u_offset; uniform vec2 texSize; vec4 YuvToRgb(vec2 uv) { float y, u, v, r, g, b; y = texture2D (s_textureY, uv).r; u = texture2D(s_textureU, uv).r; v = texture2D(s_textureV, uv).r; u = (s_textureY, uv).r; u = texture2D(s_textureU, uv).r; v = texture2D(s_textureV, uv).r; u = (s_textureY, uv).r; u = texture2D(s_textureU, uv).r; v = texture2D(s_textureV, uv).r; u =

    46820

    我用 OpenGL ES 给小姐姐做了几个抖音滤镜

    (s_textureY, uv).r; u = texture2D(s_textureU, uv).r; v = texture2D(s_textureV, uv).r; u = float u_offset; uniform vec2 texSize; vec4 YuvToRgb(vec2 uv) { float y, u, v, r, g, b; y = texture2D (s_textureY, uv).r; u = texture2D(s_textureU, uv).r; v = texture2D(s_textureV, uv).r; u = (s_textureY, uv).r; u = texture2D(s_textureU, uv).r; v = texture2D(s_textureV, uv).r; u = (s_textureY, uv).r; u = texture2D(s_textureU, uv).r; v = texture2D(s_textureV, uv).r; u =

    39520

    Unity3d 制作一个立体旋转相册

    的方式进行贴图 创建 Texture2D 需要给定大小,这个大小建议是根据模型来,也就是需要贴到那个模型上 Texture2D texture = new Texture2D(1920, 1080); mainTexture 作为贴图 var meshRender = gameObject.GetComponent<MeshRenderer>(); Texture2D texture = new Texture2D(1920, 1080); texture.LoadImage(File.ReadAllBytes(path)); (_count == _imageList.Length) { _count = 0; } Texture2D texture = new Texture2D(1920, 1080); texture.LoadImage(File.ReadAllBytes(path));

    74320

    WPF 使用 SharpDX 在 D3DImage 显示 介绍创建控件D3D 设备设置指针画出来

    下面来告诉大家如何创建 D3D11.Texture2D ,创建的方法因为需要很多参数,所以代码很多 从 D3D11.Texture2D 的构造函数可以知道,需要传入两个参数 D3D11.Device 和 ,创建只需要使用下面代码 var renderTarget = new D3D11.Texture2D(device, renderDesc); 设置指针 创建好了 D3D11 .Texture2D 需要让 D3DImage 显示需要使用 SetBackBuffer 设置。 因为传入 D3D11.Texture2D ,但是 D3DImage 是 dx9 的,所以需要转换一下。 但是直接使用 D3D11.Texture2D 是无法画出来的,如果需要 D2D.RenderTarget 还需要通过 D3D11.Texture2D 创建 Surface 为缓冲区。

    1.1K10

    虚拟3D汽车展示项目

    GUISkin customSkin;//自定义皮肤 private Rect closeButton = new Rect(415, 0, 26, 22);//关闭按钮 public Texture2D Rect stateBox = new Rect(157,50,280,210); private string[] functionStr ; //功能选项数组 public Texture2D redBtn; public Texture2D greenBtn; public Texture2D blueBtn; public Texture2D orangeBtn; public Texture2D whiteBtn; public Texture2D blackBtn; private Texture2D[] iBtn; //iBtn = new Texture2D[6]{redBtn,greenBtn,blueBtn,orangeBtn,whiteBtn,blackBtn}; private Rect[] pBtn = new

    53420

    抖音樱花

    (uSrc, texCoord); col = col + texture2D(uSrc, texCoord + uBlurDir.xy * uDelta); col = col + texture2D (uSrc, texCoord - uBlurDir.xy * uDelta); col = col + texture2D(uSrc, texCoord + (uBlurDir.xy + uBlurDir.zw ) * uDelta); col = col + texture2D(uSrc, texCoord - (uBlurDir.xy + uBlurDir.zw) * uDelta); gl_FragColor uDelta; varying vec2 texCoord; varying vec2 screenCoord; void main(void) { gl_FragColor = texture2D (uSrc, texCoord) * 2.0; vec4 bloomcol = texture2D(uBloom, texCoord); vec4 col; col = srccol

    15710

    GPUImage源码解读(四) - 图像锐化

    ).r;    float bottomRightIntensity = texture2D(inputImageTexture, bottomRightTextureCoordinate).r;     float leftIntensity = texture2D(inputImageTexture, leftTextureCoordinate).r;    float rightIntensity = texture2D(inputImageTexture, rightTextureCoordinate).r;    float bottomIntensity = texture2D(inputImageTexture , bottomTextureCoordinate).r;    float topIntensity = texture2D(inputImageTexture, topTextureCoordinate ).rgb;     mediump vec3 topTextureColor = texture2D(inputImageTexture, topTextureCoordinate).rgb;

    2.3K31

    我用 OpenGL 实现了那些年流行的相机滤镜

    u_offset;//偏移量 uniform vec2 texSize;//纹理尺寸 vec4 YuvToRgb(vec2 uv) {     float y, u, v, r, g, b;     y = texture2D (s_textureY, uv).r;     u = texture2D(s_textureU, uv).r;     v = texture2D(s_textureV, uv).r;     u = (s_textureY, uv).r;     u = texture2D(s_textureU, uv).r;     v = texture2D(s_textureV, uv).r;     u =  float u_offset; uniform vec2 texSize; vec4 YuvToRgb(vec2 uv) {     float y, u, v, r, g, b;     y = texture2D (s_textureY, uv).r;     u = texture2D(s_textureU, uv).r;     v = texture2D(s_textureV, uv).r;     u =

    43910

    OpenGL Shader实例分析(7)雪花飘落效果

    iGlobalTime _Time.y #define mod fmod #define mix lerp #define atan atan2 #define fract frac #define texture2D cos(an), sin(an) ) * (1.0+0.6*cos(7.0*an+iGlobalTime)) + vec2( 0.0, iGlobalTime ); col = max( col, texture2D cos(an), sin(an) ) * (1.0+0.6*cos(7.0*an+iGlobalTime)) + vec2( 0.0, iGlobalTime ); col = max( col, texture2D i<dd; i++ ) { float an = 6.2831*float(i)/dd; vec2 of = vec2( cos(an), sin(an) ); col = max( col, texture2D = 6.2831*float(i)/dd; vec2 of = vec2( cos(an), sin(an) ) * (1.0+0.7*cos(7.0*an)); col = max( col, texture2D

    31910

    Cocos实现对ETC2的支持

    ::PixelFormat::ETC2_RGB; else _renderFormat = Texture2D::PixelFormat::ETC2_RGBA; ::PixelFormat::ETC2_RGB, Texture2D::PixelFormatInfo(GL_COMPRESSED_RGB8_ETC2, 0xFFFFFFFF, 0xFFFFFFFF, 4, true, false)), PixelFormatInfoMapValue(Texture2D::PixelFormat::ETC2_RGBA, Texture2D::PixelFormatInfo (GL_COMPRESSED_RGBA8_ETC2_EAC, 0xFFFFFFFF, 0xFFFFFFFF, 8, true, true)), Texture2D::getStringForFormat 增加格式说明,其实不加也没关系: case Texture2D::PixelFormat::ETC2_RGB: return "ETC2_RGB"; case Texture2D

    1.6K20

    OpenGL ES GLSL马赛克滤镜实现(3)

    mosaicSize.y); vec2 UVMosaic = vec2(XYMosaic.x/TexSize.x, XYMosaic.y/TexSize.y); vec4 color = texture2D y, 2.0)); if (s1 < s2) { vn = v1; } else { vn = v2; } vec4 color = texture2D 2.0)); if (s1 < s2) { vn = v1; } else { vn = v2; } vec4 mid = texture2D XYMosaic.y/TexSize.y); vec4 _finalColor; if(delL< 0.5*mosaicSize.x) _finalColor = texture2D (Texture,UVMosaic); else _finalColor = texture2D(Texture,TextureCoordsVarying);

    54810

    unity3d纹理格式设置

    ----------------------------- static void SelectedChangeIsReadable(bool enabled) { Object; foreach (Texture2D (path); } } static void SelectedChangeNonPowerOf2(TextureImporterNPOTScale npot) { Object; foreach (Texture2D AssetDatabase.ImportAsset(path); } } static void SelectedChangeMimMap(bool enabled) { Object; foreach (Texture2D Unity3D教程手册:www.unitymanual.com static void SelectedChangeMaxTextureSize(int size) { Object; foreach (Texture2D static void SelectedChangeTextureFormatSettings(TextureImporterFormat newFormat) { Object; foreach (Texture2D

    46410

    OpenGL ES GLSL滤镜实现(2)

    ; uniform sampler2D Texture; varying vec2 TextureCoordsVarying; void main (void) { vec4 mask = texture2D uniform sampler2D Texture; varying vec2 TextureCoordsVarying; void main (void) { vec4 mask = texture2D uniform sampler2D Texture; varying vec2 TextureCoordsVarying; void main (void) { vec4 mask = texture2D uniform sampler2D Texture; varying vec2 TextureCoordsVarying; void main (void) { vec4 mask = texture2D

    48720

    用ECMAScript4 ( ActionScript3) 实现Unity的热更新 -- 热更新Live2D

    live2DModel.setTexture(0,Resources.load_("haru.1024/texture_00", Texture2D ) as Texture2D); live2DModel.setTexture(1,Resources.load_("haru.1024/texture_01", Texture2D) as Texture2D); live2DModel.setTexture(2,Resources.load_("haru.1024/texture_02", Texture2D) as Texture2D); var modelWidth:Number = live2DModel.getCanvasWidth();

    44630

    如何在 Creator3D 中切换模型贴图,超级简单

    注意 3D 物体上的贴图不是Cocos Creator中的 SpriteFrame,而是 Texture2D 类型,下面是 Texture1、Texture2属性定义: @ccclass("test") export class test extends Component { @property({type: Texture2D }) texture1: Texture2D = null ; @property(Texture2D) texture2: Texture2D = null; } 复杂数据类型需要给 @property 输入一个 type 参数,同时下面一行

    59820

    相关产品

    • 云服务器

      云服务器

      云端获取和启用云服务器,并实时扩展或缩减云计算资源。云服务器 支持按实际使用的资源计费,可以为您节约计算成本。 腾讯云服务器(CVM)为您提供安全可靠的弹性云计算服务。只需几分钟,您就可以在云端获取和启用云服务器,并实时扩展或缩减云计算资源。云服务器 支持按实际使用的资源计费,可以为您节约计算成本。

    相关资讯

    热门标签

    扫码关注云+社区

    领取腾讯云代金券