Comments (6)
Okay @MarekKowalski, I got it rendering on the iPhone! Since I removed the gesture control code, I had to rotate the camera Y axis 180 degrees to see it. That shader is still an issue though, it just renders depth, it doesn't render color at all.
Also one other thing, the background is black. Would you know would I go about making the background transparent and having the background be my phone's camera feed for some sort of AR experience? Thanks again for your help and project!
Edit: I found this thread which has some great conversation on the issue: https://forum.unity.com/threads/ios-11-metal2-has-no-geometry-shader.499676/
So in short, Apple doesn't support Geometry shaders. Admittedly I don't know much about building shaders, I am not sure how get the same functionality from your Geometry shader using Compute shaders. If you could shed some light on this it would be greatly appreciated!
Double Edit: I modified the shader to use the color from the application. It doesn't do the triangle geometry but I will have to look into modifying the shader to do the geometry with compute code.
Here is the shader code:
// Don't remove the following line. It is used to bypass Unity
// upgrader change. This is necessary to make sure the shader
// continues to compile on Unity 5.2
// Created by Team Tango
// Modified by Nick Castellucci to preserve color on iOS for
// LiveScan3D
// UNITY_SHADER_NO_UPGRADE
Shader "Tango/PointCloud" {
Properties{
point_size("Point Size", Float) = 5.0
}
SubShader {
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
// add color here because livescan3d transmits it
float4 color : COLOR;
};
struct v2f
{
float4 vertex : SV_POSITION;
float4 color : COLOR;
float size : PSIZE;
};
float4x4 depthCameraTUnityWorld;
float point_size;
v2f vert (appdata v)
{
v2f o;
o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
o.size = point_size;
// Use color from appdata
o.color = v.color;
return o;
}
fixed4 frag (v2f i) : SV_Target
{
return i.color;
}
ENDCG
}
}
}
from livescan3d-hololens.
Hi,
I had an email from someone who had a similar issue previously, he used this shader:
https://github.com/googlearchive/tango-examples-unity/blob/master/UnityExamples/Assets/TangoPrefabs/Shaders/PointCloud.shader
And apparently he got it working on an iPhone 8.
Let me know if it worked!
Marek
from livescan3d-hololens.
Thank you @MarekKowalski! I will try this and report back. I think I still have an error to fix, I was getting a black screen on iOS after the Unity logo appears and the logs say "SocketException:Connection Refused". This is strange to me because on the PC where I am running the server I see that the port connection is established and looking at Wireshark logs I can see the point cloud stream is being sent to my phone's IP over port 48002.
I thought even with the bad shader it should still render, albeit just a solid pink color? Maybe I'm wrong, will let you know as soon as I try with the shader you provided. Thanks again!
from livescan3d-hololens.
How did You manage to autoconnect at start, it always freezes my editor when I try to get it like this
from livescan3d-hololens.
@nickcastel50, congratulations on your progress and sorry I did not answer, for some reason I missed your post completely :( Unfortunately I know little a bout shaders as well, so I won't be able to help you there. Your project sounds quite interesting, please post more info about your progress or maybe show a video.
@TheBricktop , have you made sure the live view window is open and showing the point cloud (on the same device as Unity)? If you did and it does not work, please check your firewall settings.
Marek
from livescan3d-hololens.
How did You manage to autoconnect at start, it always freezes my editor when I try to get it like this
@TheBricktop: You can just just modify the KeyboardInput.cs file in @MarekKowalski's project. Just call keyboardDone.invoke(YOUR_IP_ADDRESS); in the start() function. It works fine for testing.
Something like this:
void Start ()
{
if (keyboardDone != null)
keyboardDone.Invoke(YOUR_IP_ADDRESS);
}
void Update ()
{
}
from livescan3d-hololens.
Related Issues (20)
- SocketException:Unable to connect because the target computer is actively rejected HOT 2
- Port to Magic Leap
- Using RealSense D400 series cameras HOT 1
- Build error HOT 1
- Will you support Hololens2? HOT 9
- Building and Deploying the LiveScan3D-Hololens (Windows 10 and Unity) HOT 5
- Issues building with Unity 5.6.0f3 & Visual Studio 2017 HOT 3
- Telelens of hololens must try in vaccum so it can provide better visuals
- Having difficulty connecting HoloLens to Azure Kinect HOT 2
- there's nothing in the hololens after inputing ip HOT 5
- Release for Hololens 2? HOT 12
- Access Skeleton Data along with Point Cloud HOT 2
- hi I wondering this system can control two azure kinect on 1 PC at the same time๏ผ HOT 1
- How do I get stream to flow into Unity HOT 2
- Does this code support Azure Kinect DK and Hololens2? HOT 1
- Point cloud can't show in hololens2 HOT 10
- Hololens2 ARM?
- Unity problem DirectoryNotFoundException: Could not find a part of the path HOT 5
- Hololens2 issue with MRTK Version HOT 9
- Very low fps HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from livescan3d-hololens.