DepthTextureMode.Depth on Mac -> streched Image
System Spec:
OS X El Capitan (10.11)
Unity 5.3.2f1
Problem:
I've got a Problem using Camera.main.depthTextureMode = DepthTextureMode.Depth;
My Project is more complex but I've isolated to this Problem:
In Editor when running and having thes Scene View open or resizing the game view sometimes it gives me this output: Picture is stetched from a certain point.
Anybody else got this Problem? How to solve it?
On MacOS Expport it always gives me this result (Same scene as in Editor)
I've attached this script to my Camera
using UnityEngine;
using System.Collections;
public class ShaderTest : MonoBehaviour {
public DepthTextureMode depthTextureMode = DepthTextureMode.Depth;
private DepthTextureMode m_before = DepthTextureMode.None;
public Vector2 oldSize;
void Start () {
oldSize = new Vector2 (Screen.width, Screen.height);
Debug.Log ("Screen res:" + Screen.width + "x" + Screen.height);
}
void Update () {
Vector2 newSize = new Vector2 (Screen.width, Screen.height);
if (newSize != oldSize) {
Debug.Log ("Screen res:" + Screen.width + "x" + Screen.height);
oldSize = newSize;
}
if (depthTextureMode != m_before) {
// this causes Problems when setting to Depth
Camera.main.depthTextureMode = depthTextureMode;
m_before = depthTextureMode;
}
}
void OnRenderImage (RenderTexture source, RenderTexture destination){
Graphics.Blit(source,destination);
}
}
Your answer
Follow this Question
Related Questions
How do I build on more than one platform? 0 Answers
Create folders on mac 0 Answers
Monodevelop 4.0.1 strange font on Mac El Capitan 0 Answers
How to test standalone OS X app? 2 Answers
Oculus DK2 0.5 SDK not working with Unity 5.0.4f1 with mac OSX 1 Answer