在unity后处理回调函数OnPostImage函数中,直接用 Graphisc.blit(RenderTexture.active, myRendtexture) 会出现拷贝数据不正确的现象 不能进行纹理缩放, 解决方法: 使用一个中间纹理处理: Graphics.blit(RenderTexture.active, myRendtexture1); Graphics.blit(myRendtexture1, myRendtexture); 这样可以使用带放缩的拷贝函数: 例如: Graphics.blit(myRendtexture1, myRendtexture, new Vector2(2,2), new Vector2(0,0)); new Vector2(2,2) 表示对原纹理缩小2倍到myRendtexture 中,然后使用ReadPixels读取到 cpu纹理的Texture2d纹理中 |
|
来自: mediatv > 《unit3d游戏》