I’m working on a new demo for Unity and get some issues on Graphics.Blit(RT, RT) in linear mode.
- Create a new project with Project Settings > Player > Color Space [Linear]
- New Scene, create Cube, attach the following script.
- Press Play, click on Inspector RT_MainSrc followed by RT_MainDst.
Graphics.Blit() change the colors, but it shouldn’t. Would be great if someone can confirm this.
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour {
public RenderTexture RT_MainSrc;
public RenderTexture RT_MainDst;
// Use this for initialization
void Start () {
RT_MainSrc = new RenderTexture(256, 256, 0);
RT_MainSrc.wrapMode = TextureWrapMode.Repeat;
RT_MainSrc.generateMips = true;
RT_MainSrc.Create();
RT_MainDst = new RenderTexture(256, 256, 0);
RT_MainDst.wrapMode = TextureWrapMode.Repeat;
RT_MainDst.generateMips = true;
RT_MainDst.Create();
RenderTexture.active = RT_MainSrc;
GL.Begin(GL.TRIANGLES);
Vector4 col;
col.x = 0.5f;
col.y = 0.5f;
col.z = 1f;
col.w = 1f;
GL.Clear(false, true, col);
GL.End();
Graphics.Blit(RT_MainSrc, RT_MainDst);
}
}