diff --git a/Runtime/Tx/DepthCameraTx.cs b/Runtime/Tx/DepthCameraTx.cs index 8e0b45d..18009fa 100644 --- a/Runtime/Tx/DepthCameraTx.cs +++ b/Runtime/Tx/DepthCameraTx.cs @@ -21,6 +21,7 @@ public class DepthCameraTx : ProBridgeTxStamped public RawImage _rawImage; [Range(1, 100)] public int CompressionQuality = 90; public Shader depthShader; + public bool invertDepthColors = false; public bool getPointCloud = false; public PointCloud pointCloud @@ -85,6 +86,17 @@ protected override ProBridge.ProBridge.Msg GetMsg(TimeSpan ts) NativeArray raw = tex.GetRawTextureData(); byte[] rgbaBytes = raw.ToArray(); + if (invertDepthColors) + { + for (int i = 0; i < rgbaBytes.Length; i += 4) + { + byte inv = (byte)(255 - rgbaBytes[i]); + rgbaBytes[i] = inv; + rgbaBytes[i + 1] = inv; + rgbaBytes[i + 2] = inv; + } + } + var jpg = _compressor.Compress( rgbaBytes, 0, tex.width, tex.height,