void Awake() { renderCam.depthTextureMode = DepthTextureMode.Depth; softSlicePostProcess = renderCam.GetComponent <hypercube.softOverlap>(); slicePost = renderCam.GetComponent <hypercube.slicePostProcess>(); }
//let the slice image filter shader know how much 'softness' they should apply to the soft overlap void updateOverlap() { if (overlap < 0) { overlap = 0; } hypercube.softOverlap o = renderCam.GetComponent <hypercube.softOverlap>(); if (slicing != softSliceMode.HARD) { if (slicing == softSliceMode.SOFT) { softness = overlap / ((overlap * 2f) + 1f); //this calculates exact interpolation between the end of a slice and the end of it's overlap area } o.enabled = true; o.setShaderProperties(softness, blackPoint); } else { o.enabled = false; } }