Ejemplo n.º 1
0
        /// <summary>
        /// Execute Init kernel
        /// </summary>
        protected override void ExecuteInitKernel()
        {
            int kernel = CubeCS.FindKernel("Init");

            CubeCS.SetVector("_CubeNumXYZ", CubeNumEachDir);
            CubeCS.SetVector("_PosStepXYZ", PosStep);
            CubeCS.SetVector("_ArangeCenterXYZ", ArangeCenter);
            CubeCS.SetBuffer(kernel, "_CubeBuffer", cubeBuffer);
            CubeCS.Dispatch(kernel, threadGroupSize.x, threadGroupSize.y, threadGroupSize.z);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Execute Init kernel
        /// </summary>
        protected override void ExecuteInitKernel()
        {
            int kernel = CubeCS.FindKernel("Init");

            CubeCS.SetInt("_CubeNumX", (int)CubeNumEachDir.x);
            CubeCS.SetFloat("_PosStep", PosStep.x);
            CubeCS.SetFloat("_ArangeCenter", ArangeCenter.x);
            CubeCS.SetBuffer(kernel, "_CubeBuffer", cubeBuffer);
            CubeCS.Dispatch(kernel, threadGroupSize.x, threadGroupSize.y, threadGroupSize.z);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Execute Update kernel
        /// </summary>
        protected override void ExecuteUpdateKernel()
        {
            int kernel = CubeCS.FindKernel("Update");

            CubeCS.SetFloat("_TimeSpeed", TimeSpeed);
            CubeCS.SetFloat("_ElapsedTime", elapsedTime);
            CubeCS.SetVector("_CubeNumXYZ", CubeNumEachDir);
            CubeCS.SetVector("_CubeSizeXYZ", CubeSize);
            CubeCS.SetBuffer(kernel, "_CubeBuffer", cubeBuffer);
            CubeCS.Dispatch(kernel, threadGroupSize.x, threadGroupSize.y, threadGroupSize.z);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Execute Init kernel
        /// </summary>
        protected override void ExecuteInitKernel()
        {
            int kernel = CubeCS.FindKernel("Init");

            // 注意点
            // SetVectorで渡す変数の型を間違えないように。
            // Vector3はFloat型になるから、基本GPU側で受け取る変数の型もfloat3とかにしておく
            CubeCS.SetVector("_CubeNumXY", CubeNumEachDir);
            CubeCS.SetVector("_PosStepXY", PosStep);
            CubeCS.SetVector("_ArangeCenterXY", ArangeCenter);
            CubeCS.SetBuffer(kernel, "_CubeBuffer", cubeBuffer);
            CubeCS.Dispatch(kernel, threadGroupSize.x, threadGroupSize.y, threadGroupSize.z);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Execute Update kernel
        /// </summary>
        protected override void ExecuteUpdateKernel()
        {
            int kernel = CubeCS.FindKernel("Update");

            CubeCS.SetInt("_BlockCenterID", blockCenterID);
            CubeCS.SetInt("_CenterID", centerID);
            CubeCS.SetFloat("_DistWeight", DistWeight);
            CubeCS.SetFloat("_DistWeight2", DistWeight2);
            CubeCS.SetFloat("_ColorIntensity", ColorIntensity);
            CubeCS.SetFloat("_ColorIntensity2", ColorIntensity2);
            CubeCS.SetFloat("_TimeSpeed", TimeSpeed);
            CubeCS.SetFloat("_DeltaTime", Time.deltaTime);
            CubeCS.SetFloat("_ElapsedTime", elapsedTime);
            CubeCS.SetFloat("_NoiseWeight", NoiseWeight);
            CubeCS.SetVector("_CubeNumXYZ", CubeNumEachDir);
            CubeCS.SetVector("_CubeSizeXYZ", CubeSize);
            CubeCS.SetBuffer(kernel, "_CubeBuffer", cubeBuffer);
            CubeCS.Dispatch(kernel, threadGroupSize.x, threadGroupSize.y, threadGroupSize.z);
        }