Ejemplo n.º 1
0
        public ColorARGB32 *GetRayColumn(int rayIndex)
        {
            int partialIdx = rayIndex >> RAYS_SHIFT;
            int rowIdx     = rayIndex & (RAYS_PER_PARTIAL - 1);

            PartialBuffer dataPointer = Partials[partialIdx];

            return(dataPointer.Pixels + rowIdx * PartialWidth);
        }
Ejemplo n.º 2
0
 public Native(Texture2D[] partials, Allocator allocator)
 {
     this.allocator = allocator;
     PartialWidth   = partials[0].width;
     PartialHeight  = partials[0].height;
     Partials       = (PartialBuffer *)UnsafeUtility.Malloc(UnsafeUtility.SizeOf <PartialBuffer>() * partials.Length, UnsafeUtility.AlignOf <PartialBuffer>(), allocator);
     for (int i = 0; i < partials.Length; i++)
     {
         Partials[i] = new PartialBuffer((ColorARGB32 *)partials[i].GetRawTextureData <ColorARGB32>().GetUnsafePtr());
     }
 }