UnityEngine.RenderTexture 您所在的位置:网站首页 unity获取组件的颜色 UnityEngine.RenderTexture

UnityEngine.RenderTexture

2023-05-28 20:54| 来源: 网络整理| 查看: 265

它们可用于实现基于图像的渲染特效、动态阴影、 投影器、反射或监视摄像机。渲染纹理的一个典型用法是将其设置为 摄像机的“目标纹理”属性 (Camera.targetTexture),这将使摄像机渲染到纹理, 而不是渲染到屏幕。请记住,渲染纹理内容在某些情况下会“丢失”,例如加载新关卡、系统进入屏幕保护模式、进入和退出全屏模式等。 当发生这些情况时,您现有的渲染纹理将再度变为“尚未创建”的状态,您可以使用 IsCreated 函数对此进行检查。与其他“本机引擎对象”类型一样,必须时刻注意任何渲染纹理的生命周期, 并牢记在使用完渲染纹理后使用 Release 函数释放它们, 因为系统不会像对待常规托管类型那样对它们进行垃圾回收。A render texture only has a data representation on the GPU and you need to use Texture2D.ReadPixels to transfer its contents to CPU memory.The initial contents of a newly created render texture are undefined. On some platforms/API's the contents will default to black but users should not depend on this.另请参阅:Camera.targetTexture。



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有