Exemple #1
0
 public override void FrameUpdate(PipelineCamera cam, ref PipelineCommandData data, CommandBuffer buffer)
 {
     buffer.SetRenderTarget(cam.targets.renderTargetIdentifier, cam.targets.depthIdentifier);
     cullJobHandler.Complete();
     UnsafeUtility.ReleaseGCObject(gcHandler);
     //Use Result Indices
     foreach (int i in cullJob.resultIndices)
     {
         ReflectionCube cube = ReflectionCube.allCubes[i];
         block.SetTexture(_ReflectionProbe, cube.reflectionCube);
         buffer.DrawMesh(GraphicsUtility.cubeMesh, cube.localToWorld, reflectMaterial, 0, 0, block);
     }
     //TODO
     cullJob.resultIndices.Dispose();
 }
Exemple #2
0
        public void Execute(int index)
        {
            ReflectionCube cube = ReflectionCube.allCubes[index];

            if (PipelineFunctions.FrustumCulling(ref cube.localToWorld, new Vector3(0.5f, 0.5f, 0.5f), planes))
            {
#if UNITY_EDITOR        //For debugging
                if (!resultIndices.ConcurrentAdd(index))
                {
                    Debug.LogError("Reflection culling Out of range");
                }
#else
                resultIndices.ConcurrentAdd(index);
#endif
            }
        }