void Update() { if (loading) { return; } if (Input.GetKeyDown(KeyCode.A)) { Debug.Log("Culling Now"); cullingType = CullingType.Custom; } if (Input.GetKeyDown(KeyCode.B)) { Debug.Log("No Longer Culling"); EnableAllChunks(world); cullingType = CullingType.None; } // Cull the scene if (cullingType == CullingType.Custom) { Cull(playerTransform, world); } }
public CullingShader(ComputeShader shader, CullingType type = CullingType.Remove) { _shader = shader; switch (type) { case CullingType.Remove: _cullKernel = new ComputeKernel(ShaderFunctions.Fade, _shader); break; case CullingType.Fade: _cullKernel = new ComputeKernel(ShaderFunctions.Remove, _shader); break; } _cullKernel.SetBuffer(ComputeShaderID.indirectBuffer, _indirectInputBuffer); }
static extern void SceneNode_SetAutomaticCulling(IntPtr scenenode, CullingType enabled);