Skip to content

Instantly share code, notes, and snippets.

@cabbibo
Created August 15, 2017 18:15
Show Gist options
  • Save cabbibo/80e46b5c21b9c1a95cbd5e6d35caae82 to your computer and use it in GitHub Desktop.
Save cabbibo/80e46b5c21b9c1a95cbd5e6d35caae82 to your computer and use it in GitHub Desktop.
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