ShadowHand on a material.mainTexture - Unity

ShadowHand on a material.mainTexture - Unity

I'm trying to show just the blob foreground and not the background. It seems the ShadowHand.cs shadow hand from GlassBalls example loops through each pixel from the labelmap and displays this.. However, instead of having it display as a DrawTexture, I'd like to have it display as a texture in an in-scene gameobject.

Stripped ShadowHand to ShadowHandMod with two methods total: http://pastebin.com/VMheWgsz

In Start, I initize with:

   m_Texture = new Texture2D (size[0], size[1], TextureFormat.ARGB32,false);         
renderer.material.mainTexture = m_Texture;       
 labelmap=new byte[size[0]*size[1]];

In Update between AcquireFrames, I call
  int[] labels=new int[3]{0,256,256};   pp.QueryLabelMap(labelmap,labels);   shm.ProcessTexture(m_Texture,labels,labelmap); 

 

 

However, I always seem to end up with a black texture.

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

up

May have something to do with color and alpha values. The original ShowHang uses (0,0,0,160) to overlap with the screen. On a texture, you might want to try some real color?

 

Leave a Comment

Please sign in to add a comment. Not a member? Join today