// Compute trees and objects public bool ComputeItem(ref ComputeBuffer itemMapBuffer, ref ComputeBuffer maskBuffer, float seedParent, bool first = false) { TC_Compute compute = TC_Compute.instance; bool didCompute = false; float seedTotal = seed + seedParent; ComputeBuffer selectBuffer = selectNodeGroup.ComputeValue(seedTotal); if (selectBuffer != null) { didCompute = true; TC_Compute.InitPreviewRenderTexture(ref rtPreview, "rtPreview_Layer_" + TC.outputNames[outputId]); rtDisplay = rtPreview; TC_Compute.InitPreviewRenderTexture(ref selectNodeGroup.rtColorPreview, "rtColorPreview"); compute.RunItemCompute(this, ref itemMapBuffer, ref selectBuffer); compute.DisposeBuffer(ref selectBuffer); // compute.shader.SetBuffer(compute.terrainSplatmap0Kernel, "itemMapBuffer", itemMapBuffer); // compute.RunItemPositionCompute(itemMapBuffer, TC.treeOutput); if (maskNodeGroup.active) { maskBuffer = maskNodeGroup.ComputeValue(seedTotal); } if (maskBuffer != null) { TC_Reporter.Log("Run layer select * mask"); if (method != Method.Lerp || first) { compute.RunItemComputeMask(this, ref rtPreview, selectNodeGroup.rtColorPreview, ref itemMapBuffer, ref maskBuffer); } } } return(didCompute); }