本项目演示如何创建自己的顶点动画着色器。场景不使用任何纹理或动画资源,所有内容都使用Shader Graph进行着色和动画处理。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

36 行
971 B

using System;
using UnityEngine;
namespace UnityEditor.Recorder
{
class TextureFlipper : IDisposable
{
RenderTexture m_WorkTexture;
internal void Flip(RenderTexture target)
{
if (m_WorkTexture == null || m_WorkTexture.width != target.width || m_WorkTexture.height != target.height)
{
UnityHelpers.Destroy(m_WorkTexture);
m_WorkTexture = new RenderTexture(target);
}
var sRGBWrite = GL.sRGBWrite;
GL.sRGBWrite = PlayerSettings.colorSpace == ColorSpace.Linear;
Graphics.Blit(target, m_WorkTexture, new Vector2(1.0f, -1.0f), new Vector2(0.0f, 1.0f));
Graphics.Blit(m_WorkTexture, target);
GL.sRGBWrite = sRGBWrite;
}
public void Dispose()
{
UnityHelpers.Destroy(m_WorkTexture);
m_WorkTexture = null;
}
}
}