Created
August 15, 2017 18:15
-
-
Save cabbibo/80e46b5c21b9c1a95cbd5e6d35caae82 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class RenderPointCloud : MonoBehaviour { | |
public Material material; | |
public ARKitComputeCloud cloud; | |
// Use this for initialization | |
void Start () { | |
if( cloud == null ){ cloud = GetComponent<ARKitComputeCloud>(); } | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
void OnRenderObject(){ | |
material.SetPass(0); | |
material.SetBuffer( "_vertBuffer", cloud._buffer ); | |
Graphics.DrawProcedural(MeshTopology.Triangles, cloud.maxPointsToShow * 6 ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment